muat Posted April 15, 2008 Share Posted April 15, 2008 Hey, I want to be able to pass a value as a variable over a link when the user clicks on a thumbnail at the end of a row in a table. obviously each row will bare a different resuly as a different value should be passed. i managed to get this to work whe i was workin using a localhost how my system has gone livee it seems to not pick up the variable value here is how i did it: <td><a href="../admin/DeleteCustomerSearchProcess.php?customercode=<? echo $row[CustomerCode];?>"><img src="../../images/delete.png" width="16" height="16" /></a></td> <td><a href="../admin/AmendCustomerSearchProcess.php?customercode=<? echo $row[CustomerCode];?>"><img src="../../images/pencil.gif" width="20" height="21" border="0" /></a></td> eg the user clicks on customer A1, and the links detects that the customercode = 1 and sends that number accross the link?? any thoughts???? Quote Link to comment https://forums.phpfreaks.com/topic/101184-passing-a-dynamic-variable-over-a-link/ Share on other sites More sharing options...
r-it Posted April 15, 2008 Share Posted April 15, 2008 firstly, check if you listed the directories the same on your server as you did on localhost, that should be a start, and try $var['value'] as opposed to $var[value] first. Quote Link to comment https://forums.phpfreaks.com/topic/101184-passing-a-dynamic-variable-over-a-link/#findComment-517579 Share on other sites More sharing options...
muat Posted April 15, 2008 Author Share Posted April 15, 2008 everything is in exactly the same directories on the server. and usint the ' ' didnt seem to make much difference!! this is 1 of those frustrating things!!! any other thoughts?? Quote Link to comment https://forums.phpfreaks.com/topic/101184-passing-a-dynamic-variable-over-a-link/#findComment-517580 Share on other sites More sharing options...
muat Posted April 15, 2008 Author Share Posted April 15, 2008 by the way, this is what i have at the other side of the link $sql = "SELECT * FROM Customer WHERE CustomerCode=$_GET[customercode]"; could somethin be wrong with that?? Quote Link to comment https://forums.phpfreaks.com/topic/101184-passing-a-dynamic-variable-over-a-link/#findComment-517587 Share on other sites More sharing options...
r-it Posted April 15, 2008 Share Posted April 15, 2008 yes something is wrong with that $sql = "SELECT * FROM Customer WHERE CustomerCode='$_GET[customercode]'"; Quote Link to comment https://forums.phpfreaks.com/topic/101184-passing-a-dynamic-variable-over-a-link/#findComment-517588 Share on other sites More sharing options...
muat Posted April 15, 2008 Author Share Posted April 15, 2008 I am just gettin a blank page now... when this wored in localhost for me, when i hovered over a thumbnail on a particualr line the link wud appear at the botton of the screen and the value would be there and it wud change if i moved the cursor eg http://www.libraseafoods.com/LogOn/admin/ViewCustomers.php?customercode = 3 now it says http://www.libraseafoods.com/LogOn/admin/ViewCustomers.php?customercode = <? echo $row['CustomerCode']; ?> Quote Link to comment https://forums.phpfreaks.com/topic/101184-passing-a-dynamic-variable-over-a-link/#findComment-517595 Share on other sites More sharing options...
muat Posted April 15, 2008 Author Share Posted April 15, 2008 Can anyone help?? this is driving me crazy??? ??? Quote Link to comment https://forums.phpfreaks.com/topic/101184-passing-a-dynamic-variable-over-a-link/#findComment-517618 Share on other sites More sharing options...
r-it Posted April 15, 2008 Share Posted April 15, 2008 you must not have spaces in your string: http://www.libraseafoods.com/LogOn/admin/ViewCustomers.php?customercode = 3 must be http://www.libraseafoods.com/LogOn/admin/ViewCustomers.php?customercode=3 Quote Link to comment https://forums.phpfreaks.com/topic/101184-passing-a-dynamic-variable-over-a-link/#findComment-517625 Share on other sites More sharing options...
muat Posted April 15, 2008 Author Share Posted April 15, 2008 yes i know, i was just goving an example of what usuallp appears at the bottom of the screen and what is appearing now. spaces aside it is a totally different look. any thought as to why the value isnt coming up and the php code is?? Quote Link to comment https://forums.phpfreaks.com/topic/101184-passing-a-dynamic-variable-over-a-link/#findComment-517627 Share on other sites More sharing options...
muat Posted April 15, 2008 Author Share Posted April 15, 2008 this is what i see in the URL which is quite strange. http://www.libraseafoods.com/LogOn/admin/DeleteCustomerSearchProcess.php?customercode=<?%20.$row[CustomerCode];?> and i wud expect / i want http://www.libraseafoods.com/LogOn/admin/DeleteCustomerSearchProcess.php?customercode=3 (for eg) Quote Link to comment https://forums.phpfreaks.com/topic/101184-passing-a-dynamic-variable-over-a-link/#findComment-517646 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.