php - From localhost to UK2 - My login scripts no longer work -
i have spent last few months creating website locally on pc. have purchased domain , uploaded files, , database.
for reason cannot think of, users can no longer login website - , have check login credentials uk2.net , said correct.
what might going wrong?
login form:
<form action="login.php" method="post" > email<br /> <input name="email" type="text" /><br /><br /> password<br /> <input name="password" type="password" /><br /> <input name="submit" type="submit" value="log in" /> </form> login php:
require_once('/scripts/includepdo.php'); $error = ''; $form = $_post['submit']; $email = $_post['email']; $password = $_post['password']; if( isset($form) ) { if( isset($email) && isset($password) && $email !== '' && $password !== '' ) { $sql = "select * tbl_users email = :email , password = :password"; $q = $conn->prepare($sql); // default way of pdo manage errors quite same `or die()` no need $q->bindvalue(':email',$email,pdo::param_str); $q->bindvalue(':password',$password,pdo::param_str); $q->execute(); $r = $q->fetch(pdo::fetch_assoc); if(($r)!=0) { //success $answer = $r['id']; $_session['logged-in'] = true; $_session['who'] = $answer; //if login details entered , match in database, forward new page. header('location: /home/'); exit; // if information wrong or missing, provide error message. } else { echo "sorry, hasn't worked. entering information correctly?"; } } }
the answer -
there slash before scripts/includepdo.php did not need there, made impossible find file.
Comments
Post a Comment