HELLO !!! can please somebody help me with this??
i have a form:
<form name="statPrefs" action="<?= $_SERVER['PHP_SELF']."?id=$no" ?>" method="get">
the problem is that the $no variable disapears let me explain better the url should be....
www.mysite.com/myfile.php?id=1&city=rome&country=italy but what i get is
www.mysite.com/myfile.php?city=rome&country=italy why does this happens??
thanks in advance!!
Use PHP to print the form to the browser like :
echo "<form name='statPrefs' action='$PHP_SELF?id=$no' method='GET'>";
Poolie,
it doesnt work๐ is it because i get the $no variable fron another form with GET method??
I'm pretty sure you can't have a query string in a form's action. Do this instead:
<form name="statPrefs" action="<?= $_SERVER['PHP_SELF'] ?>" method="get"> <input type="hidden" name="id" value="<?= $no ?>">
On a second look (and a slap round my face) :o i agree that u cannot add a query string in an action="" of a form, i remeber haveing this problem myself the above code snippet is ok.. and the fact that your variable has been passed from another form shouldnt matter as the variable should have still been passed across along with it anyway...
THANKS GUYS WITH YOUR HELP I RISOLVED THE PROBLEM THANK U VERY VERY MUCH!!!๐