ekante Posted April 21, 2009 Share Posted April 21, 2009 Where is problem, why doesnt it assign anything to $status ? <?php echo ' <tr> <td width=\"150\" align=\"right\">Tava karjera :</td> <td><select name=\"Chose\"> <option value=\"$select_waiting\">Simple User</option> <option value=\"$select_pilot\">Pilot</option> <option value=\"$select_manager\">Manager</option> </select>* $user_taken_err</td> </tr>'; if (isset($select_waiting)) { $status = "waiting"; } if (isset($select_manager)) { $status = "manager"; } if (isset($select_pilot)) { $status = "pilot"; } ?> Link to comment https://forums.phpfreaks.com/topic/155023-solved-problem-with-option-tags/ Share on other sites More sharing options...
jackpf Posted April 21, 2009 Share Posted April 21, 2009 Because you're not posting anything? Also, you're variables are being echoed within single quotes so they will not expand. Link to comment https://forums.phpfreaks.com/topic/155023-solved-problem-with-option-tags/#findComment-815374 Share on other sites More sharing options...
rhodesa Posted April 21, 2009 Share Posted April 21, 2009 You don't quite understand how PHP works and separation of Server Side and Client Side code. HTML is Client Side code. Basically, your webserver passes a text file with a bunch of HTML tags and text in it to the client's browser. The client's browser then interprets this text file and renders it as a webpage. PHP is Server Side code. It it used to make the text file that is sent to the client's browser more dynamic. So, all the steps that happen are as follows: -Client requests webpage -Server receives request and gets file being requested -Server sends the file through the PHP parser -Server sends render text file to client -Client receives text file -Client parses HTML and renders the webpage Now, if you want to send data from the client back to the server, you need to make another request and pass the data with it (usually in the form of a form). Here is a basic example of a form post: <?php if($_SERVER['REQUEST_METHOD'] == 'POST'){ print "You selected ".$_POST['fruit']; exit; } ?> <form method="post" action=""> <select name="fruit"> <option>Apple</option> <option>Orange</option> <option>Banana</option> </select> <input type="submit" value="Submit" /> </form> Here is a good, thorough tutorial on PHP if you are interested: http://devzone.zend.com/node/view/id/627 Link to comment https://forums.phpfreaks.com/topic/155023-solved-problem-with-option-tags/#findComment-815380 Share on other sites More sharing options...
ekante Posted April 21, 2009 Author Share Posted April 21, 2009 Thanks for making all seem clear, yeah i realy didnt undertood the princip. its working now, and thanks again Regards. Link to comment https://forums.phpfreaks.com/topic/155023-solved-problem-with-option-tags/#findComment-815483 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.