ASP to PHP translation

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
jarow
Forum Commoner
Posts: 83
Joined: Tue Jan 28, 2003 2:58 am

ASP to PHP translation

Post by jarow »

Can anyone give me the PHP equivalents for the following ASP statements:

1. Session("svURL")=MM_rsUser.Fields.Item("urlredirect")

and

2. Response.Redirect "http://website/" & Session("svUrl") &""


Many thanks
[]InTeR[]
Forum Regular
Posts: 416
Joined: Thu Apr 24, 2003 6:51 am
Location: The Netherlands

Post by []InTeR[] »

1: sessionstart();
1: session_register("last_url");
1: $last_url = $urlredirect;
2: Header("Location: http://website/".$last_url);
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

With recent versions of php you might also use the superglobal $_SESSION after starting the session.
http://www.php.net/manual/en/ref.sessio ... n.examples
User avatar
twigletmac
Her Royal Site Adminness
Posts: 5371
Joined: Tue Apr 23, 2002 2:21 am
Location: Essex, UK

Post by twigletmac »

also, if you have register_globals off session_register() won't work...

Mac
Post Reply