Forum Moderators: coopster
- Receive a URL parameter (a username) from another site
- Create a session variable and make it equal to the URL parameter
- write the session variable to the screen
I know this is must be extremely easy, but I do not understand PHP at all. Thanks in advance for your help!
Welcome to WebmasterWorld and welcome to PHP!
Funny I just bookmarked this sity yesterday that compares PHP, ASP and JScript [phplens.com]. It's a nice little reference for these kind of things.
Otherwise check out the PHP manual [php.net] and the Library [webmasterworld.com].
Tim
/*first check if a request has been made, get its value, run it through mysql_real_escape_string() for added security if you may also need it in queries etc, assign it to a var and create a session variable*/
<? if(!empty($_GET['name'])){
$external_username = mysql_real_escape_string($_GET['name']);
$_SESSION['external_username'] = $external_username;
echo $_SESSION['external_username'];
}