aashcool198 Posted May 25, 2009 Share Posted May 25, 2009 This is my code. this will generate some links and whenever you click on a link than you are directed to some other page with the session variable. can i send a different session variable when i click on different link? actually i want to pass different parameters of array1[] on different clicks. <?php $conn = mysql_connect('localhost', 'root', '') or die(mysql_error()); mysql_select_db('Sumeru Skills', $conn); session_start(); $result = mysql_query("SELECT * FROM skills1 where parent = 'm'"); while($row = mysql_fetch_array($result)) { $array[] = $row['skill']; $array1[] = $row['skill_id']; } $count = count($array); $_SESSION['skill_id'] = $array1[0]; for ($i = 0; $i < $count; $i++){ echo "<a href='edit_child.php'>$array[$i]</a></br></br>"; } ?> Link to comment https://forums.phpfreaks.com/topic/159561-solved-sending-different-variable-on-different-clicks/ Share on other sites More sharing options...
jxrd Posted May 25, 2009 Share Posted May 25, 2009 Pass it in the url like <a href="page.php?something=something">blah</a> Then use $_GET['something'] to get the variable. Link to comment https://forums.phpfreaks.com/topic/159561-solved-sending-different-variable-on-different-clicks/#findComment-841653 Share on other sites More sharing options...
aashcool198 Posted May 25, 2009 Author Share Posted May 25, 2009 hey! it works... thanxx! Link to comment https://forums.phpfreaks.com/topic/159561-solved-sending-different-variable-on-different-clicks/#findComment-841655 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.