RE: Is this possible? --> Correction

From: Date: Thu, 05 Jul 2001 16:14:28 +0000
Subject: RE: Is this possible? --> Correction
Groups: php.windows 
Request: Send a blank email to php-windows+get-8128@lists.php.net to get a copy of this message
Someone show me this error on the code below Someone showmed a error, then i'll sending it again. 1: To execute php code when a A HREF link is clicked. One way to do this is: // This will check what link was clicked <?php switch ($link){ case 1: // link 1 was clicked // write your code here break; case 2: // link 2 was clicked // write your code here break; default: // First time entering the page, no link clicked // write your code here } ?> // Here are the links <a href=<?php echo $PHP_SELF."?link=1"; ?>> link 1 </a> <a href=<?php echo $PHP_SELF."?link=2"; ?>> link 2 </a> Instead of (this code has a mistake) // Here are the links <a href=<?php echo $PHP_SELF."?$link=1"; ?>> link 1 </a> <a href=<?php echo $PHP_SELF."?$link=2"; ?>> link 2 </a> -----Original Message----- From: Carlos Andre Marques Moreira Sent: quinta-feira, 5 de julho de 2001 12:03 To: 'Michel Laine'; php-windows@lists.php.net Subject: RE: Is this possible? 1: To execute php code when a A HREF link is clicked. One way to do this is: // This will check what link was clicked <?php switch ($link){ case 1: // link 1 was clicked // write your code here break; case 2: // link 2 was clicked // write your code here break; default: // First time entering the page, no link clicked // write your code here } ?> // Here are the links <a href=<?php echo $PHP_SELF."?$link=1"; ?>> link 1 </a> <a href=<?php echo $PHP_SELF."?$link=2"; ?>> link 2 </a> Carlos André Marques Moreira camoreira@sfiec.org.br Bolsista CNPq / RHAE SENAI-CE/CETAE 2001 Ano Internacional do Voluntário -----Original Message----- From: Michel Laine [mailto:michel@systemtech.se] Sent: quinta-feira, 5 de julho de 2001 11:34 To: php-windows@lists.php.net Subject: Is this possible? Using PHP 404pl1 / MySQL 3.23.35 / PWS / W98SE if anybody should need to know... The stuff is for an intranet application. 1: To execute php code when a A HREF link is clicked. I have the need to change a session variable depending on which link (of a couple) that is clicked. The link is supposed to call $PHP_SELF which then change its output depending on the value of the session variable. I know that i can solve it by letting the link call different php scripts - which update the session variable and then call back to the first page. If there is another way ( javascript maybe?), i am interested to know about it. 2: To have one undo step on a database update. Do anybody know / seen any example / tutorial on how this kind of function can be implemented? Let me know! I have read most of the stuff at Newbie network, PHPdeveloper, PHPeverywhere, Zend, Devshed, Webmonkey and PHPbuilder - but i have never come across anything like this. -- Michel Laine

« previous php.windows (#8128) next »