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]
|