Board index   FAQ   Search  
Register  Login
Board index PHP PHP General

need some help

General discussions related to php

Moderators: macek, egami, gesf

Postby bezmond » Tue Jul 01, 2003 1:33 pm


I have a short domain name that I would like to use for all of my linking.

Let's say the domain is and I want to be able to access my sql database pull up the 'link2' link, which let's say is and then automatically redirect me to that url.

Does anybody know on how I can accomplish this?


If you are specifically using a folder, e.g., then you can:
Code: Select all
//Connect to your DB...
$page = $PHP_SELF;
$query = "select * from table where url='$page'";
//I've assumed that 'url' is the field name for where the redirec page is called
$result = mysql_query($query) or die(mysql_error());
while ($row = mysql_fetch_array($result)) {
$url = $row["url"];
//two options, you can use:
header("Location: $url");
//The first will completely go to that page, the second will just display it inside your website.

User avatar
Posts: 312
Joined: Sat Apr 05, 2003 4:33 am
Location: Mansfield, UK

Return to PHP General

Who is online

Users browsing this forum: No registered users and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.