note 58457 deleted from tutorial.useful by philip

From: Date: Thu, 09 Mar 2006 06:08:12 +0000
Subject: note 58457 deleted from tutorial.useful by philip
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-105097@lists.php.net to get a copy of this message
Note Submitter: ceniun_ at Hotmail dot com ---- 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.

« previous php.notes (#105097) next »