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'; [EMAIL PROTECTED]
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
[EMAIL PROTECTED]
Bolsista CNPq / RHAE
SENAI-CE/CETAE
2001 Ano Internacional do Volunt�rio
-----Original Message-----
From: Michel Laine [mailto:[EMAIL PROTECTED]]
Sent: quinta-feira, 5 de julho de 2001 11:34
To: [EMAIL PROTECTED]
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
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP-WIN] RE: Is this possible? --> Correction
Carlos Andre Marques Moreira Thu, 05 Jul 2001 08:44:34 -0700
