dynamicgfx Posted January 8, 2012 Share Posted January 8, 2012 Hi there i was wondering is anyone could help me in creating a page for each site like info.php?site=sitename I've Currently got this but its not really working... <?php include ("config.php"); $ServerName = $_GET['title']; $server = "SELECT * FROM sites WHERE title='$ServerName'"; $desc = $_GET['content']; $content = "SELECT * FROM sites WHERE content='$desc'"; $url = $_GET['link']; $link = "SELECT * FROM sites WHERE link='$url'"; if ($info== "$server") { echo "<h1>$server</h1>"; echo "<p>$content</p>"; echo "<a href='$link'>Visit Site</a> OR <a href='play.php?server=$server'>Play Now</a>"; } ?> Please relpy ASAP & Thank You in Advance... Quote Link to comment https://forums.phpfreaks.com/topic/254599-how-to-add-a-page-for-each-site/ Share on other sites More sharing options...
ManiacDan Posted January 8, 2012 Share Posted January 8, 2012 I'm afraid you're going to have to learn a lot more PHP in order to get this functional. You're not running any of these queries, for one. You're also not connecting to the database. MySQL and PHP are separate languages, you need to use PHP to build MySQL commands, then dispatch those commands to a MySQL server and process the results. Check the manual page for mysql_query for some examples. If this really is urgent, hire someone. Quote Link to comment https://forums.phpfreaks.com/topic/254599-how-to-add-a-page-for-each-site/#findComment-1305552 Share on other sites More sharing options...
dynamicgfx Posted January 9, 2012 Author Share Posted January 9, 2012 I'm afraid you're going to have to learn a lot more PHP in order to get this functional. You're not running any of these queries, for one. You're also not connecting to the database. MySQL and PHP are separate languages, you need to use PHP to build MySQL commands, then dispatch those commands to a MySQL server and process the results. Check the manual page for mysql_query for some examples. If this really is urgent, hire someone. i have a include.php which connects 2 database its so i dnt have 2 redo evry time... Quote Link to comment https://forums.phpfreaks.com/topic/254599-how-to-add-a-page-for-each-site/#findComment-1305803 Share on other sites More sharing options...
ManiacDan Posted January 9, 2012 Share Posted January 9, 2012 That's not listed in your code here, unless config.php includes include.php. Either way, run the queries. Handle any errors. Debug your logic. Where does $info come from? Quote Link to comment https://forums.phpfreaks.com/topic/254599-how-to-add-a-page-for-each-site/#findComment-1305833 Share on other sites More sharing options...
Jeffro Posted January 9, 2012 Share Posted January 9, 2012 That's not listed in your code here, unless config.php includes include.php. Either way, run the queries. Handle any errors. Debug your logic. Where does $info come from? 'include.php' should work fine in connecting to the db. Now just google "php GET" to figure out the rest. Quote Link to comment https://forums.phpfreaks.com/topic/254599-how-to-add-a-page-for-each-site/#findComment-1305900 Share on other sites More sharing options...
Jeffro Posted January 9, 2012 Share Posted January 9, 2012 That's not listed in your code here, unless config.php includes include.php. Either way, run the queries. Handle any errors. Debug your logic. Where does $info come from? 'include.php' should work fine in connecting to the db. Now just google "php GET" to figure out the rest. include 'config.php' I meant. Where did my edit button go?? Quote Link to comment https://forums.phpfreaks.com/topic/254599-how-to-add-a-page-for-each-site/#findComment-1305907 Share on other sites More sharing options...
ManiacDan Posted January 9, 2012 Share Posted January 9, 2012 You can't edit your post more than 30 seconds after you post it. It's one of the forum rules. The OP needs a lot more than just PHP GET functionality. None of his queries are even being run. Quote Link to comment https://forums.phpfreaks.com/topic/254599-how-to-add-a-page-for-each-site/#findComment-1305941 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.