Jump to content

pkmleo

Members
  • Posts

    12
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

pkmleo's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Still nothing has changed. I removed PHP 4.2.3 and Apache 1.3 and installed PHP 4.4.2 and Apache 2.2, still session is not getting passed to the next page. I changed the session.save_path in the php.ini file but its not saving the session in the folder. The old version of PHP which I was using used to save session in that folder. I even checked the folder properties its not read-only also. I dont understand why this is happenning.
  2. Sorry, I am not getting the result. Its not displaying the session variable. I am not sure. Cookies are enabled in the browser. I am using PHP 4.2.3-win32, Apache 1.3, MySQL 5.0 on Win XP Pro.
  3. Yes both the pages are in the same page. Do I need to make any changes in the php.ini file. The php.ini file is below: [Session] ; Handler used to store/retrieve data. session.save_handler = files ; Argument passed to save_handler. In the case of files, this is the path ; where data files are stored. Note: Windows users have to change this ; variable in order to use PHP's session functions. session.save_path = C:\tmp ; Whether to use cookies. session.use_cookies = 1 ; Name of the session (used as cookie name). session.name = PHPSESSID ; Initialize session on request startup. session.auto_start = 0 ; Lifetime in seconds of cookie or, if 0, until browser is restarted. session.cookie_lifetime = 0 ; The path for which the cookie is valid. session.cookie_path = / ; The domain for which the cookie is valid. session.cookie_domain = ; Handler used to serialize data. php is the standard serializer of PHP. session.serialize_handler = php ; Percentual probability that the 'garbage collection' process is started ; on every session initialization. session.gc_probability = 1 ; After this number of seconds, stored data will be seen as 'garbage' and ; cleaned up by the garbage collection process. session.gc_maxlifetime = 1440 ; Check HTTP Referer to invalidate externally stored URLs containing ids. ; HTTP_REFERER has to contain this substring for the session to be ; considered as valid. session.referer_check = ; How many bytes to read from the file. session.entropy_length = 0 ; Specified here to create the session id. session.entropy_file = ;session.entropy_length = 16 ;session.entropy_file = /dev/urandom ; Set to {nocache,private,public} to determine HTTP caching aspects. session.cache_limiter = nocache ; Document expires after n minutes. session.cache_expire = 180 ; trans sid support is disabled by default. ; Use of trans sid may risk your users security. ; Use this option with caution. ; - User may send URL contains active session ID ; to other person via. email/irc/etc. ; - URL that contains active session ID may be stored ; in publically accessible computer. ; - User may access your site with the same session ID ; always using URL stored in browser's history or bookmarks. session.use_trans_sid = 0 url_rewriter.tags = "a=href,area=href,frame=src,input=src,form=fakeentry"
  4. I did it and I get the message that The session variable did not pass from page1.php. So in this what is the problem. But the session did display the value in page1.php, but not in page2.php
  5. I checked the tmp folder and I can see many session files being written in that folder. I dont understand this session thing in PHP. I did not experience this type of problems in JSP and ASP.
  6. No its not displaying Hello World in test2.php page
  7. Still its not working. Its not printing the session.
  8. Hi, I am working on a small website. I am using PHP 4.3.4, Apache 1.2, MySQL 5.0 on Win XP Pro. The login script works properly but session is not passed on to the next page. My code looks like this: <?php session_start(); //header("Cache-control: private"); require_once($_SERVER['DOCUMENT_ROOT'].'/sports/includes/db_config.php'); $login_name = $_POST['login_name']; $password = $_POST['password']; $password = md5($password); $userIP = isset($REMOTE_HOST) ? $REMOTE_HOST : @gethostbyname($REMOTE_ADDR); $today = date("Y-m-d H:i:s"); $sql = "SELECT * FROM admin WHERE login_name='$login_name' AND password='$password'"; $query = "UPDATE admin SET last_login = '$today', ip_address = '$userIP' WHERE login_name = '$login_name'"; $result = mysql_query($sql) or die("Unable to execute $sql query: " . mysql_error()); $count = mysql_num_rows($result); if($count == 1) { //$_SESSION['login_name'] = $login_name; session_register('login_name'); $sessionId = session_id(); //print $_SESSION['login_name']; //session_write_close(); //echo $_SESSION['login_name']; header("Location: ./admin/adminhome.php?authenticateduser=$login_name?$sessionId"); //exit(); } else { header("Location: relogin.php"); } ?> I tried many options but still its not passing on the session to the next page. In the next page I am trying this: <?php session_start(); //if(isset($_SESSION['login_name'])) if(session_is_registered('login_name')) { //echo $_SESSION['login_name']; echo '$login_name'; //header("location:../index.php"); } ?> Its not printing the session. Any help with this will be appreciated.
  9. [!--quoteo(post=375741:date=May 21 2006, 06:44 AM:name=Crimpage)--][div class=\'quotetop\']QUOTE(Crimpage @ May 21 2006, 06:44 AM) [snapback]375741[/snapback][/div][div class=\'quotemain\'][!--quotec--] It can't write your session file. Check your PHP.ini file and make sure you have read / write access to the folder. All the other errors are because it has already sent the headers (means it has already output something to the screen). [/quote] What should I change in php.ini file. I am not sure what to change. What should I change in php.ini. I am not sure what changes have to be made in the php.ini file.
  10. I am working on a small website using PHP 4x, MySQL 5.0 and Apache 1.2. When I try to login I get some header problems. I am new to PHP and I am learining it. The logincheck.php code is below: <?php session_start(); header("Cache-control: private"); require_once($_SERVER['DOCUMENT_ROOT'].'/sports/includes/db_config.php'); $login_name = $_POST['login_name']; $password = $_POST['password']; $password = md5($password); $userIP = isset($REMOTE_HOST) ? $REMOTE_HOST : @gethostbyname($REMOTE_ADDR); $today = date("Y-m-d h:m:s"); $sql = "SELECT * FROM admin WHERE login_name='$login_name' AND password='$password'"; $query = "UPDATE admin SET last_login = '$today', ip_address = '$userIP' WHERE login_name = '$login_name'"; $result = mysql_query($sql) or die("Unable to execute $sql query: " . mysql_error()); $count = mysql_num_rows($result); if($count == 1) { @mysql_query($query) or die("Unable to execute $query query: " . mysql_error()); $_SESSION['login_name'] = $login_name; header("Location: ./admin/adminhome.php"); } else { header("Location: relogin.php"); } ?> I get this error in the browser: Warning: open(/tmp\sess_612acdf0193058442bb485e14b7d713b, O_RDWR) failed: No such file or directory (2) in c:\apache group\apache\htdocs\sports\logincheck.php on line 2 Warning: Cannot add header information - headers already sent by (output started at c:\apache group\apache\htdocs\sports\logincheck.php:2) in c:\apache group\apache\htdocs\sports\logincheck.php on line 3 Warning: Cannot add header information - headers already sent by (output started at c:\apache group\apache\htdocs\sports\logincheck.php:2) in c:\apache group\apache\htdocs\sports\logincheck.php on line 19 Warning: open(/tmp\sess_612acdf0193058442bb485e14b7d713b, O_RDWR) failed: No such file or directory (2) in Unknown on line 0 Warning: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/tmp) in Unknown on line 0
  11. Thanks for the reply. The code I am using is: <?php $db = mysql_connect("localhost","root","root"); mysql_select_db("sitename",$db); $result = mysql_query("SELECT * FROM creative",$db); printf("Cat ID: %s<br>\n", mysql_result($result,0,"cat_id")); printf("Cat Name: %s<br>\n", mysql_result($result,0,"cat_name")); printf("Job Ref: %s<br>\n", mysql_result($result,0,"job_ref")); ?> I checked the database its working and I can log into it and I am able to connect to this database using Java. The port is default which is 3306.
  12. Hi, I am relatively new to PHP. I installed PHP 4.2.3 with Apache 1.3 and MySQL 5 on Windows XP Pro. When I try to run a simple program that connects to the database and fetch records I get this errors: Warning: Client does not support authentication protocol requested by server; consider upgrading MySQL client in d:\apache group\apache\htdocs\test\first.php on line 4 Warning: MySQL Connection Failed: Client does not support authentication protocol requested by server; consider upgrading MySQL client in d:\apache group\apache\htdocs\test\first.php on line 4 I dont understand what this means. Should I upgrade PHP. In that case the web hosting company does not support PHP 5. Is there any way to solve this problem. I am using MySQL for Java programs and it works fine. Cheers, pkmleo
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.