Reply to Re: Newbie question = how to send variable form one page to the other

Your name:

Reply:


Posted by kenoli on 06/28/07 14:33

On Jun 26, 8:36 am, GD <G...@cox.com> wrote:
> Newbie question = how to send variable form one page to the other
>
> i have a page with a very simple login. i want to be able to use the
> username variable to great the user by username when he reaches the
> page where he is redirected to. and at the same time get the ID field
> from my table which is and INT and PRIMARY_KEY.
>
> i've tried using a regular vairable and calling it back from the
> second page, but the second page doesn't read the first page's
> variable.
>
> btw, i'm using the login server behaviour that comes with dramweaver
> cs3 that adds the following code:
>
> $LoginRS__query=sprintf("SELECT username, password FROM information
> WHERE username=%s AND password=%s",
> GetSQLValueString($loginUsername, "text"),
> GetSQLValueString($password, "text"));
>
> $LoginRS = mysql_query($LoginRS__query, $WebParashaDB) or
> die(mysql_error());
> $loginFoundUser = mysql_num_rows($LoginRS);
> if ($loginFoundUser) {
> $loginStrGroup = "";
>
> //here is where i need to enter my text
>
> //declare two session variables and assign them
> $_SESSION['MM_Username'] = $loginUsername;
> $_SESSION['MM_UserGroup'] = $loginStrGroup;
>
> if (isset($_SESSION['PrevUrl']) && false) {
> $MM_redirectLoginSuccess = $_SESSION['PrevUrl'];
> }
> header("Location: " . $MM_redirectLoginSuccess );
> }
> else {
> header("Location: ". $MM_redirectLoginFailed );
> }}
>
> ?>
>
> any help would be appreciated.
>
> thank you very much,
> GD

$_SESSION['MM_Username']

should contain your information. Be sure to open sessions at the
beginning of the page.

$_SESSION[] variables are available on all pages.

--Kenoli

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация