Jump to content


Photo

Blank screen on successful login


  • Please log in to reply
22 replies to this topic

#21 strawbshaker

strawbshaker
  • Members
  • PipPip
  • Member
  • 16 posts

Posted 30 July 2006 - 05:19 PM

REDARROW IS INDEED A PHP GURU!

A true superstar! Thanks dude. Changing the form action to loggedin.php from login.php solved the problem. I can't believe I have spent ALL DAY (from 10am to 18:16pm UK time) trying to solve this silly mistake. Thanks again. I'm not sure I would ever have thought to revisit that part of my code.

Thanks to everyone else for helping, you're all true gems!

#22 strawbshaker

strawbshaker
  • Members
  • PipPip
  • Member
  • 16 posts

Posted 30 July 2006 - 06:16 PM

Last question:

Is it possible to have the form action set to 2 pages?

For example:
<form action="login.php,loggedin.php" method="POST">

The reason I want to do this is because:
a) when it is set to login.php it updates things like the hyperlink box to display the right section of hyper link but then I get the blank screen on successful login.
b) when it is set to loggedin.php I get to the page I want to be at but it doesn't update the hyperlinks box.

Any advice?



#23 redarrow

redarrow
  • Members
  • PipPipPip
  • Advanced Member
  • 7,308 posts
  • Locationlondon

Posted 30 July 2006 - 06:26 PM

from your login result send them to a update page to update the information then send then to the home page ok.

on login_result.php add this so the user goes to update and back agin ok.

you add this on the page that the form post to ok.

if($_GET['redirect']=="user"){
header("location: update.php?cmd=update");
}


add this to the form already done ok.
<div align="center">Please Login</div>

<form action="/loggedin.php?redirect=user" method="POST">
  <table width="30%" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr> 
      <td width="19%">Username:</td>
      <td width="81%"><input name="username" type="text" id="username" value="<?=$_POST['username'];?>" /></td>
    </tr>
    <tr> 
      <td>Password:</td>
      <td><input name="password" type="password" id="password" /></td>
    </tr>
    <tr> 
      <td>&nbsp;</td>
      <td><div align="center">
          <input type="hidden" name="req" value="validate" />
          <input type="submit" name="Submit" value="Submit" />
        </div></td>
    </tr>
  </table>
</form>

fill in what needs to be filled in ok.

copy and past call it update.php

update.php


<?php session_start();

// database connection.

$db=mysql_connect("xxx","xxx","xxx");
mysql_select_db("xxxxxxxxx",$db);


// from a link if cmd == update 

if($_GET['cmd']=="update"){


$query_update="update xxx set xxx=xxx where xxx=xxx and xxx=xxx ";
$result_query=mysql_query($query_update);

header("location: index.php");

}
?>


i hope you can work on this ok good luck.
Wish i new all about php DAM i will have to learn
((EMAIL CODE THAT WORKS))
http://simpleforum.ath.cx/mail2.inc
((PAYPAL INTEGRATION THAT WORKS))
http://simpleforum.a...aypal1_info.inc




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users