Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / NewStats: 3,191,522 members, 7,944,529 topics. Date: Monday, 09 September 2024 at 06:04 PM |
Nairaland Forum / Science/Technology / Webmasters / Please Need A Help HEADER ERROR In Php (340 Views)
Error In Foxpro / How To Make Static Header On Coded Website / How To Set Up Custom Robot Txt And Custom Robots Header Tags On Blogger (2) (3) (4)
Please Need A Help HEADER ERROR In Php by Cordova: 4:14pm On Jul 29, 2016 |
Please, can somebody help fix this php error. I was trying to redirect to a new page after form submission but its leaving the page. I tried to print out the session id which worked. But I don't know what is wrong function activate(){ if(isset($_POST['activate'])){ if(empty($_POST['usr']) || empty($_POST['password']) || empty($_POST['code'])){ echo 'Please enter both the username, password and the activation code.'; }else{ $uname = addslashes(htmlentities($_POST['usr'])); $code = addslashes(htmlentities($_POST['code'])); $pword = $_POST['password']; $pword_hash = md5($pword); $query = "SELECT uId FROM m_account WHERE username = '$uname' AND pwrd = '$pword_hash' AND activation_code = '$code' "; $result = mysql_query($query); if(mysql_num_rows($result)== "" ){ echo 'Invalid Data Combination.'; }else{ $user_id = mysql_result($result, 0, 'uId' ) ; $_SESSION['user_id']=$user_id; if($_SESSION['user_id']){ header("Location: myDashboard.php" ) ; }else{ echo 'Is not be successful'; } } } } } Please, any help will be appreciated. Especially for the redirect. |
Re: Please Need A Help HEADER ERROR In Php by Nobody: 4:28pm On Jul 29, 2016 |
Type in ({fxck}}}}=php, it might work |
Re: Please Need A Help HEADER ERROR In Php by hollyfat(m): 6:41pm On Jul 29, 2016 |
Cordova: If you are using php5 and above, redirection won't work if you have echo or print some data before the header("location:location.php"code |
Re: Please Need A Help HEADER ERROR In Php by ps3o(m): 9:22pm On Jul 29, 2016 |
Cordova:use if (isset($_SESSION['user_id'])){ header(location: file.PHP); exit(); } make sure U call that session variable on the file which is redirected to without leaving any blank space. <?php if(! isset($_SESSION['user_id'])){ redirect to login page } ?> |
(1) (Reply)
Blogging Tips | Important Wordpress Plugins & Tools I Recommend For New Bloggers / Abeg Bloggers Attend To Ma Question / Verified Earning Adsense Account With Money Foe Sale
(Go Up)
Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health religion celebs tv-movies music-radio literature webmasters programming techmarket Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10) Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 13 |