Re[4]: [PHP] End slash, small problem.
Hi, Saturday, January 3, 2004, 4:50:44 PM, you wrote: C You forgot to double slash the windows slash like: '\\' C I would write that same functionality as follows: C $sep = (PHP_OS == 'Windows')? '\\':'/'; C if(substr($template_path,-1) == $sep)) $template_path .= $sep; Not in single quotes I thought ..could be wrong though :) -- regards, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php stub
So it's, at the time of this writing, 2:47 AM. Keep this in mind. I was looking at my webserver configuration. I am in love with Suexec. It's a gift from god for web hosts. Not only does it secure your directories, but as a bonus it forces your users to keep their stuff secure (i.e. by not running scripts in 777 directories, et al). Wonderful stuff. So then I looked at suexec with php, which pretty much breaks embedded php scripts, and requires that most freely available scripts be modified in a now-unfamiliar and non-standard way, i.e. sticking a php shebang in the scripts. As a bonus, it's slower. So then I found suPHP, and while it looked interesting at first, as it comes with an apache module, and a suid program, I thought it was exactly what I needed. Nope, it still runs in CGI mode. I think there's a couple benefits, but I still think that if PHP had always been a CGI, it would have NEVER gained the popularity it has. So then I had a thought. What about a stub program, similar to suexec, that instead of running all the php scripts and the php CGI binary, merely handles all the file operations that php would. Ideally it would speak to the httpd via pipes or something. This would be similar to the way safe mode presently operates (as in, it would do the same permissions checks on file reads for UID and GID, except that it would, at least for file writes (and optionally, for reads), fork a quick process that handled the file operations. Also, it could possibly do more than UID/GID checks, and actually check permissions, ala suexec. Am I making no sense here? Or is this actually doable? I tend to think if it WAS feasible some other company would have done it and would be selling it now, but in simple terms, I'd love to know why it CAN'T be done. I've thought about the fact that you're still slowed down by the forking of a separate process, but I'd much rather fork only on file writes, while things like SQL-based message boards getting thousands of hits a day still run at full-speed. This would also solve the biggest bane of my existence, the fact that I can't find a half-decent way of making it so that users can't read each others' MySQL login info, usually sitting in the config.php of some script. This would solve that too. (Safe mode would solve it, but safe mode is known for breaking too much else.) Am I insane? If so, please tell me why. How much would I have to donate to the apache foundation to get this feature written if it is feasible? :) -Dan Mahoney -- There is no right and wrong, there is only fun and boring. -Fisher Stevens, Hackers Dan Mahoney Techie, Sysadmin, WebGeek Gushi on efnet/undernet IRC ICQ: 13735144 AIM: LarpGM Site: http://www.gushi.org --- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] A hint...
-Original Message- From: Jeremy Russell [mailto:[EMAIL PROTECTED] Sent: Tuesday, December 30, 2003 11:17 PM To: [EMAIL PROTECTED] Subject: [PHP] A hint... Hello list.. I was needing a small hint on how to make a sort of status page... What I have is a function that takes a few minutes to complete... It send an snmp signal out then waits a bit and then gets the status via snmp. I would like to have some sort of graphic or page for the status, e.g. Percent done, a flashing waiting or something. You could try something like http://pear.php.net/package/HTML_Progress -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Wondering If Upgrading Might Be in Order
I don't know, but maybe part of the trouble I have making canned code to learn PHP/MySQL is that I'm using older versions? I'm on a Macintosh G3 PowerBook with OS 10.2.1. PHP is version 4.3.0; MySQL, 3.23.53; and phpmyAdmin, 2.4.0. What are the latest available post-beta, stable, fully-baked versions? Is upgrading as big a project as deleting old versions and then reinstalling newer? Or are there instructs for upgrading over the old? Thank you. Stephen Tiano mail2web - Check your email from the web at http://mail2web.com/ . -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] encoding problem
Hi. I have made a script in php that calls a java program. This java program will make a connection to a PostgreSQL db and do some operations. That java program works just fine if I run it on a console, but when it is php to runing it, it gives some errors related to the charset encoding. The error that apears in error.log of Apache is the following: Java.sql.SQLException: ERROR: Could not convert UTF-8 to ISO8859-1 I think that the problem is than Apache or PHP is runing the java program with UTF-8 encoding, while it should be running with iso8859-1. Does anyone knows how to solve this problem? Thanks. Pedro Salgueiro. __ Do you Yahoo!? Find out what made the Top Yahoo! Searches of 2003 http://search.yahoo.com/top2003 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Problem with call_user_func_array and passing an array of objects
Hi, I wish to call function f($params) using call_user_func_array() and pass to f() an array of two objects as a parameter. When I call f() directly, it works as expected. Function f() recognises that 2 objects are in the array and I can access their member variables. When I call the same function via call_user_func_array(), function f() recognises only the first object. Also, the same code that I used to access the objects when f() was called directly does not work when f() is called via call_user_func_array(). I have included some sample code below to illustrate the problem. I am running PHP version 4.2.2 on Windows NT 5.0 and Apache 2.0.39. I also have the same problem when I run PHP 4.3.0 on Linux and Apache 1.3.27 Thanks in advance for your help. ? class tst { var $v1; var $v2; function tst($a, $b) { $this-v1 = $a; $this-v2 = $b; } } $tst1 = new tst(a, b); $tst2 = new tst(d, e); $arr = array($tst1, $tst2); echo(BCall function f() as regular function/BBR); f($arr); echo(BCalling function f() via call_user_func_array()/BBR); call_user_func_array(f, $arr); function f($params) { var_dump($params); echo(Count= . count($params). BR); echo(Param[0]-v1= . $params[0]-v1 . Param[0]-v2= . $params[0]-v2 . BR); echo(Param[1]-v1= . $params[1]-v1 . Param[1]-v2= . $params[1]-v2 . BR); echo(P); } ? OUTPUT Call function f() as regular function array(2) { [0]= object(tst)(2) { [v1]= string(1) a [v2]= string(1) b } [1]= object(tst)(2) { [v1]= string(1) d [v2]= string(1) e } } Count=2 Param[0]-v1=a Param[0]-v2=b Param[1]-v1=d Param[1]-v2=e Calling function f() via call_user_func_array() object(tst)(2) { [v1]= string(1) a [v2]= string(1) b } Count=1 Param[0]-v1= Param[0]-v2= Param[1]-v1= Param[1]-v2= -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Compare Array Elements
I am a novice, I am sure this is pretty simple... I have two arrays of integers, equal length. The arrays elements consists of the integers 0 through 9. The order of the numbers in the arrays should always be different. Example 1: Is ok xArray: 2 9 6 0 1 3 4 5 8 7 yArray: 3 7 1 9 0 8 6 2 4 5 Example 2: Is not ok - the element 7 is in the same position in both arrays. xArray: 2 9 6 0 7 3 4 5 8 1 yArray: 3 5 1 9 7 8 6 2 4 0 I need a snippet that will compare the value of each element in each position and call a function to create a new array if the compare evaluates to true. I assume that a foreach is the way to go, but I can't seem to find the right syntax for it. --- if foreach (xArray as $x) == (yArray as $y) { new_yArray (); } -- I know this isn't correct, but in idiot terms, it is what I want to do... a test/compare. Of course the compare should stop and call the function the moment it evaluates to true at any given position. Maybe I should be using a for loop? (again, not a clue) Thanks anyone! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] example of posting board or shoutbox
Hello Austin, Saturday, January 3, 2004, 1:29:14 AM, you wrote: A how do i make something where some1 enters text, a name, and email A address, etc. and can post it onto a textarea or something, in a format of http://www.hotscripts.com/cgi-bin/search.cgi?bool=ANDquery=shoutboxcatid=2 -- Best regards, Richardmailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Compare Array Elements
One approach: for ($i=0; $i sizeof($xArray); $i++) { if ($xArray[$i] == $yArray[$i]) { new_yArray(); break; } } Wknit [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I am a novice, I am sure this is pretty simple... I have two arrays of integers, equal length. The arrays elements consists of the integers 0 through 9. The order of the numbers in the arrays should always be different. Example 1: Is ok xArray: 2 9 6 0 1 3 4 5 8 7 yArray: 3 7 1 9 0 8 6 2 4 5 Example 2: Is not ok - the element 7 is in the same position in both arrays. xArray: 2 9 6 0 7 3 4 5 8 1 yArray: 3 5 1 9 7 8 6 2 4 0 I need a snippet that will compare the value of each element in each position and call a function to create a new array if the compare evaluates to true. I assume that a foreach is the way to go, but I can't seem to find the right syntax for it. --- if foreach (xArray as $x) == (yArray as $y) { new_yArray (); } -- I know this isn't correct, but in idiot terms, it is what I want to do... a test/compare. Of course the compare should stop and call the function the moment it evaluates to true at any given position. Maybe I should be using a for loop? (again, not a clue) Thanks anyone! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP $_SESSION Expiring in IE
Hello, I have recently launched the new Planet-Tolkien.com, one would think that writing a message board from scratch and a dynamic weather system, a simple session login would be the least of my problems right? Wrong. It would appear that for Mozilla and Opera keep a $_SESSION is not an issue and the $_SESSION is continued until the member logs out. However when members are using Internet Explorer browser (most versions it seems), they can go around the site for varied amounts of time, usually less than five minutes and then their $_SESSION will expire!!?? I cannot for the life of me figure out why a server side $_SESSION would expire on IE but not for MOZ or Opera but it is, and I need to figure out why and how can I fix this. REF. All login information is saved as such: session_save_path($path/sessions); session_start(); $_SESSION['session_memberID']=$session_memberID; $_SESSION['session_username']=$session_username; $_SESSION['session_groupID']=$membergroup; In Fellowship, Tarrant -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP $_SESSION Expiring in IE
I use sessions with IE all the time without such a problem. Are there any points in the program that redirect the user off site and back or something with that affect that IE might be handling in a wierd way? Do you have pages that detect the browser and feed alternate content based on the browser? If so do you always run the session_start before these checks? -Original Message- From: Tarrant Costelloe [mailto:[EMAIL PROTECTED] Sent: Saturday, January 03, 2004 10:27 AM To: [EMAIL PROTECTED] Subject: [PHP] PHP $_SESSION Expiring in IE Hello, I have recently launched the new Planet-Tolkien.com, one would think that writing a message board from scratch and a dynamic weather system, a simple session login would be the least of my problems right? Wrong. It would appear that for Mozilla and Opera keep a $_SESSION is not an issue and the $_SESSION is continued until the member logs out. However when members are using Internet Explorer browser (most versions it seems), they can go around the site for varied amounts of time, usually less than five minutes and then their $_SESSION will expire!!?? I cannot for the life of me figure out why a server side $_SESSION would expire on IE but not for MOZ or Opera but it is, and I need to figure out why and how can I fix this. REF. All login information is saved as such: session_save_path($path/sessions); session_start(); $_SESSION['session_memberID']=$session_memberID; $_SESSION['session_username']=$session_username; $_SESSION['session_groupID']=$membergroup; In Fellowship, Tarrant -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP $_SESSION Expiring in IE
Are there any points in the program that redirect the user off site and back or something with that affect that IE might be handling in a weird way? Nope Do you have pages that detect the browser and feed alternate content based on the browser? Nope do you always run the session_start before these checks? Yes. The only other thing I guess it could be is the .htaccess mod_rewrite maybe? It's just weird that Internet Explorer is the only browser that seemingly looses the members $_SESSION where as Mozilla is not effected whatsoever. In Fellowship, Tarrant -Original Message- From: Larry Brown [mailto:[EMAIL PROTECTED] Sent: 03 January 2004 16:34 To: Tarrant Costelloe; PHP List Subject: RE: [PHP] PHP $_SESSION Expiring in IE I use sessions with IE all the time without such a problem. Are there any points in the program that redirect the user off site and back or something with that affect that IE might be handling in a wierd way? Do you have pages that detect the browser and feed alternate content based on the browser? If so do you always run the session_start before these checks? -Original Message- From: Tarrant Costelloe [mailto:[EMAIL PROTECTED] Sent: Saturday, January 03, 2004 10:27 AM To: [EMAIL PROTECTED] Subject: [PHP] PHP $_SESSION Expiring in IE Hello, I have recently launched the new Planet-Tolkien.com, one would think that writing a message board from scratch and a dynamic weather system, a simple session login would be the least of my problems right? Wrong. It would appear that for Mozilla and Opera keep a $_SESSION is not an issue and the $_SESSION is continued until the member logs out. However when members are using Internet Explorer browser (most versions it seems), they can go around the site for varied amounts of time, usually less than five minutes and then their $_SESSION will expire!!?? I cannot for the life of me figure out why a server side $_SESSION would expire on IE but not for MOZ or Opera but it is, and I need to figure out why and how can I fix this. REF. All login information is saved as such: session_save_path($path/sessions); session_start(); $_SESSION['session_memberID']=$session_memberID; $_SESSION['session_username']=$session_username; $_SESSION['session_groupID']=$membergroup; In Fellowship, Tarrant -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Production Websites (error loggin)
Does apache have permissions to write to the file and directory? Aidan Lister wrote: If anyone has successfully got php error logging working on a production website, could you please reply with the steps taken? I'm using RH7.3, Apache1.3x, PHP4.3x My php.ini has: log_errors = On error_log = /var/log/httpd/php/error_log However the errorlog is never created. Thanks for any help. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Redirection to a named frame
How about simply: echo SCRIPT window.top.main.location= 'http://localhost/phase1/report.php''; /SCRIPT; ? Geoffrey Thompson [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I was only able to find one reference to targeting a named frame on a redirection, in the MySQL Cookbook by O'Reilly. According to the book, this should work: header('Window-target: main'); header('Location: http://localhost/phase1/report.php'); But, alas, it seems to only load up the current frame (which is not main). I also tried: header('Window-target: _top'); header('Location: http://localhost/phase1/report.php'); to see if I could get it to wipe out the frameset and get back to the full window, but it still loaded up in the current frame. Any help would be appreciated! Thanks, Geoff -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] fsockopen to conect to ssl sites
WHERE IS THE ERROR? The username and the password are the correct and the name of the variables (login and pass) also match. I tried to get data from a secure site but I always receive the next message instead of the page I request: We are connected with somesecuredomain.com HTTP/1.1 302 Found Date: Fri, 02 Jan 2004 19:21:20 GMT Server: Apache/1.3.27 (Unix) FrontPage/5.0.2.2623 PHP/4.3.2 mod_gzip/1.3.19.1a mod_accounting/1.0 mod_fastcgi/2.4.0 mod_ssl/2.8.14 OpenSSL/0.9.7b rus/PL30.17 X-Powered-By: PHP/4.3.2Set-Cookie: biz=8a204f6cf271a7a81d3de70c0b250921; path=/ Expires: Thu, 01 Jan 1970 00:00:01 GMT Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0 Pragma: no-cache Location: /?error=Auth+error%2C+wrong+login+or+password.login=myusername Connection: close Content-Type: text/html; charset=windows-1251 Last-Modified: Fri, 02 Jan 2004 19:21:20 GMT The script I used: __ ?php $host= somesecuredomain.com; $page= /account/login.php; $formdata = array (login=myusername , pass=mypassword); foreach($formdata AS $key = $val) { $poststring .= urlencode($key).=.urlencode($val).; } $poststring = substr($poststring, 0, -1); $request= POST $page HTTP/1.0\x0D\x0A; $request .= HOST: $host\x0D\x0A; $request .= Content-Type: application/x-www-form-urlencoded\x0D\x0A; $request .= User-Agent: test client\x0D\x0A; $request .= Accept: */*\x0D\x0A; $request .= Content-Length: .strlen($poststring).\x0D\x0A; $request .= Connection: close\x0D\x0A\x0D\x0A; $request .= $poststring .\x0D\x0A\x0D\x0A; $fp = fsockopen(ssl://.$host, 443, $errorno, $errordesc); if ($fp) {print We are connected with $host;} else {die (I can not connect with $host: \nError: $errorno \nDescription: $errordesc);} print br; fputs($fp, $request); while (!feof($fp)) print fgets($fp, 1024); fclose($fp); ? ___ Thank you in advance for any help. Best regards, Jorge mailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
php-general Digest 3 Jan 2004 20:25:12 -0000 Issue 2510
php-general Digest 3 Jan 2004 20:25:12 - Issue 2510 Topics (messages 173674 through 173690): Strange counter behavior 173674 by: Cesar Aracena Re: End slash, small problem. 173675 by: Chris 173676 by: Tom Rogers php stub 173677 by: Dan Mahoney Re: A hint... 173678 by: Burhan Khalid Wondering If Upgrading Might Be in Order 173679 by: stiano.optonline.net encoding problem 173680 by: Pedro Salgueiro Problem with call_user_func_array and passing an array of objects 173681 by: Jon Goodwin Compare Array Elements 173682 by: wknit 173684 by: Geoffrey Thompson Re: example of posting board or shoutbox 173683 by: Richard Davey PHP $_SESSION Expiring in IE 173685 by: Tarrant Costelloe 173686 by: Larry Brown 173687 by: Tarrant Costelloe Re: Production Websites (error loggin) 173688 by: Marek Kilimajer Re: Redirection to a named frame 173689 by: Martin Helie fsockopen to conect to ssl sites 173690 by: Jorge Castaneda Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: [EMAIL PROTECTED] -- ---BeginMessage--- Hi all, I know most of you doesn't have the time() for this kind of things, but I have a problem with this beautifull counter script I found on hotscripts. I read it over and over again but I can't find where the problem is. As the code is way too long to write (several .php pages) I uploaded it to http://www.icaam.com.ar/files/ep-dev-counter-3.41.zip. if anyone would be so kind to download it and take a look at it... you may even find it usefull. The problem is that the last counter showed displays a number one (1) after it, so my total visitors show 11, 21, 31, 41... instead of just 1, 2, 3, 4... This one's has no rush... Thanks in advanced. Cesar Aracena ---End Message--- ---BeginMessage--- You forgot to double slash the windows slash like: '\\' I would write that same functionality as follows: $sep = (PHP_OS == 'Windows')? '\\':'/'; if(substr($template_path,-1) == $sep)) $template_path .= $sep; -Original Message- From: Tom Rogers [mailto:[EMAIL PROTECTED] Sent: Friday, January 02, 2004 7:24 PM To: Ryan A Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re[2]: [PHP] End slash, small problem. Hi, Saturday, January 3, 2004, 11:23:00 AM, you wrote: RA Hi, RA Thanks for replying. RA Basically after that path I am adding a file ryanFile.php so I need that RA ending slash to always be in the path RA My question was exactly that...how do I grab the last character? RA Thanks, RA -Ryan I do it like this: $sep = (PHP_OS == 'Windows')? '\':'/'; $template_path .= (substr($template_path,-1) == $sep)? '':$sep; -- regards, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php ---End Message--- ---BeginMessage--- Hi, Saturday, January 3, 2004, 4:50:44 PM, you wrote: C You forgot to double slash the windows slash like: '\\' C I would write that same functionality as follows: C $sep = (PHP_OS == 'Windows')? '\\':'/'; C if(substr($template_path,-1) == $sep)) $template_path .= $sep; Not in single quotes I thought ..could be wrong though :) -- regards, Tom ---End Message--- ---BeginMessage--- So it's, at the time of this writing, 2:47 AM. Keep this in mind. I was looking at my webserver configuration. I am in love with Suexec. It's a gift from god for web hosts. Not only does it secure your directories, but as a bonus it forces your users to keep their stuff secure (i.e. by not running scripts in 777 directories, et al). Wonderful stuff. So then I looked at suexec with php, which pretty much breaks embedded php scripts, and requires that most freely available scripts be modified in a now-unfamiliar and non-standard way, i.e. sticking a php shebang in the scripts. As a bonus, it's slower. So then I found suPHP, and while it looked interesting at first, as it comes with an apache module, and a suid program, I thought it was exactly what I needed. Nope, it still runs in CGI mode. I think there's a couple benefits, but I still think that if PHP had always been a CGI, it would have NEVER gained the popularity it has. So then I had a thought. What about a stub program, similar to suexec, that instead of running all the php scripts and the php CGI binary, merely handles all the file operations that php would. Ideally it would speak to the httpd via pipes or something. This would be similar to the way safe mode presently operates (as in, it would do the same permissions checks on file reads for UID and GID, except that it would, at least for file writes (and optionally, for reads), fork a quick process that handled the file operations. Also, it could possibly do more than UID/GID checks, and
Re: [PHP] PHP $_SESSION Expiring in IE
Have you tried the header(Cache-control: private) workaround for IE6? I seem to remember reading something about that on one of the web dev sites (devshed probably). Use that immediately after session_start() and see if it makes a difference. Kirk Tarrant Costelloe [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Are there any points in the program that redirect the user off site and back or something with that affect that IE might be handling in a weird way? Nope Do you have pages that detect the browser and feed alternate content based on the browser? Nope do you always run the session_start before these checks? Yes. The only other thing I guess it could be is the .htaccess mod_rewrite maybe? It's just weird that Internet Explorer is the only browser that seemingly looses the members $_SESSION where as Mozilla is not effected whatsoever. In Fellowship, Tarrant -Original Message- From: Larry Brown [mailto:[EMAIL PROTECTED] Sent: 03 January 2004 16:34 To: Tarrant Costelloe; PHP List Subject: RE: [PHP] PHP $_SESSION Expiring in IE I use sessions with IE all the time without such a problem. Are there any points in the program that redirect the user off site and back or something with that affect that IE might be handling in a wierd way? Do you have pages that detect the browser and feed alternate content based on the browser? If so do you always run the session_start before these checks? -Original Message- From: Tarrant Costelloe [mailto:[EMAIL PROTECTED] Sent: Saturday, January 03, 2004 10:27 AM To: [EMAIL PROTECTED] Subject: [PHP] PHP $_SESSION Expiring in IE Hello, I have recently launched the new Planet-Tolkien.com, one would think that writing a message board from scratch and a dynamic weather system, a simple session login would be the least of my problems right? Wrong. It would appear that for Mozilla and Opera keep a $_SESSION is not an issue and the $_SESSION is continued until the member logs out. However when members are using Internet Explorer browser (most versions it seems), they can go around the site for varied amounts of time, usually less than five minutes and then their $_SESSION will expire!!?? I cannot for the life of me figure out why a server side $_SESSION would expire on IE but not for MOZ or Opera but it is, and I need to figure out why and how can I fix this. REF. All login information is saved as such: session_save_path($path/sessions); session_start(); $_SESSION['session_memberID']=$session_memberID; $_SESSION['session_username']=$session_username; $_SESSION['session_groupID']=$membergroup; In Fellowship, Tarrant -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP $_SESSION Expiring in IE
Doesn't seem to have solved the problem... My session include file at the top of all documents looks like: session_save_path($some_path/sessions); ini_set('session.use_cookies', 1); ini_set('session.gc_probability', 1); ini_set('session.gc_maxlifetime', 60 * 60); ini_set('session.auto_start', '1'); session_start(); header(Cache-control: private); Here is a link to my PHP configuration: http://www.planet-tolkien.com/test.php In Fellowship, Tarrant -Original Message- From: Kirk Babb [mailto:[EMAIL PROTECTED] Sent: 03 January 2004 21:13 To: [EMAIL PROTECTED] Subject: Re: [PHP] PHP $_SESSION Expiring in IE Have you tried the header(Cache-control: private) workaround for IE6? I seem to remember reading something about that on one of the web dev sites (devshed probably). Use that immediately after session_start() and see if it makes a difference. Kirk Tarrant Costelloe [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Are there any points in the program that redirect the user off site and back or something with that affect that IE might be handling in a weird way? Nope Do you have pages that detect the browser and feed alternate content based on the browser? Nope do you always run the session_start before these checks? Yes. The only other thing I guess it could be is the .htaccess mod_rewrite maybe? It's just weird that Internet Explorer is the only browser that seemingly looses the members $_SESSION where as Mozilla is not effected whatsoever. In Fellowship, Tarrant -Original Message- From: Larry Brown [mailto:[EMAIL PROTECTED] Sent: 03 January 2004 16:34 To: Tarrant Costelloe; PHP List Subject: RE: [PHP] PHP $_SESSION Expiring in IE I use sessions with IE all the time without such a problem. Are there any points in the program that redirect the user off site and back or something with that affect that IE might be handling in a wierd way? Do you have pages that detect the browser and feed alternate content based on the browser? If so do you always run the session_start before these checks? -Original Message- From: Tarrant Costelloe [mailto:[EMAIL PROTECTED] Sent: Saturday, January 03, 2004 10:27 AM To: [EMAIL PROTECTED] Subject: [PHP] PHP $_SESSION Expiring in IE Hello, I have recently launched the new Planet-Tolkien.com, one would think that writing a message board from scratch and a dynamic weather system, a simple session login would be the least of my problems right? Wrong. It would appear that for Mozilla and Opera keep a $_SESSION is not an issue and the $_SESSION is continued until the member logs out. However when members are using Internet Explorer browser (most versions it seems), they can go around the site for varied amounts of time, usually less than five minutes and then their $_SESSION will expire!!?? I cannot for the life of me figure out why a server side $_SESSION would expire on IE but not for MOZ or Opera but it is, and I need to figure out why and how can I fix this. REF. All login information is saved as such: session_save_path($path/sessions); session_start(); $_SESSION['session_memberID']=$session_memberID; $_SESSION['session_username']=$session_username; $_SESSION['session_groupID']=$membergroup; In Fellowship, Tarrant -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] How to do this? 6 lines of code...Parse error
Hi, am a bit confused as to how you do this...first let me explain the flow of input: I will be getting $product1,$product2,$product3 etc from another script...I dont know till what numberright now I am trying to catch the values till 20 with a for loop. My problem is how do I attach the $i that I am using to the $product to check if its set? Heres my code and below that you will see some of the stuff I have tried: for($i=1; $i21; $i++) { if(isset($product$i)) {echo Product.$i. is set!br;} else(!isset($product$i)) {echo Product.$i. is NOT set!br;}} exit; This is what I have tried (in the if-isset part) : $product.$i $product..$i $product.''.$i $product($i) all of the above give me a parse error. Any help appreciated. Thanks, -Ryan P.S, I didnt write the other script where I am getting the values from...I just have to work with it as they are not allowing me to touch the older script so I dont have access to it. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP $_SESSION Expiring in IE
IE and Moz have different JAVA script engines. Try turning off JAVA and see if IE maintains it's session. Tarrant Costelloe wrote: Hello, I have recently launched the new Planet-Tolkien.com, one would think that writing a message board from scratch and a dynamic weather system, a simple session login would be the least of my problems right? Wrong. It would appear that for Mozilla and Opera keep a $_SESSION is not an issue and the $_SESSION is continued until the member logs out. However when members are using Internet Explorer browser (most versions it seems), they can go around the site for varied amounts of time, usually less than five minutes and then their $_SESSION will expire!!?? I cannot for the life of me figure out why a server side $_SESSION would expire on IE but not for MOZ or Opera but it is, and I need to figure out why and how can I fix this. REF. All login information is saved as such: session_save_path($path/sessions); session_start(); $_SESSION['session_memberID']=$session_memberID; $_SESSION['session_username']=$session_username; $_SESSION['session_groupID']=$membergroup; In Fellowship, Tarrant -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Question about an array
I want to create an array with some text. Let's say the following: $sometext = array(explode( , Objective: Position as a Machine Attendant and or Operator Summary - Over 16 years experience in packaging and maintenance of various operating machinery. - 13 years experience in cutting steel and operating a steel press. - Part time experience in packaging and shipping bread for a bakery.)); I can easily return that text using: print_r($sometext); However I want loop through that text for to bold certain words in the array. In any event I've tried using the following but it only returns sometext at[0] is: [Array] which is not want I want, I want it to show me each word in the array through the loop. Any ideas what I am doing wrong? $arrayLength = count($sometext); for ($i = 0; $i $arrayLength; $i++){ echo sometext at[ . $i . ] is: [ .$sometext[$i] . ]br\n; } Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Piping email
Is it possible to pipe email directly to PHP like it's possible to do with perl? I need to do this using Exim which I'm also unfamiliar with so if anyone has done this I'd appreciate knowing how! :) Thanks Ade -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Question about an array
If you're going to build your array that way, then you need to loop through $sometext[0], not $sometext. You're creating an array in the first element of the $sometext array, so $sometext element zero is an array containing your exploded words. Instead, try: $sometext = explode( , your long string); -- Matt Grimm Web Developer The Health TV Channel, Inc. (a non - profit organization) 3820 Lake Otis Parkway Anchorage, AK 99508 907.770.6200 ext. 686 907.336.6205 (fax) E-mail: [EMAIL PROTECTED] Web: www.healthtvchannel.org Vernon [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I want to create an array with some text. Let's say the following: $sometext = array(explode( , Objective: Position as a Machine Attendant and or Operator Summary - Over 16 years experience in packaging and maintenance of various operating machinery. - 13 years experience in cutting steel and operating a steel press. - Part time experience in packaging and shipping bread for a bakery.)); I can easily return that text using: print_r($sometext); However I want loop through that text for to bold certain words in the array. In any event I've tried using the following but it only returns sometext at[0] is: [Array] which is not want I want, I want it to show me each word in the array through the loop. Any ideas what I am doing wrong? $arrayLength = count($sometext); for ($i = 0; $i $arrayLength; $i++){ echo sometext at[ . $i . ] is: [ .$sometext[$i] . ]br\n; } Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Production Websites (error loggin)
I can't belive it... I checked the file permissions on so many occasions, I even used /tmp/phperror_log just to make sure (why that doesn't work I'm not sure). However sure enough, the directory wasn't world writeable. Thanks Marek, I really appreciate your help. Marek Kilimajer [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Does apache have permissions to write to the file and directory? Aidan Lister wrote: If anyone has successfully got php error logging working on a production website, could you please reply with the steps taken? I'm using RH7.3, Apache1.3x, PHP4.3x My php.ini has: log_errors = On error_log = /var/log/httpd/php/error_log However the errorlog is never created. Thanks for any help. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: How to do this? 6 lines of code...Parse error
Firstly I'd rewrite your other script to store the data in an array. The benefits of doing so are simply demonstrated: ?php foreach ($products as $product) dosomethingto($product); ? However, if you are unable to rewrite your script: The correct syntax is: ?php ${'product' . $i} ? Ryan A [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi, am a bit confused as to how you do this...first let me explain the flow of input: I will be getting $product1,$product2,$product3 etc from another script...I dont know till what numberright now I am trying to catch the values till 20 with a for loop. My problem is how do I attach the $i that I am using to the $product to check if its set? Heres my code and below that you will see some of the stuff I have tried: for($i=1; $i21; $i++) { if(isset($product$i)) {echo Product.$i. is set!br;} else(!isset($product$i)) {echo Product.$i. is NOT set!br;}} exit; This is what I have tried (in the if-isset part) : $product.$i $product..$i $product.''.$i $product($i) all of the above give me a parse error. Any help appreciated. Thanks, -Ryan P.S, I didnt write the other script where I am getting the values from...I just have to work with it as they are not allowing me to touch the older script so I dont have access to it. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] [Newbie Guide] For the benefit of new members
=== This message is for the benefit of new subscribers and those new to PHP. Please feel free to add more points and send to the list. === 1. If you have any queries/problems about PHP try http://www.php.net/manual/en first. You can download a copy and use it offline also. Please also try http://www.php.net/manual/faq.php to get answers to frequently answered questions about PHP (added by Christophe Chisogne). 2. Try http://www.google.com next. Searching for php YOUR QUERY may fetch you relevant results within the first 10 results, if you are lucky. 3. There is a searchable archive of the mailing list discussion at http://phparch.com/mailinglists. Many of the common topics are discussed repeatedly, and you may get answer to your query from the earlier discussions. For example: One of the repeatedly discussed question in the list is Best PHP editor. Everyone has his/her favourite editor. You can get all the opinions by going through the list archives. If you want a chosen list try this link : http://phpeditors.linuxbackup.co.uk/ (contributed by Christophe Chisogne). 4. Not sure if PHP is working or you want find out what extensions are available to you? Just put the following code into a file with a .php extension and access it through your webserver: ?php phpinfo(); ? If PHP is installed you will see a page with a lot of information on it. If PHP is not installed (or not working correctly) your browser will try to download the file. (contributed by Teren and reworded by Chris W Parker) 5. If you are stuck with a script and do not understand what is wrong, instead of posting the whole script, try doing some research yourself. One useful trick is to print the variable/sql query using print or echo command and check whether you get what you expected. After diagnosing the problem, send the details of your efforts (following steps 1, 2 3) and ask for help. 6. PHP is a server side scripting language. Whatever processing PHP does takes place BEFORE the output reaches the client. Therefore, it is not possible to access the users' computer related information (OS, screen size etc) using PHP. You need to go for JavaScript and ask the question in a JavaScript list. On the other hand you can access the information that is SENT by the user's browser when a client requests a page from your server. You can find details about browser, OS etc as reported by this request. - contributed by Wouter van Vliet and reworded by Chris W Parker. 7. Provide a clear descriptive subject line. Avoid general subjects like Help!!, A Question etc. Especially avoid blank subjects. 8. When you want to start a new topic, open a new mail composer and enter the mailing list address [EMAIL PROTECTED] instead of replying to an existing thread and replacing the subject and body with your message. 9. It's always a good idea to post back to the list once you've solved your problem. People usually add [SOLVED] to the subject line of their email when posting solutions. By posting your solution you're helping the next person with the same question. [contribued by Chris W Parker] 10. Ask smart questions http://catb.org/~esr/faqs/smart-questions.html [contributed by Jay Blanchard) Hope you have a good time programming with PHP. Best regards, -- Integrated Management Tools for leather industry -- http://www.leatherlink.net Ma Siva Kumar, BSG LeatherLink (P) Ltd, Chennai - 600106 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: How to do this? 6 lines of code...Parse error
Hey, OK, got it, thanks! -Ryan On 1/4/2004 1:00:04 AM, Aidan Lister ([EMAIL PROTECTED]) wrote: Firstly I'd rewrite your other script to store the data in an array. The benefits of doing so are simply demonstrated: ?php foreach ($products as $product) dosomethingto($product); ? However, if you are unable to rewrite your script: The correct syntax is: ?php ${'product' . $i} ? Ryan A [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi, am a bit confused as to how you do this...first let me explain the flow of input: I will be getting $product1,$product2,$product3 etc from another script...I dont know till what numberright now I am trying to catch the values till 20 with a for loop. My problem is how do I attach the $i that I am using to the $product to check if its set? Heres my code and below that you will see some of the stuff I have tried: for($i=1; $i21; $i++) { if(isset($product$i)) {echo Product.$i. is set!br;} else(!isset($product$i)) {echo Product.$i. is NOT set!br;}} exit; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP $_SESSION Expiring in IE
Guess I'm being nosy here, so forgive me, but why are you settting an alternate save path and using ini_set at the start of each document? I know that has nothing to do with the problem, but I was just wondering. Are you hosting multiple sites off your server and have different session settings depending on the site? -Kirk session_save_path($some_path/sessions); ini_set('session.use_cookies', 1); ini_set('session.gc_probability', 1); ini_set('session.gc_maxlifetime', 60 * 60); ini_set('session.auto_start', '1'); session_start(); header(Cache-control: private); Here is a link to my PHP configuration: http://www.planet-tolkien.com/test.php In Fellowship, Tarrant -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] finding phpize
Hi guys, I am trying to install Turck MMCache on our server but have no idea about linux...I have gone through all the steps a fellow list user (R'twick) gave me to install this, up till $PHP_PREFIX/bin/phpize when I type that it says: no file or directory by that name so after searching on the web for the correct command I did this: find / -name phpize -print and even that came up blank My questions are: what the heck is that file and does this system HAVE to have it? Can I complile MMCache into php without it? and lastlywhat to do? Thanks, -Ryan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Server independent URL optimization
I searched the archives and Google but couldn't find a solution. I would like to know if there is a good server independent method method for optimizing URLs that contain GET queries for search engines. Server URL rewriting (i.e. mod_rewrite, etc...) is not an option unless it is compatible with ALL http servers. I would like to write a portable PHP script, not a PHP/Apache script or PHP/IIS script. Any way that is good for search engines, especially replacing ? and with / would be great. I know that most probably use Apache but I have heard tales of multi-platform ways to do this, but have never seen the solution. TIA, Shawn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php