Hi,
I have a php page and I reload the page when a button is clicked. I also send a few variables.
this is my code :
<a href="slideShow.php?dossier=<?PHP echo $dossier.'&categorie='.$categorie.'&photo='.$photo-1;?>"
and I get the variables with :
<?PHP
$dossier = $HTTP_GET_VARS["dossier"];
$categorie = $HTTP_GET_VARS["categorie"];
$photo = $HTTP_GET_VARS["photo"];
?>
And that doesn't work. The $dossier variable seems to be sent, but the two others don't, I have the errors :
Notice: Undefined index: categorie in c:\program files\easyphp1-8\www\slideshow\slideshow.php
Notice: Undefined index: photo in c:\program files\easyphp1-8\www\slideshow\slideshow.php
Thanks a lot
Toutouffe
link and passing variable
Moderator: General Moderators
please use the approprate tags around your code, cheers.
What does the link look like when you view source it?
to fix your warnings try
What does the link look like when you view source it?
to fix your warnings try
Code: Select all
if(isset($_GET["dossier"]) && $_GET["dossier"] != "")
// do something with the variable.Code: Select all
<a href="e;slideShow.php?dossier=<?php echo $dossier.'&categorie='.$categorie.'&photo='.($photo-1);?>"e;Code: Select all
$dossier = $_GET["dossier"];
$categorie = $_GET["categorie"];
$photo = $_GET["photo"];
print_r($_GET);When I view the source code I have :
OK, great Anjanesh, with your code it works....
thanks a lot
Toutouffe
Code: Select all
<a href="e;slideShow.php?dossier=0"e;>thanks a lot
Toutouffe