Forum Moderators: coopster

Message Too Old, No Replies

cannot pass variables to another page

         

nikos7

12:14 pm on Aug 25, 2005 (gmt 0)

10+ Year Member


Hi everybody.

I am new to php and i have encountered a problem whose solution might be very obvious to you :[smilestopper])

I have the following line in one of the pages I made:
echo("<A HREF=$PHP_SELF?deleterecord=$recordid>" ."Delete this record</A>"."</li>"[smilestopper]);
($recordid is the unique id of a record i have in a mysql table)
When I load the page and choose to delete from one of the links the page reloads but the record is not deleted as it should be from the code I have at the beginning of the page. The whole problem, i think, is that the value is not passed when the page is reloaded, which i have seen by adding at the beginning the command
echo($deleterecord);
which prints nothing as it should if the value had passed.
I have tried not using $PHP_SELF and instead the link to another page i made but the value is still not passed.

can anybody offer some advice?

lobo235

12:49 pm on Aug 25, 2005 (gmt 0)

10+ Year Member



It sounds like register_globals is turned off on your server. Instead of using echo($deleterecord); try using echo($_GET['deleterecord']); and see if that will echo. If it does echo then use the same $_GET['deleterecord'] variable when you delete the record.

nikos7

1:46 pm on Aug 25, 2005 (gmt 0)

10+ Year Member



thanx. that's it
so simple yet i did not see it