LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices


Reply
  Search this Thread
Old 12-01-2003, 06:32 PM   #1
fengcn
LQ Newbie
 
Registered: Nov 2003
Posts: 2

Rep: Reputation: 0
RH9: PHP session problem (or Apache problem)


Dear All,

I am running RH9 with httpd-2.0.40-21.5 and PHP-4.2.2-17.2.
I have two php files.

// ===== test1.php ========
<?php
if(isset($_POST['submit']))
{ session_start();
if(!isset($_SESSION['uname']))
$_SESSION['uname']=$_POST['nameinput'];
header('Location: test2.php');
};
?>

<html>
<head></head>
<body>
<form action="test1.php" method=''post">
<input type="text" name="nameinput'>
<input type="submit" name="submit" value=" SUBMIT ">
</form>
</body>
</html>


// =====test2.php ============
<?php
session_start();
?>

<html>
<head></head>
<body>
<?php
echo 'user: ' . $_POST['nameinput'];
echo 'user: ' . $_SESSION['uname'];
$_SESSION=array();
?>
</body>
</html>

// ============================

As far as I understood from PHP manual, the $_SESSION variable I set in test1.php should be passed to test2.php. However, I don't see any output from test2.php including the one from $_POST.

Is there any bug in PHP or Apache packed with RH9?
Should I upgrade to newer version of PHP and Apache?
I tried to upgrade Apache to 2.0.48, but it shown that it found a directory with version 1.3. It suggested me to migrate from 1.3 to 2.0.
I did but in a vain.

Any help is appreciated.
Thanks,

Edward
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP Session problem!!! AskMe Programming 9 06-03-2004 07:33 AM
PHP problem after RH9 to FC2 upgrade mlg9000 Linux - Software 0 05-30-2004 04:10 AM
Apache php index.php problem neurotic Linux - Software 3 11-18-2003 06:02 PM
php session problem with windoze antken Linux - General 6 08-16-2002 08:28 AM
php session problem niehls Programming 3 06-20-2002 11:51 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat

All times are GMT -5. The time now is 01:02 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration