i prefer to have one page, index.php in the site root.
when forwarding the url via the registrar you can pass a few variables.
for example:
http://domain.com/?r=dnforum.com&s=search
This method works with frames so you can keep the address bar intact.
now. inside the index.php place the following:
Quote:
|
Originally Posted by index.php - start <?php
$domain = $_REQUEST['r'];
$search = $_REQUEST['s'];
?> |
.... This gets the variables (after the "?" in the forward URL)
now you can play around with the variables...
Quote:
|
Originally Posted by CODE 2 <?php
echo $domain; //prints the domain, for example dnforum.com
echo "www." . $domain; //Prints the domain with 'www.', for example www.dnforum.com
$q = "SELECT * FROM table WHERE description LIKE %'$search'%";
$sql = mysql_query($q);
// Just the start of a query to search a database, of say, affiliates
// Im in college at the moment and dont have time to do anything else
?> |
hope this helps, it works.
i was going to write a full script on this but stopped because i have no longer got any time(I was going to add a lot more features than explained above). i started the script from another forum and lots others wanted to be able to keep the url in the address bar like ultsearch, this script allows you to do this without your own nameservers.