Hacker News new | past | comments | ask | show | jobs | submit login

PHP:

  if ($S['foo']) echo "you said {$S['foo']}";
  elseif (PtoS('foo')) link('said','click here');
  else form('foo');
For me, making programs short is not a design goal. But if it would, I would do it like above. My framework then would include this functionality:

  S[] contains all session variables
  P[] contains all posted variables
  PtoS copies an entry from P to S. Returns false if P was not set.
  link() prints a link
  form() shows a form with the given fields. target is the current url.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: