You are here: Re: weird session problem « PHP Programming Language « IT news, forums, messages
Re: weird session problem

Posted by ELINTPimp on 08/16/07 15:37

On Aug 16, 11:35 am, isyncl...@hotmail.com wrote:
> relevant code for login page
> ================================
>
> if(mysql_num_rows($result)==0)
> {
> echo "<br /><p>incorrect email or password.</p>";
> }
> else
> {
> echo "<p>you are now logged in.</p>";
> $_SESSION['login'] =$email;
> $result1 = mysql_fetch_array ($result);
> $_SESSION['type']=$result1["type"];
>
> if ($result1["type"] == "s")
> {
> $query1 = "select ID from musician where email ='$email'";
> }
> else
> {
> $query1 = "select ID from band where email ='$email'";
> }
> $result2 = mysql_query($query1) or
> die( mysql_error() );
> $result3 = mysql_fetch_array ($result2);
>
> $_SESSION['ID']=$result3["ID"];
> }
> }
> echo "<p>redirecting to homepage.</p>";
> ==============================
> relevant code for homepage
> ==============================
> <!--show login if session not set, if set show user email-->
> <?php
> if (isset($_SESSION['login']))
> { ?><p>
>
> <?php echo ($_SESSION['login']);?>
> <br /><a href="code/logout.php">logout</a>
> <a href="code/myProfile.php">myProfile</a><br />
> <!-- check for unread mail -->
> <?php

no session_start() at the top of the pages?

 

Navigation:

[Reply to this 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

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