Webspace & Domain Names This is a discussion on, Redirect problem with PHP $_POST within the Freedom2Surf forum; Hi, I have recently purchased a domain that is setup to redirect traffic to my old freedom2surf webspace. The DNS ...

Reply
 
LinkBack Thread Tools
Old 15-11-2006, 10:00 AM   #1
Tiscali User Member
 
Join Date: Oct 2006
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Redirect problem with PHP $_POST

Hi,

I have recently purchased a domain that is setup to redirect traffic to my old freedom2surf webspace. The DNS entry looks as follows:

www.koufou.net CNAME server0019.freedom2surf.net

server0019.freedom2surf.net somehow maps to nkoufou.f2s.com (not sure how that works).

I have a PHP script on nkoufou.f2s.com that accepts POST requests and writes into a database. When I send the request to my old URL (www.nkoufou.f2s.com) everything works fine. When sent to (www.koufou.net) then $_POST has nothing in it.

I have the following debug code that record all POSTS to a log file:

Code:
$myFile = "l120.txt";
$fh = fopen($myFile, 'a');
foreach( $_POST as $key => $value){
    fwrite($fh, $key." - ".$value."\n");
}
fclose($fh);
The above code does not do anything when requests are sent to my new domain.

Any ideas what is going on?

Nick
NKoufou is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 15-11-2006, 10:58 AM   #2
Tiscali User Admin
 
aos101's Avatar
 
Join Date: Jun 2004
Location: Kent
Posts: 3,760
Thanks: 1
Thanked 6 Times in 6 Posts
You setup www.koufou.net as a website redirect to www.nkoufou.f2s.com, so when someone goes to www.koufou.net their browser gets told to go to www.nkoufou.f2s.com to get the site. So when you send a POST request to www.koufou.net, the POST request goes to the redirection server (server0019.freedom2surf.net) instead of the server with your script and website on (www.nkoufou.f2s.com) and the redirection server just tells the browser to go to www.nkoufou.f2s.com to see your site (and the POST request is no resent to www.nkoufou.f2s.com by the browser).

Basically to do POST requests to the domain you need to have proper hosting for the domain rather than just a redirect to another website. It looks like you can do GET requests to the domain as they are carried forward as part of the URL (e.g. www.koufou.net/abc/?foo=bar does redirect to www.nkoufou.f2s.com/abc/?foo=bar).

Edit: Some Googling turns up this which might be worth a read.
__________________
Adam
aos101 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 15-11-2006, 11:13 AM   #3
Tiscali User Member
 
Join Date: Oct 2006
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Thanks for the comprehensive reply aos101. I will work around the problem with a GET/POST combination.

Cheers
Nick
NKoufou is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

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 On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Connection problem - speed keeps on dropping sungjooncho Freedom2Surf Broadband 9 13-10-2005 04:52 PM
PHP newby - fopen problem in safe mode benchataway Webspace & Domain Names 2 24-08-2005 02:43 PM
PHP Cookie problem DavidDrury Webspace & Domain Names 9 13-07-2005 07:30 AM
PHP sessions problem Tom_H Webspace & Domain Names 5 05-11-2004 11:12 AM
php amend text file problem coptang Webspace & Domain Names 5 25-04-2004 10:21 PM


All times are GMT. The time now is 09:28 PM.