Web Hosting Talk







View Full Version : Need Help with simple script!!!


krappleby
08-23-2002, 07:39 AM
Hi all,

Can someone please help me... I KNOW NOTHING about PHP, and normally program with ASP. The problem i have, is simple, I need to create a redirect page. However the server it is for, Will not support asp, and only supports php... The details are as follows...

A person enters the address,

http://www.mydomain.com/members?ID=000565

The page reads that info and sends the user automatically to

http://www.mydomain.com/cgi-bin/view.cgi/000565/index.html

That is it...

IN ASP the script would be as follows
*****************************
<%
dim members
members = request.querystring("ID")
Responce.redirect("http://www.mydomain.com/cgi-bin/view.cgi/" & members & "/index.html")
%>
*****************************

simple... however i need it is php, can someone help me...

I look forward to your replies...

Keith

michaeln
08-23-2002, 08:14 AM
<?
$header_location = "Location: http://www.mydomain.com/cgi-bin/view.cgi/" . $ID . "/index.html";
header($header_location);
exit;
?>

krappleby
08-23-2002, 08:21 AM
Thank you very much, will try that this evening

Tom|420
08-24-2002, 12:59 PM
Make sure there are not spaces/returns before <? or after ?> so that nothing is sent before header information. If you do, you will get a message such as "Header already sent"