GB_001 Posted December 27, 2007 Share Posted December 27, 2007 Example: while($row = mysql_fetch_array( $result )or die(mysql_error())) { $NAME=$row['Name']; $Pic=$row['Picture']; $PIC="Images/$Pic"; echo "<img src=$PIC $attr alt=\getimagesize ()example\ />"; echo "<a href='Friend.php'>$NAME/a> "; echo"<br/>"; } ?> How would I be able to isolate the name variable when clicked? Link to comment https://forums.phpfreaks.com/topic/83390-solved-how-would-i-be-able-to-tranfer-a-variable-from-a-search-loop-when-clicked/ Share on other sites More sharing options...
revraz Posted December 27, 2007 Share Posted December 27, 2007 Use a $_SESSION Link to comment https://forums.phpfreaks.com/topic/83390-solved-how-would-i-be-able-to-tranfer-a-variable-from-a-search-loop-when-clicked/#findComment-424259 Share on other sites More sharing options...
GB_001 Posted December 27, 2007 Author Share Posted December 27, 2007 Thanks for trying to help. But the problem is that I don't know how to transfer the variable when clicked into that session because there are other search results. I also don't know how to to check if an item was clicked in php. Link to comment https://forums.phpfreaks.com/topic/83390-solved-how-would-i-be-able-to-tranfer-a-variable-from-a-search-loop-when-clicked/#findComment-424261 Share on other sites More sharing options...
revraz Posted December 27, 2007 Share Posted December 27, 2007 This would be easier echo "<img src=$PIC $attr alt=\getimagesize ()example\ />"; echo "<a href='Friend.php?name=".$NAME."'>$NAME</a>"; echo"<br/>"; Then on Friend.php use $_GET['name'] Link to comment https://forums.phpfreaks.com/topic/83390-solved-how-would-i-be-able-to-tranfer-a-variable-from-a-search-loop-when-clicked/#findComment-424263 Share on other sites More sharing options...
GB_001 Posted December 27, 2007 Author Share Posted December 27, 2007 This would be easier echo "<img src=$PIC $attr alt=\getimagesize ()example\ />"; echo "<a href='Friend.php?name=".$NAME."'>$NAME</a>"; echo"<br/>"; Then on Friend.php use $_GET['name'] Thankyou so much you have been a big help. =D Link to comment https://forums.phpfreaks.com/topic/83390-solved-how-would-i-be-able-to-tranfer-a-variable-from-a-search-loop-when-clicked/#findComment-424264 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.