darkfreaks Posted September 12, 2007 Share Posted September 12, 2007 ok so i need <td class='center'><?php echo $stats[username]; ?></td> turned into a link where you click the username and it redirects you to conduct.php Quote Link to comment https://forums.phpfreaks.com/topic/68957-help-with-turning-a-table-fielt-into-a-link/ Share on other sites More sharing options...
AndyB Posted September 12, 2007 Share Posted September 12, 2007 Normal HTML <td class='center'><a href='conduct.php'><?php echo $stats[username]; ?></a></td> Quote Link to comment https://forums.phpfreaks.com/topic/68957-help-with-turning-a-table-fielt-into-a-link/#findComment-346612 Share on other sites More sharing options...
darkfreaks Posted September 12, 2007 Author Share Posted September 12, 2007 ok now that it is linked ot conduct i want conduct.php like <?php///if not logged in //// if($_SESSION[userlevel] != 1){ ///echo }else { echo "<table><tr><td><a href='green.gif'><img src='green.gif'></a></td><td><a href='yellow.gif'><img src='yellow.gif'></a></td><td><a href='red.gif'><img src="red.gif"></a></td></tr></table>";?> <?php /// array images $image= array(green.gif,yellow.gif,red.gif); /// if clicked on green.gif code insert it into the database /// if clicked on yellow.gif insert into database /// if clicked on red.gif insert it into the database ?> Quote Link to comment https://forums.phpfreaks.com/topic/68957-help-with-turning-a-table-fielt-into-a-link/#findComment-346634 Share on other sites More sharing options...
redarrow Posted September 12, 2007 Share Posted September 12, 2007 you need to learn html we all crawl before walking. add the php code you learn earlier mate. a basic href link. <center><a href="page.php">my link</a></center> a basic link with a image <center><a href="page.php"><img src="image_color.jpg" /></a></center> Quote Link to comment https://forums.phpfreaks.com/topic/68957-help-with-turning-a-table-fielt-into-a-link/#findComment-346639 Share on other sites More sharing options...
darkfreaks Posted September 12, 2007 Author Share Posted September 12, 2007 lol sorry was getting ahead of myself for a moment. anyway im not usre how to go about making it when you click it to insert into the database under the username in fields in the database called red yellow and green which i made int 1. Quote Link to comment https://forums.phpfreaks.com/topic/68957-help-with-turning-a-table-fielt-into-a-link/#findComment-346648 Share on other sites More sharing options...
redarrow Posted September 12, 2007 Share Posted September 12, 2007 so every color of pic updates a diffrent database entry. Quote Link to comment https://forums.phpfreaks.com/topic/68957-help-with-turning-a-table-fielt-into-a-link/#findComment-346650 Share on other sites More sharing options...
darkfreaks Posted September 12, 2007 Author Share Posted September 12, 2007 Basically i want it so if you click on red.gif it inserts into red and same with the rest of the pictures. and then i want to echo it somehow on the page echo it so it is like echo "congrats $username you have seleted The Behavior color red or whatever image they selected"; after it updates into the database. Quote Link to comment https://forums.phpfreaks.com/topic/68957-help-with-turning-a-table-fielt-into-a-link/#findComment-346656 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.