Hi! everybody.
My problem is that the value of the SESSION_VAR in previous page will lost if I call header function. I test it localhost is ok, but cannot work in my web server.
Is it something regarding the settings? Is there any alternatives? Is it safe for me to pass through URL? How to do it?
I will be very appreciate if anyone can help me
SOURCE CODE:
1st Page:
=========
<?
session_start();
session_register("userName"
;
$HTTP_SESSION_VARS['userName'] = "Hoon Guan";
header("Location: pg2.php"
;
?>
2nd Page:
=========
<?
session_start();
?>
<HTML>
<HEAD>
<TITLE>Untitled Document</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">
<? echo $HTTP_SESSION_VARS['userName']; ?>
</BODY>
</HTML>
My problem is that the value of the SESSION_VAR in previous page will lost if I call header function. I test it localhost is ok, but cannot work in my web server.
Is it something regarding the settings? Is there any alternatives? Is it safe for me to pass through URL? How to do it?
I will be very appreciate if anyone can help me
SOURCE CODE:
1st Page:
=========
<?
session_start();
session_register("userName"
$HTTP_SESSION_VARS['userName'] = "Hoon Guan";
header("Location: pg2.php"
?>
2nd Page:
=========
<?
session_start();
?>
<HTML>
<HEAD>
<TITLE>Untitled Document</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">
<? echo $HTTP_SESSION_VARS['userName']; ?>
</BODY>
</HTML>