I know very little PHP and I just need some quick help on a simple script. I just want to transfer a request to another page based on the host name of the incoming request. In ASP.NET, one could use
Code: Select all
Response.Redirect("newpage.aspx");Code: Select all
Server.Transfer("newpage.aspx");Would someone be so kind as to show me how to do this in PHP? Something equivalent to this:
Code: Select all
protected void Page_Init(object sender, EventArgs e)
{
string host = Request.Url.Host;
string newpage;
if (host == "localhost")
newpage = "sub1/pg1.aspx";
else if (host == "www.myhost.com" || host == "myhost.com")
newpage = "sub2/pg1.aspx";
else if (host == "www.anotherhost.com" || host == "anotherhost.com")
newpage = "sub3/pg1.aspx";
else
newpage = "sub4/pg1.aspx";
Server.Transfer(newpage);
}-ColdCold