Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / NewStats: 3,194,116 members, 7,953,434 topics. Date: Thursday, 19 September 2024 at 04:09 PM |
Nairaland Forum / Science/Technology / Programming / Page Not Redirecting (838 Views)
Redirecting Back To Original Page After Login. (2) (3) (4)
(1) (Reply)
Page Not Redirecting by cs200200(m): 2:30pm On Sep 01, 2010 |
Hello all, working on a project now and found out when i test the site on my local system, the page redirected to the mainmenu.php when the logon on was successful, but after uploading the revserse was the case, the header() function didn't redirect to the mainmenu.php, can someone help Sample code: <?php session_start(); // Call up the configration page and the web effect function page require_once('connection/application_config1.php'); require_once("function/webeffect_function.php" $uname = mysql_prep($_POST['u']); $pass = mysql_prep($_POST['p']); $addpassword = addpassword($uname); $queryresult = checkusers($uname,$pass); //check session to hold the application //check session to hold the application $_SESSION['fullname'] = $queryresult['f_name']; $_SESSION['email'] = $queryresult['e_mail']; $_SESSION['username'] = $queryresult['u_name']; $mess_error = error_type(14); {header("location:mainmenu.php?welcome_mess=".$mess_error['mess']);} ?> |
Re: Page Not Redirecting by mj(m): 6:05pm On Sep 01, 2010 |
<?php if(isset($_POST['login'])) { $uname = mysql_prep($_POST['u']); $pass = mysql_prep($_POST['p']); $sql = "SELECT `id`,`f_name`,`mobile` FROM users WHERE `u` = '$uname' AND `p` = '$pass' "; $result = mysql_query($sql) or die (mysql_error()); $num = mysql_num_rows($result); // Match row found with more than 1 results - the user is authenticated. if ( $num > 0 ) { // this sets session and logs user in session_start(); // this sets variables in the session $_SESSION['email']= $e_mail; $_SESSION['username'] = $u_name; $_SESSION['fullname'] = $queryresult['f_name']; header("Location: mainmenu.php" } else { $msg = urlencode("Please try again with correct user email and password. " header("Location: index.php?msg=$msg" } } ?> |
Re: Page Not Redirecting by bhsadmin: 10:22pm On Sep 04, 2010 |
Good Job MJ |
(1) (Reply)
Video Tutorials From Lynda.com / I Need An Ebook On J2me And Midp Development / Video Tutorial
(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. 11 |