Re: [PHP] PHP Sessions Not Saving
At around Tue, Feb 04, 2003 at 02:06:35PM +0800, Jason Wong constructed the following notation: Recompile, why? How about a link? ln -s /sbin/sendmail /usr/sbin/sendmail During the ./configure part of the installation, PHP checks for sendmail, but only in /sbin/sendmail. If it doesn't find it, the function mail() isn't complied in. I just get 'call to undefined function mail()' in x/y.php on z. But according to the manual configure should check both locations? I can't remember where i saw it (i think it was on a mailing list), but someone said it'll only check /sbin/sendmail, which seams to be the case. sendmail.path is set to '/usr/sbin/sendmail' in php.ini, but that doesn't has an effect. well, either way it hasn't been compiled in so a recompile will be needed. it's only a 10 minute job anyway. -- jonathan wright [EMAIL PROTECTED] | www.djnauk.co.uk -- life has no meaning unless we can enjoy what we've been given -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP Sessions Not Saving
Hiya, I'm currently trying to create a logon script for my web site, and i'm having problems with sessions. I've set up the server (httpd-2.0.44) with php (4.3.0) and switched on sessions. The sessions are only avalibale via cookies over a secure connection (i've got session.cookie_secure = true) In the script i've got: if ($db-num_rows($query) == 1) { $_SESSION['success'] = true; $_SESSION['username'] = $_POST['username'] ... } ... if (isset($_SESSION['success']) $_SESSION['success'] == true) { //output welcome message } else { //output logon page } Everything seams to be working. If you enter the details, you log on and all is fine, until you come back to the page again. It asks you to log on again. I've checked phpinfo() and $_COOKIES['session'] (session being the name for the php session) has a value ('83260f6c7261052f2ff377d104871484' the last time i checked, but nothing for $_SESSION shows up. The interesting thing comes when I look in the /tmp folder (where all the session storage files have been placed). There's a load of sess_* files, including sess_83260f6c7261052f2ff377d104871484, but all of them are 0 bytes in size - empty. The directory has 1777 permissions, and is owned by root:root. All of the files are 0600 and httpd:httpd (the user the web servers running under): -rw--- 1 httpd httpd0 Fed 3 17:26 sess_83260f6c7261052f2ff377d104871484 The settings are avaliable via http://www.djnauk.co.uk/phpinfo.php. I can't see why the server isn't writing to the files, despite the fact it's creating them no problem. there's no errors in sys.log (where php is reporting to at the moment) or in the httpd error fle. Anyone come accross the problem? -- jonathan wright [EMAIL PROTECTED] | www.djnauk.co.uk -- life has no meaning unless we can enjoy what we've been given -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Sessions Not Saving
At around Mon, Feb 03, 2003 at 10:42:47AM -0800, Chris Shiflett constructed the following notation: --- Jonathan Wright [EMAIL PROTECTED] wrote: i'm having problems with sessions. I've set up the server (httpd-2.0.44) with php (4.3.0) and switched on sessions. I would recommend not using Apache 2 with PHP right now. Stick with the latest stable 1.3.x version. Chris Aside from this, PHP's running like a dream. I haven't had a single problem (other than mail() not working, but I found that's because I use /usr/sbin/sendmail, not /sbin/sendmail, so I'll just need to recompile). Although it's running under httpd, surley the fact that PHP's not writing to the files on the drive (only 'touch'ing them so to speak) is more of a PHP problem than an Apache problem? Thanks, -- jonathan wright [EMAIL PROTECTED] | www.djnauk.co.uk -- life has no meaning unless we can enjoy what we've been given -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Sessions Not Saving
At around Mon, Feb 03, 2003 at 04:20:03PM -0600, Greg Donald constructed the following notation: On Mon, 3 Feb 2003, Jonathan Wright wrote: Aside from this, PHP's running like a dream. I haven't had a single problem (other than mail() not working, but I found that's because I use /usr/sbin/sendmail, not /sbin/sendmail, so I'll just need to recompile). Recompile, why? How about a link? ln -s /sbin/sendmail /usr/sbin/sendmail During the ./configure part of the installation, PHP checks for sendmail, but only in /sbin/sendmail. If it doesn't find it, the function mail() isn't complied in. I just get 'call to undefined function mail()' in x/y.php on z. -- jonathan wright [EMAIL PROTECTED] | www.djnauk.co.uk -- life has no meaning unless we can enjoy what we've been given -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to: If($var != '#' OR '#')
Hiya, On Wed, Nov 20, 2002 at 11:24:11AM -0600, Jami wrote: I have code that says: if($_GET['sc'] != '2' OR '8'){ do this. } but I doesn't work. What do I need to do to get it to work? I have checked operator precendence and all that and am still confused on whether I should be using '||' or 'OR' or something else... I have tried both of those, as well as 'XOR' and '^'. Help please! It won't work 'cause you're asking two different questions: 1. if $_GET['sc'] != 2, and 2. 8 Operators can only work on two operands, i.e. one either side, so you if you want to ask any more questions, like above, you have to split them each into their own question: if ($_GET['sc'] != '2' || $_GET['sc'] != 8) { It also works the same when looking for a range like '2 $x 6', it has to be two questions - '2 $x $x 6'. Hope that helps! :) -- Jonathan Wright.. // [EMAIL PROTECTED] // www.djnauk.co.uk -- // life has no meaning unless we can enjoy what we've been given -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php