Jump to content

Recommended Posts

I have a login screen that only partly works if i put in the password and click submit it gives me a 500 internal server error. but if i put in the wrong password it gives me the wrong password screen. i am new to this and lost as to why it doesn't work any help would be appreciated. i am running on vista with iis7 and mysql. also this is some code i found online and changed it around to fit the new php 5.3.6 so not sure what i did or if i need to change more.  Thank you in advance

 

[attachment deleted by admin]

Link to comment
https://forums.phpfreaks.com/topic/237527-login-screen-help/
Share on other sites

i would change your login success page to this

// Check if session is not registered , redirect back to main page.
// Put this code in first line of web page.
<?php
session_start();
if(!empty($myusername) && !empty($mypassword)){
$_SESSION['myusername'] =$myusername;
$_SESSION['mypassword'] =$mypassword;
}
if(!isset($_SESSION['myusername']) || !isset($_SESSION['mypassword'])){
header("location:main_login.php");
}
?>

<html>
<body>
Login Successful
</body>
</html>

Link to comment
https://forums.phpfreaks.com/topic/237527-login-screen-help/#findComment-1220575
Share on other sites

ok i got the connection fixed but still no luck. i ran debug on the code in phpdesigner and get an error on line 10.

 

  mysql_connect("$host", "$username", "$password")or die("cannot connect"); 

 

fatal error

call to undefined function mysql_connect()

 

I am lost again

thanks in advance again.

Link to comment
https://forums.phpfreaks.com/topic/237527-login-screen-help/#findComment-1220651
Share on other sites

that is all correct i can connect to the database using a test script i have were it asks for host,user,db,and pword. i believe now it has to do with my ob_start that is not working i am reading on the internet now about how to turn it on in the ini file but have had no luck and am still a little confused. Thank u for all your help i am real new to this and don't want to be a pain.

Link to comment
https://forums.phpfreaks.com/topic/237527-login-screen-help/#findComment-1220666
Share on other sites

Thank you fugix for all your help the line of code u gave me was the fix. I just didn't have my php.ini set up correct once it was fixed it all worked. i had way to much running in the extensions i guess i started over with a new copy and only opened the mysql extension and it all works now with your code add in. Again thank you so much.

Link to comment
https://forums.phpfreaks.com/topic/237527-login-screen-help/#findComment-1220733
Share on other sites

Thank you fugix for all your help the line of code u gave me was the fix. I just didn't have my php.ini set up correct once it was fixed it all worked. i had way to much running in the extensions i guess i started over with a new copy and only opened the mysql extension and it all works now with your code add in. Again thank you so much.

no problem at all, glad i could help

Link to comment
https://forums.phpfreaks.com/topic/237527-login-screen-help/#findComment-1220737
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.