Using php with <input>
Posted: Fri Jul 25, 2008 3:24 am
I would like to use some php script in the body of a php document that changes the inclusion of a <div> or a <table> depending on the users input.
For instance:
<input name=user_input value="<?php echo $user ?>" etc. >
if ($user == "Fred")
{include ('Fred_Div.php');}
if ($user == "Graham")
{include ('Graham_Div.php');}
Where Fred_Div.php and Graham_Div.php have been predefined as simple HTML code snippets stored as .php files
I have tried using $_COOKIE but this doesn't seem to work. Perhaps I need to pre-define ?
For instance:
<input name=user_input value="<?php echo $user ?>" etc. >
if ($user == "Fred")
{include ('Fred_Div.php');}
if ($user == "Graham")
{include ('Graham_Div.php');}
Where Fred_Div.php and Graham_Div.php have been predefined as simple HTML code snippets stored as .php files
I have tried using $_COOKIE but this doesn't seem to work. Perhaps I need to pre-define ?