dodge_93 Posted January 4, 2009 Share Posted January 4, 2009 How do I make php links with ids?? Link to comment https://forums.phpfreaks.com/topic/139446-php-id/ Share on other sites More sharing options...
Clinton Posted January 4, 2009 Share Posted January 4, 2009 <a href="showad.php?id=<?php echo $id; ?>">Link Here!</a> Assuming you're querying your db, selecting the row, extracting the row, and just echoing the id to be retrieved by $_GET on the next page. Link to comment https://forums.phpfreaks.com/topic/139446-php-id/#findComment-729445 Share on other sites More sharing options...
jonsjava Posted January 4, 2009 Share Posted January 4, 2009 you mean something like index.php?post=42 ? you have your sql grab it with something like: <?php if (isset($_GET['post'] && is_numeric($_GET['post']){ $id = $_GET['post']; $sql = "SELECT * FROM `your_table` WHERE `id`='$id' LIMIT 1;"; } and then run the query as you normally would. *EDIT just noticed what the previous poster said. between our 2 posts, you have the basics of how to put the whole thing together. Link to comment https://forums.phpfreaks.com/topic/139446-php-id/#findComment-729447 Share on other sites More sharing options...
dodge_93 Posted January 4, 2009 Author Share Posted January 4, 2009 Like if I'm adding categories... category.php?id=12 <-- something similar?? Link to comment https://forums.phpfreaks.com/topic/139446-php-id/#findComment-729450 Share on other sites More sharing options...
Clinton Posted January 4, 2009 Share Posted January 4, 2009 If you know exactly what category then yes, that's correct. Link to comment https://forums.phpfreaks.com/topic/139446-php-id/#findComment-729456 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.