jcjst21 Posted January 3, 2009 Share Posted January 3, 2009 I'm creating sort of a Course Information program. When a user logs into the program. They are given a list of each class they are taking. This is given from an array file. I have stored this class information in $data. Then, each class is a link listed on the page, if the student clicks on this link, they shoudl be able to see their course information for that particular class. I want to be able to pass what that person clicked on, plus their username through a hyperlink. how would i do this? what i have is <a href="courseInfo.php?course=$data[$i]&student=$username> now see where it says $data[$i] that would be the name of the course that the array pointer is on... i need to pass that value... how would i do that? Quote Link to comment Share on other sites More sharing options...
GingerRobot Posted January 3, 2009 Share Posted January 3, 2009 That's pretty much correct. You then extract the variables on courseinfo.php from the $_GET array. Can you show us your actual code? Quote Link to comment Share on other sites More sharing options...
hobeau Posted January 3, 2009 Share Posted January 3, 2009 typically you would have the users in one table related to their courses in another table. You would have them log into the application and then they would be transferred to their course page where it would query the courses table and based on the courses the student is taking you would loop through the list and show the links: <?php while ($data = mysql_fetch_array($result)) { ?> <a href="courseInfo.php?course=<?= $data[0] ?>&student=<?= $username?>">link goes here</a> <?php } ?> The $data[0] is assuming that you will change this number to whatever the column id is that you need. Hope this helps!!! Quote Link to comment 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.