| 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 ... |
![]() |
![]() |
|
LinkBack | Thread Tools | ![]() |
|
|
#1 |
|
Tiscali User Member
Join Date: Oct 2006
Posts: 5
|
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);
Any ideas what is going on? Nick |
|
|
|
|
|
#2 |
|
Tiscali User Admin
Join Date: Jun 2004
Location: Kent
Posts: 3,733
|
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 |
|
|
|
|
|
#3 |
|
Tiscali User Member
Join Date: Oct 2006
Posts: 5
|
Thanks for the comprehensive reply aos101. I will work around the problem with a GET/POST combination.
Cheers Nick |
|
|
|
![]() |
«
Previous Thread
|
Next Thread
»
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Connection problem - speed keeps on dropping | sungjooncho | Freedom2Surf Broadband | 9 | 13-10-2005 05:52 PM |
| PHP newby - fopen problem in safe mode | benchataway | Webspace | 2 | 24-08-2005 03:43 PM |
| PHP Cookie problem | DavidDrury | Webspace | 9 | 13-07-2005 08:30 AM |
| PHP sessions problem | Tom_H | Webspace | 5 | 05-11-2004 12:12 PM |
| php amend text file problem | coptang | Webspace | 5 | 25-04-2004 11:21 PM |
All times are GMT. The time now is 08:28 AM.








