Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,153,527 members, 7,819,896 topics. Date: Tuesday, 07 May 2024 at 05:51 AM

Page Not Redirecting - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / Page Not Redirecting (819 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"wink;
$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"wink;
}
else
{
$msg = urlencode("Please try again with correct user email and password. "wink;
header("Location: index.php?msg=$msg"wink;
}

}



?>
Re: Page Not Redirecting by bhsadmin: 10:22pm On Sep 04, 2010
Good Job MJ

(1) (Reply)

Please, Help On This Resume Builder Project / ASUU App For Android / What Will Happen To N20,000 Coding NL Contests

(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. 8
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.