Jump to content

How to add a page for each site??


dynamicgfx

Recommended Posts

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... 8)

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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...

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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??  :confused:

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.