note 58457 added to tutorial.useful

From: Date: Fri, 04 Nov 2005 20:49:54 +0000
Subject: note 58457 added to tutorial.useful
Groups: php.notes 
Request: Send a blank email to php-notes+get-98086@lists.php.net to get a copy of this message
Using php in the above fasion allows for more complex coding . I have used this methiod many times in my experiance. It alows for more complex if else statments leting you run mutiable objects inside just one page. It can be used in session to load diffrent objects example: <?php if($session->logged_in){ echo "Welcome, $session->username" ?> <table> <tr> <td><a href="foo.php">$foo</a></td> <td><a href="bar.php">$bar</a></td> </tr> </table> <?php }else{ ?> <form name="form1" method="post" action=""> <table width="196"> <tr> <td width="87">foo</td> <td width="97"><input name="textfield" type="text" size="20"></td> </tr> <tr> <td>bar</td> <td><input name="textfield2" type="text" size="20"></td> </tr> <tr> <td colspan="2"><div align="right"> <input type="submit" name="Submit" value="Submit"> </div></td> </tr> </table> </form> <?php } ?> The above example will check if the user is loged in if so will show a welcome message and a mock menu. Else, it will show a mock login form. I am sure it can be used in many other ways othere than with sessions. ---- Manual Page -- http://www.php.net/manual/en/tutorial.useful.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+58457 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+58457&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+58457&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+58457&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+58457&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+58457&report=yes&reason=non-english Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+58457&report=yes&reason=already+in+docs Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+58457&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+58457&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#98086) next »