tomfmason Posted July 5, 2006 Share Posted July 5, 2006 As I have said in previous posts. I am creating a membership system and am wanting to hide the processing file. Say a user logs in. The login form posts to process.php?action=login. The problem with this is with the way that I have the errors handled here is an example. [code]if(!$_SESSION['username']){ if($error){ echo $error; include("index.php"); }else{ echo "You are logged in."; include("../account.php"); } }else{ echo "<html><head><title>Welcomce Back</title></head>Welcome back ". $_SESSION['username'] .".<a href=index.php>Click here</a> to proceed."; }[/code]I thought, for a brief moment, that a javascript redirect would be best. After some research I know now that is retarded..lolI want to hide the process.php from the end user. If there is an error the login.php is included with the echoed error and the user sees the process.php in there browser. I would rather redirect them back to the login.php file and use an if statement to print what ever error there may be. Also, I want to do the same thing with a sucessful login. I want to redirect the user to account.phpAt first, I thought using some if statements with header() would be best. This will work fine for the error handling. Here is a brief example[code] if ($error=='username') { header('Location: http://www.owpt.biz/home/login.php?showerror=username');} else ($error=='password') { header('Location: http://www.owpt.biz/home.login.php?showerror=password');} [/code] [b]Note[/b] untested.However, after further research it would make it difficult for me to pass session variables this way for a sucessful login. This is what the manual had to say about this issue[code]Note: Session ID is not passed with Location header even if session.use_trans_sid is enabled. It must by passed manually using SID constant.[/code]Now I am looking for a better way of acheiveing this. Any suggestions would be great. Quote Link to comment https://forums.phpfreaks.com/topic/13721-hiding-a-backend-processing-file/ Share on other sites More sharing options...
heckenschutze Posted July 5, 2006 Share Posted July 5, 2006 whats wrong with posting the SID constant then ? Quote Link to comment https://forums.phpfreaks.com/topic/13721-hiding-a-backend-processing-file/#findComment-53265 Share on other sites More sharing options...
tomfmason Posted July 5, 2006 Author Share Posted July 5, 2006 I know nothing about SID constant and the only mention mention that I saw in the manual was the one that I referred to in the post. Could you possibley point me to where I can read more on this. Quote Link to comment https://forums.phpfreaks.com/topic/13721-hiding-a-backend-processing-file/#findComment-53266 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.