2009/1/24 Christopher W <cwei...@adelphia.net>:
> At least I hope it is simple...
>
> I am trying to get an HTML menu link to set a variable's value.  For
> example, when a user clicks the "Home" button on my page it would cause
> $page = "home"; or clicking the "About Us" button will set $page="about_us";
> etc.
>
> I think this should be fairly simple but being completely new to php I just
> cannot seem to get it right.
>
> Any help would be greatly appreciate.
>
> Thank you in advance.

Hi there,

A good way to increase your chance of getting a useful response is to
post the smallest example you can which clearly illustrates the
problem you're having. In this case, you say you're not able to get
this to work, but we could waste quite a bit of time trying to guess
what you've tried and what didn't work.

In the simplest case, you could make your menu items look something
like this: <a href="target.html?page=home">Home</a> and then use $page
= $_GET['page'] in your script, but I wouldn't recommend it since now
you have user data floating around in your script and it will later
become a pain in the butt to sanitize for security. For a learning
script it'll be fine though.


Torben

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to