PDA

View Full Version : passing behind file.php?testid="value" to variable


bahytq
05-07-2003, 05:36 PM
I want to edit a row in my database which has the testid field , so i did a list of all testid in the first page ( named edittest.php ) which contains anchors that has the format like this :http://localhost/edit.php?testid=A01 .
"A01" is a value of the testid in my database , and i have done this , the problem i want help from you all is that what do i write in the edit.php file to get the value of the tesid from the url of the edit.php file ( in the example above is "A01") and then passing the value to the variable $testid to do a query ?
I guess i have to use the $HTTP_POST_VARS but don;t know how to deal with it .
Anyone have done this please help me .

mordred
05-07-2003, 11:19 PM
You are quite near the mark, you only have to know that passing a variable per querystring like http://localhost/edit.php?testid=A01 puts this variable into the $_GET array, and not into the $HTTP_POST_VARS array.

So $_GET['testid'] should give you the desired result, as it should contaion 'A01' if the page was requested with the sample you URL you provided.