if ($action=='list') {
  if (!$clientcode) {
  <old_code>
  } else {
  <new_code>
  }
}

I put the $clientcode test inside the $action test because I suppose you take
different actions on $clientcode depending on $action - if that's not the
case, simply switch the two if's.

This assumes that $clientcode>0. If you also use 0, then test if
(!isset($clientcode)) instead.

Bogdan

Necro wrote:

> I have a page for listing the contents of a table from my db.
> Being client.php?action=list
> As the action variable also allows for adding extra to the table, etc.
>
> Once I use ?action=list I want to be able to click on a single record and
> have it give me the extended info.
> so client.php?action=list&clientcode=(the clients id in the db)
>
> My problem is working out how to evaluate this new part. I have normal If
> statements for the listing, adding, etc. But how can I get it to check if
> clientcode is present. If clientcode is not present I want it to load the
> list page as normal. But if the clientcode is present then it is to load
> something else.
>
> How do I structure my IF statement?
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to