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? Quote 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 Quote 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. Quote 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'] Quote 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 Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.