Advertisement

07.18.2008 at 04:49AM PDT, ID: 23576493 | Points: 500
[x]
Attachment Details

PHP sessions question

Asked by drews1f in PHP Scripting Language, PHP and Databases

Tags: ,

Hello,

I have taken over development of a PHP/MYSQL website. The format of the index page is a table with two rows.
The top row includes signin_main_inc.php
and the second row includes page_choice_inc.php

if not logged in the login page is included and the logon info is sent to validate.php

The code of validate is as below. Why after 3-5 seconds of showing the logged in dialog does the page automatically change the default page set in the page_choice_inc.php file?

I have tried redirecting to another page but it still loads the default. Why is this?
And also how could i pass a variable to the default page? ie i want to show a popup but only once after the person has logged in.Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
<table border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td width="413"><img src="images/welcome_yellow.gif" border="0" height="44" width="431"></td><td align="center" background="images/bar.gif">&nbsp;</td><td width="13" align="right"><img src="images/top_r_yellow.gif" border="0" height="44" width="13"></td>
</tr></table><table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr bgcolor="EFEFEF"><td colspan="5"><img src="s.gif" width="1" height="5"></td></tr><tr bgcolor="EFEFEF"><td width="25%" rowspan="2" align="left"><img src="s.gif" width="8" height="1"></td>
  <td nowrap height="35" valign="middle"><div align="center">
    <table width="100%" border="0">
        <tr>
          <td width="100%"><div align="center">
            <?
	$query=("SELECT * from user where user_name='$login_user' and user_pass = '$login_pass'");
	$result=mysql_query($query);
	$num=mysql_numrows($result); 
	if ($num < 1)
	{
		echo "The details you entered are incorrect. Please contact us if you have forgotten your password.
		 [ <a href='mailto:andrew@mysolutionweb.com?subject=Forgot Password (My Office)'>Email Webmaster</a> ]";
	}else{
		session_register('users');
		session_start();
		$row = mysql_fetch_array($result);
		$users["sess_slvl"]=$row[11];
		$users["sess_userid"]=$row[0];
		$users["sess_username"]=$row[1];
		$users["sess_loggedin"]=1;
		session_start();
		
		$last_login = $fulldate2;
		
		$lastq = "UPDATE user SET user_lastlogon = '$last_login' WHERE user_id = $row[0]";
		$lastre = mysql_query($lastq);
		
		
		
		
		echo "Welcome to My Office <b><font color='#003399'>".$users['sess_username']."</font></b><br><br>You have successfully been authenticated.";
		//echo "<BR><BR>";
		//echo "slvl = ".$users["sess_slvl"];
		//echo "<BR><BR>";
		//echo "userid = ".$users["sess_userid"];
		//echo "<BR><BR>";
		//echo "username = ".$users["sess_username"];
		//echo "<BR><BR>";
		//echo "logged in = ".$users["sess_loggedin"];
 
?>
<input type="hidden" name="newlogon" value="yes" />
<?
 
	}
 
 
?>
          </div></td>
        </tr>
      </table>
  </div></td><td width="25%"><font size="-2"><br>
  </font></td></tr><tr bgcolor="EFEFEF"><td nowrap colspan="5"></td></tr></table>
 
<?
 
				$rredirector = "<meta HTTP-EQUIV=\"refresh\" content=0;url=\"index.php?page=notice&newlogon=yes\">";        		
				echo $rredirector;
 
?>
[+][-]07.18.2008 at 05:21AM PDT, ID: 22034896

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.18.2008 at 05:25AM PDT, ID: 22034940

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.18.2008 at 05:32AM PDT, ID: 22034996

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.18.2008 at 05:34AM PDT, ID: 22035009

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.18.2008 at 05:36AM PDT, ID: 22035023

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.18.2008 at 05:40AM PDT, ID: 22035053

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.18.2008 at 05:47AM PDT, ID: 22035135

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.18.2008 at 05:48AM PDT, ID: 22035155

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.18.2008 at 05:53AM PDT, ID: 22035202

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]07.18.2008 at 07:26AM PDT, ID: 22036114

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]11.16.2008 at 11:11PM PST, ID: 22973729

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 30-day free trial to view this Administrative Comment or ask the Experts your question.

 
 
Loading Advertisement...
20081112-EE-VQP-44 / EE_QW_EXPERT_20070906