Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Creating A redirect page
Old 08-14-2005, 09:46 PM Creating A redirect page
amw_drizz's Avatar
Ultra Talker

Posts: 340
Name: Jon
Location: New York
Trades: 0
Okay I have gotten my Mysql php to display the links. right now i am trying to complete a redir page and so far just to have it redir is not working.
PHP Code:
<?
require_once("../config/mysql.php");
$linkid $_GET['id'];

$res "SELECT link FROM links WHERE id='$linkid'";
$subres mysql_query($res) or die(mysql_error());

while (
$row mysql_fetch_array($subres)) {
$link $row['link'];
echo 
$link;
header("Loacation:" $link ."");

}

?>
The echo $link works. just not the redir. and according to the php.net manual that is how it needs to be.

Once i can get it to redir is when i will have it add a count to the mysql db to show how many clicks the link has recived
__________________
AMW_Drizz
Dev Machine:: Apache 2.2.6 PHP 5.2.6 MySQL 5.1
amw_drizz is offline
Reply With Quote
View Public Profile Visit amw_drizz's homepage!
 
 
Register now for full access!
Old 08-14-2005, 10:48 PM
funkdaddu's Avatar
Web Design Snob

Posts: 635
Trades: 0
Loacation

should be:

Location

funkdaddu is offline
Reply With Quote
View Public Profile Visit funkdaddu's homepage!
 
Old 08-14-2005, 11:14 PM
amw_drizz's Avatar
Ultra Talker

Posts: 340
Name: Jon
Location: New York
Trades: 0
shi* my bad.
__________________
AMW_Drizz
Dev Machine:: Apache 2.2.6 PHP 5.2.6 MySQL 5.1
amw_drizz is offline
Reply With Quote
View Public Profile Visit amw_drizz's homepage!
 
Old 08-15-2005, 12:44 AM
AxE
AxE's Avatar
Skilled Talker

Posts: 62
Trades: 0
If Im thinking straight, though maybe not... 5:43AM :P, that header() will return an error. Headers arent meant to be declared before any HTML output on the page, including plain text... Should be an "Error, headers already sent" or something similar error. To fix this, add the header line BEFORE the "echo $link;" line.
AxE is offline
Reply With Quote
View Public Profile
 
Old 08-15-2005, 11:00 AM
amw_drizz's Avatar
Ultra Talker

Posts: 340
Name: Jon
Location: New York
Trades: 0
the header did work until i started adding the functions for the counter on it

Right now this draws a blank page and does nothing
PHP Code:
<?
require_once("../config/mysql.php");
$linkid $_GET['id'];

$res "SELECT * FROM links WHERE id='$linkid'";
$subres mysql_query($res) or die(mysql_error());

while (
$row mysql_fetch_array($subres)) {
$link $row['link'];
$update $row['link_clicked'];

}
$link_update $update 1;
$res0 "UPDATE links SET link_clicked='$link_update' WHERE id='$linkid'";
mysql_query($res0);
header("Location:" $link ."");
?>
__________________
AMW_Drizz
Dev Machine:: Apache 2.2.6 PHP 5.2.6 MySQL 5.1
amw_drizz is offline
Reply With Quote
View Public Profile Visit amw_drizz's homepage!
 
Old 08-15-2005, 05:10 PM
amw_drizz's Avatar
Ultra Talker

Posts: 340
Name: Jon
Location: New York
Trades: 0
never mind. i got it working.

Very very simple
__________________
AMW_Drizz
Dev Machine:: Apache 2.2.6 PHP 5.2.6 MySQL 5.1
amw_drizz is offline
Reply With Quote
View Public Profile Visit amw_drizz's homepage!
 
Reply     « Reply to Creating A redirect page
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.28701 seconds with 12 queries