[PHP] Re: Just Curious
outlook express 6 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Dumb session cookie question?
Hi all. I'm sorry about the dumb question, but I've just expend two hours trying to find the damn cookie and I couldn't :( I've read that when you use sessions and configure the php.ini with session.use_cookies = 1, your sessions will always send cookies to the client (if the client accept the cookies)... Is that right? I ask because I'm reading my first tutorial about sessions and it worked fine... but I can't find where IE6 (Windows XP, Apache 1.3.27) stores those cookies I used... I want to see the cookie's contents... So I was wondering if PHP really sends the cookies, but I also printed the $_SESSION and $_COOKIE arrays and it displayed the correct information... in $_COOKIE displayed PHPSESSID == , so I think there is some cookie somewhere, my question is where is it? I'm so confused right now... Thanks for any help. Sorry again. __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Just Curious
Mail/News-Client Sylpheed On Sat, 7 Dec 2002 23:31:57 -0500 [EMAIL PROTECTED] (Conbud) wrote: I was just curious, but what program or website do you all use to view and reply to the newsgroups with ? Lee -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Dumb session cookie question?
if you are allowing cookies on your browser, and the sessions are working (as they appear to be), then there WILL be a cookie somewhere on your browsing computer. However, I think you're a little confused about what you'll find... you'll just find a cookie named PHPSESSID, with a value of XX. A common misconception about sessions is that the session vars get stored on the user's computer... WRONG. ONLY the session id is stored on the user's computer (either in a cookie, or via the URL). Session vars and values are ASSOCIATED with that session id ON THE SERVER. WHERE exactly the cookie is stored on your CLIENT (viewing) hard drive will depend on the OS, Browser, and a heap of settings. WHERE exactly the session vars and values are stored on your SERVER will depend on a few PHP settings. What are you trying to achieve? To test if a cookie exists on the user's computer, you use the $_COOKIE array. To assign values to a session, you use the $_SESSION array (which associates a php session id (stored/carried by the user) with a bunch of session vars/values stored on the server). Justin on 08/12/02 10:17 PM, Douglas Douglas ([EMAIL PROTECTED]) wrote: Hi all. I'm sorry about the dumb question, but I've just expend two hours trying to find the damn cookie and I couldn't :( I've read that when you use sessions and configure the php.ini with session.use_cookies = 1, your sessions will always send cookies to the client (if the client accept the cookies)... Is that right? I ask because I'm reading my first tutorial about sessions and it worked fine... but I can't find where IE6 (Windows XP, Apache 1.3.27) stores those cookies I used... I want to see the cookie's contents... So I was wondering if PHP really sends the cookies, but I also printed the $_SESSION and $_COOKIE arrays and it displayed the correct information... in $_COOKIE displayed PHPSESSID == , so I think there is some cookie somewhere, my question is where is it? I'm so confused right now... Thanks for any help. Sorry again. __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com Justin French http://Indent.com.au Web Development Graphic Design -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Just Curious
Mozilla 1.2.1 ;-) conbud wrote: I was just curious, but what program or website do you all use to view and reply to the newsgroups with ? Lee -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Snoopy Class
(pardon the pun) Please recommend a Snoopy tutorial, =dn PS Google has not been my friend! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Domxml and problem
I have the newest foxserv on my comp. When i'm trying to open a xml document with function $doc = domxml_open_file(test.xml); It appears an error like this: Warning: warning: in C:\FoxServ\www\nTrophy_usr_auth\nowy.php on line 3 Warning: failed to load external entity menu.xml in C:\FoxServ\www\nTrophy_usr_auth\nowy.php on line 3 Fatal error: Call to a member function on a non-object in C:\FoxServ\www\nTrophy_usr_auth\nowy.php on line 4 I had downloaded libxml and installed it. domxml.dll is in c:\windows\system32 (i have win xp sp1). I don't know why this error appears. In my opinion everything is ok. Coudl someone help me, please ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Just Curious
Also using Mozilla Davy Obdam wrote: Mozilla 1.2.1 ;-) conbud wrote: I was just curious, but what program or website do you all use to view and reply to the newsgroups with ? Lee -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Dumb session cookie question?
IE traditionally puts cookies in a folder named Cookies. Do a search for 'cookies' -- see what you come up with. on 08/12/02 10:17 PM, Douglas Douglas ([EMAIL PROTECTED]) wrote: Hi all. I'm sorry about the dumb question, but I've just expend two hours trying to find the damn cookie and I couldn't :( I've read that when you use sessions and configure the php.ini with session.use_cookies = 1, your sessions will always send cookies to the client (if the client accept the cookies)... Is that right? I ask because I'm reading my first tutorial about sessions and it worked fine... but I can't find where IE6 (Windows XP, Apache 1.3.27) stores those cookies I used... I want to see the cookie's contents... So I was wondering if PHP really sends the cookies, but I also printed the $_SESSION and $_COOKIE arrays and it displayed the correct information... in $_COOKIE displayed PHPSESSID == , so I think there is some cookie somewhere, my question is where is it? I'm so confused right now... Thanks for any help. Sorry again. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] save file from outside url
On Sunday 08 December 2002 00:47, Jeremiah Breindel wrote: Thanks for responing Jason! There is other code in there for updating some database entries and producing a confirmation page, but I had them working perfectly before I added the image code below. Only when acessing the outside script and saving to file did it start doing the odd things. I didn't write the image creation script, only hard coded in some values for font and bg colors in it. I have attached that script at the bottom of this, away from everything else. Maybe a header problem from that script? Any idea what 427 is from? Thanks for all your help! The $image_url is like this - $rollover_image_url = http://www.anysite.com//pngmake.php?msg=; . $rollover . rot=0size=12font=fonts/ARIAL.TTF; Two things you need to do: 1) Plug the value of $rollover_image_url into a browser and satisfy yourself that the resulting URL does indeed return a valid image, and hence said URL is valid. 2) Plug in a known, static, valid URL (of an image -- actually it can be anything it doesn't really matter) into your code below, and satisfy yourself that the your code does work. local file on my server using the code below: $fc = fopen($image_filename, wb); $file = fopen ($image_url, rb); if (!$file) { echo pUnable to open remote file.\n; exit; }else{ while (!feof ($file)) { $line = fread ($file, 1028); fwrite($fc,$line); } } fclose($fc); fclose($file); -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* Chicago law prohibits eating in a place that is on fire. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Finding Mode
-Original Message- From: Rick Widmer At 07:12 PM 12/7/02 -0500, Stephen wrote: Another math question... How would I find the mode (number that repeats most often) of an array? Then, if there isn't a number that repeats most often, tell the user that. For each entry in the array, count the number of times a value occurs: while( list( , $Value ) = each( $MyArray )) { $NumberHits[ $Value ] ++; } Or use the built-in function: $NumberHits = array_count_values($MyArray); Cheers! Mike -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] open_basedir
When I am try toput photo to the server I get this: Warning: open_basedir restriction in effect. File is in wrong directory in /mnt/host-users/zolty/tools/addprod.php on line 117 What is this? Przemek -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] force download with header()
i was reading about php.net looking for a way to force a download of a txt file, rather than the browser displaying the file. i ran into header() that seems to be able to accomplish it... but seeing as i'm very much a newbie at php, i can't seem to make this work if the file i want to download is nfo/60/ind.txt how would i impliment this: ?php // We'll be outputting a PDF header(Content-type: application/pdf); // It will be called downloaded.pdf header(Content-Disposition: attachment; filename=downloaded.pdf); // The PDF source is in original.pdf readfile('original.pdf'); ?
Re: [PHP] force download with header()
Are you using Internet Explorer? Then it's a feature of IE--it ignores the disposition headers sent by your server because its registry tells it that PDF files must be viewed inline. There's a way around it, although it's a bit kludgy--I wrote a small article about it that you can find here (it's in PDF format, as well): http://www.phparch.com/issuedata/2002/december/sample.php Essentially, you're telling IE to download a file with the extension .pdf (not the space) so that it can't match the MIME type anymore and will follow your suggestion of downloading the file instead of displaying it inline. Hope this helps! Cheers, Marco -- php|architect - The Magazine for PHP Professionals The monthly magazine dedicated to the world of PHP programming Check us out on the web at http://www.phparch.com! ---BeginMessage--- i was reading about php.net looking for a way to force a download of a txt file, rather than the browser displaying the file. i ran into header() that seems to be able to accomplish it... but seeing as i'm very much a newbie at php, i can't seem to make this work if the file i want to download is nfo/60/ind.txt how would i impliment this: ?php // We'll be outputting a PDF header(Content-type: application/pdf); // It will be called downloaded.pdf header(Content-Disposition: attachment; filename=downloaded.pdf); // The PDF source is in original.pdf readfile('original.pdf'); ? ---End Message--- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mysql_connect problem under RedHat 8.0 ?
Hello! When trying to connect to a mysql database under my linux system, I get the following error: Warning: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /webroot/dbconnect.php on line 2 Here is a copy of the code I am using: ? $link = mysql_connect(localhos , username , password) or die(Couldn't Connect.); ? I am currently running Apache with Mysql and PHP version 4 on Redhat 8. Any suggestions? Thank you. -- --- Brian J. Celenza [EMAIL PROTECTED] ICQ: 100942424 AIM: BJCKnight -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] LogIn check within function within class :: HELP!
Im just about at wits end here Im trying to verify that a users ID and Password exist in the MySQL Database and then if it does display certain content and if it does not display login form content. ###At present here is the error I'm recieving: Warning: Missing argument 3 for verifylogin() in /home/www/websitename/admin/include/adminclass.inc on line 78 This stupid thing STILL Does NOT WORK! Here is my class FILE ? class ADMINPAGE { //class adminpage's attributes var $title = 75; var $content; var $buttons = array([ admin ] = admin_root.php, [ orders ] = orders_root.php, [ customers ] = customers_root.php, [ products ] = products_root.php, [ categories ] = categories_root.php, [ manufacturers ] = manufacturers_root.php, [ vehicles ] = vehicles_root.php); var $count; function SetTitle($newTitle) { $this-title = $newTitle; } function SetContent($newContent) { $this-content = $newContent; } function SetButtons($newbuttons) { $this-buttons = $newbuttons; } function Display($employeeid,$password,$title,$count) { session_start(); session_register(employeeid); $this - VerifyLogin($employeeid,$password); switch($count) { case 1: $this - DisplayHeader($title,$employeeid); echo centerbr; $this - DisplayMenu($this-buttons); echo /centerbr; $this - DisplayFooter(); break; default: echo This stupid thing STILL Does NOT WORK!; break; } } function DisplayHeader($title,$employeeid) { echo html\nhead\ntitle$title/title; echo link href='/aistyles.css' rel='stylesheet' type='text/css'; echo /head\nbody leftmargin='0' topmargin='0' marginwidth='0' marginheight='0' \n; echo table width='100%' border='0' cellspacing='0' cellpadding='0'; echo tr; echo td bgcolor='#FF6600' div align='left'img src='/images/designelements/logo.gif' width='348' height='35'/div/td; echo /tr; echo tr; echo td bgcolor='#00'; echo table width='100%' border='0' cellspacing='0' cellpadding='0'; echo tr; echo tdimg src='/images/designelements/spacer.gif' width='5' height='15'/span/td; echo tdspan class='admin_header'ADMINISTRATOR LOGGED IN:nbsp;nbsp;; echo $employeeid; echo /span/div; echo /td; echo /tr; echo /table; echo /td; echo /tr; echo /table; } function VerifyLogin($employeeid,$password,$count) { include('dbconnection.php'); $employeequery = Select count(*) from employees where employeeid = '$employeeid' and password='$password'; $employeeresult = mysql_query($employeequery); if(!$employeeresult) { echo 'Please Try Again Later.'; exit(); } $count = mysql_result($employeeresult,0,0); if($count0) { $count = 1; } else { $count = 0; } } function DisplayMenu($buttons) { echo table width = \500\ bgcolor=\#00\ cellpadding=\1\ cellspacing=\0\trtd; echo table width=\100%\ bgcolor=\#ff6600\ cellpadding=\1\ cellspacing=\0\trtd; echodiv align=centertable width=\100%\ bgcolor=\#ff\ cellpadding=\5\ cellspacing=\0\trtd; $width = 100/count($buttons); while(list($name,$url) = each ($buttons)) { $this -DisplayButton($width,$name,$url); } echo /td/tr/table/div; echo /td/tr/table; echo /td/tr/table; } function DisplayButton($width,$name,$url) { echo td width =\$width%\a href = \$url\span class = small$name/span/a/td; } function DisplayFooter() { ? table width=100% height=100% border=0 cellpadding=0 cellspacing=0 tr td valign=top bgcolor=#00img src=/images/spacer.gif width=1 height=300/td /tr /table /body/html ? } } ? Here is sample page usage of class file ? require (include/adminclass.inc); $test = new adminpage(); $title = This is a Nice Page; $content = Some Temporary Content; $test -SetContent($content); $test -Display($employeeid,$password,$title,$count); ? _ MSN 8 with e-mail virus protection service: 2 months FREE* http://join.msn.com/?page=features/virus -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] LogIn check within function within class :: HELP!
Hi, Monday, December 9, 2002, 2:24:47 AM, you wrote: SM Im just about at wits end here Im trying to verify that a users ID and SM Password exist in the MySQL Database and then if it does display certain SM content and if it does not display login form content. SM ###At present here is the error I'm recieving: SM Warning: Missing argument 3 for verifylogin() in SM /home/www/websitename/admin/include/adminclass.inc on line 78 SM This stupid thing STILL Does NOT WORK! SM Here is my class FILE SM ? SM class ADMINPAGE SM { SM //class adminpage's attributes SM var $title = 75; SM var $content; SM var $buttons = array([ admin ] = admin_root.php, SM [ orders ] = orders_root.php, SM [ customers ] = customers_root.php, SM [ products ] = products_root.php, SM [ categories ] = categories_root.php, SM [ manufacturers ] = manufacturers_root.php, SM [ vehicles ] = vehicles_root.php); SM var $count; SM function SetTitle($newTitle) SM { SM $this-title = $newTitle; SM } SM function SetContent($newContent) SM { SM $this-content = $newContent; SM } SM function SetButtons($newbuttons) SM { SM $this-buttons = $newbuttons; SM } SM function Display($employeeid,$password,$title,$count) SM { SM session_start(); SM session_register(employeeid); SM $this - VerifyLogin($employeeid,$password); SM switch($count) SM { SM case 1: SM $this - DisplayHeader($title,$employeeid); SM echo centerbr; SM $this - DisplayMenu($this-buttons); SM echo /centerbr; SM $this - DisplayFooter(); SM break; SM default: SM echo This stupid thing STILL Does NOT WORK!; SM break; SM } SM } SM function DisplayHeader($title,$employeeid) SM { SM echo html\nhead\ntitle$title/title; SM echo link href='/aistyles.css' rel='stylesheet' type='text/css'; SM echo /head\nbody leftmargin='0' topmargin='0' marginwidth='0' marginheight='0' \n; SM echo table width='100%' border='0' cellspacing='0' cellpadding='0'; SM echo tr; SMecho td bgcolor='#FF6600' div align='left'img SM src='/images/designelements/logo.gif' width='348' height='35'/div/td; SM echo /tr; SM echo tr; SM echo td bgcolor='#00'; SM echo table width='100%' border='0' cellspacing='0' cellpadding='0'; SM echo tr; SM echo tdimg src='/images/designelements/spacer.gif' width='5' height='15'/span/td; SM echo tdspan class='admin_header'ADMINISTRATOR LOGGED SM IN:nbsp;nbsp;; SM echo $employeeid; SM echo /span/div; SM echo /td; SM echo /tr; SM echo /table; SM echo /td; SM echo /tr; SM echo /table; SM } SM function VerifyLogin($employeeid,$password,$count) SM { SM include('dbconnection.php'); SM $employeequery = Select count(*) from employees where employeeid = SM '$employeeid' and password='$password'; SM $employeeresult = mysql_query($employeequery); SM if(!$employeeresult) SM { SM echo 'Please Try Again Later.'; SM exit(); SM } SM $count = mysql_result($employeeresult,0,0); SM if($count0) SM { SM $count = 1; SM } SM else SM { SM $count = 0; SM } SM } SM function DisplayMenu($buttons) SM { SM echo table width = \500\ bgcolor=\#00\ cellpadding=\1\ cellspacing=\0\trtd; SM echo table width=\100%\ bgcolor=\#ff6600\ cellpadding=\1\ cellspacing=\0\trtd; SM echodiv align=centertable width=\100%\ bgcolor=\#ff\ SM cellpadding=\5\ cellspacing=\0\trtd; SM $width = 100/count($buttons); SM while(list($name,$url) = each ($buttons)) SM { SM $this -DisplayButton($width,$name,$url); SM } SM echo /td/tr/table/div; SM echo /td/tr/table; SM echo /td/tr/table; SM } SM function DisplayButton($width,$name,$url) SM { SM echo td width =\$width%\a href = \$url\span class = small$name/span/a/td; SM } SM function DisplayFooter() SM { SM ? SM table width=100% height=100% border=0 cellpadding=0 cellspacing=0 SM tr SM td valign=top bgcolor=#00img src=/images/spacer.gif SM width=1 height=300/td SM /tr SM /table SM /body/html SM ? SM } SM } ? SM Here is sample page usage of class file SM ? SM require (include/adminclass.inc); SM $test = new adminpage(); SM $title = This is a Nice Page; SM $content = Some Temporary Content; $test -SetContent($content); $test -Display($employeeid,$password,$title,$count); ? SM _ SM MSN 8
php-general Digest 8 Dec 2002 16:38:31 -0000 Issue 1751
php-general Digest 8 Dec 2002 16:38:31 - Issue 1751 Topics (messages 127414 through 127436): Re: Just Curious 127414 by: Leif K-Brooks 127415 by: Justin French 127419 by: Kyle Gibson 127420 by: rolf vreijdenberger 127422 by: Thomas Seifert 127424 by: Davy Obdam 127427 by: Henrik Malmberg Question about Trim 127416 by: Dade Register 127418 by: Justin French Free Util: apxDebug 127417 by: Weston Houghton Dumb session cookie question? 127421 by: Douglas Douglas 127423 by: Justin French 127428 by: Robert Pruitt Snoopy Class 127425 by: DL Neil Domxml and problem 127426 by: Winthux Re: save file from outside url 127429 by: Jason Wong Re: Finding Mode 127430 by: Ford, Mike [LSS] open_basedir 127431 by: Przemys³aw ¯ó³czyñski PRV force download with header() 127432 by: Patrick McKinley 127433 by: Marco Tabini mysql_connect problem under RedHat 8.0 ? 127434 by: Brian J. Celenza LogIn check within function within class :: HELP! 127435 by: Sean Mayhew 127436 by: Tom Rogers 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--- I use the mailing list. conbud wrote: I was just curious, but what program or website do you all use to view and reply to the newsgroups with ? Lee -- The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law. ---End Message--- ---BeginMessage--- I use the e-mailing list, not the newsgroup... but I think there is an *experimental* web based interface to the newsgroup at http://news.php.net, and most mail readers (outlook, outlook express and netscape I know for sure) can all read news. on 08/12/02 3:31 PM, conbud ([EMAIL PROTECTED]) wrote: I was just curious, but what program or website do you all use to view and reply to the newsgroups with ? Lee Justin French http://Indent.com.au Web Development Graphic Design ---End Message--- ---BeginMessage--- I was just curious, but what program or website do you all use to view and reply to the newsgroups with ? Fun Fact # 14: Netscape 7.0 ;) -- Kyle Gibson admin(at)frozenonline.com http://www.frozenonline.com/ ---End Message--- ---BeginMessage--- outlook express 6 ---End Message--- ---BeginMessage--- Mail/News-Client Sylpheed On Sat, 7 Dec 2002 23:31:57 -0500 [EMAIL PROTECTED] (Conbud) wrote: I was just curious, but what program or website do you all use to view and reply to the newsgroups with ? Lee ---End Message--- ---BeginMessage--- Mozilla 1.2.1 ;-) conbud wrote: I was just curious, but what program or website do you all use to view and reply to the newsgroups with ? Lee ---End Message--- ---BeginMessage--- Also using Mozilla Davy Obdam wrote: Mozilla 1.2.1 ;-) conbud wrote: I was just curious, but what program or website do you all use to view and reply to the newsgroups with ? Lee ---End Message--- ---BeginMessage--- Hey... I have a question about trim. I don't know if trim() is the right funtion to use, but here is my problem. I am recieving a textarea input from a form and writing it to a data file. I need to change any line breaks or (enter) if you will into a br or something else. When it's in my text file, it screws it up. Please, someone give me an idea of how to oversome this. I can't seem to make trim() work at all. It does remove a \n if you type that in, but won't actually remove an (enter). Thanx for your help in advance. -Dade __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com ---End Message--- ---BeginMessage--- To convert \n's to br /\n's on any string, use nl2br(). To trim excess white space (\n, \r, [space] \t, etc) from both the beginning and end of a string, use trim(). Eg: ? $str = this is a string with an\nenter in the middle, and two at the end\n\n; $str = trim($str); $str = nl2br($str); echo $str; ? This should echo: --- this is a string with anbr / enter in the middle --- What do you actually want to do, and what's the problem? Justin on 08/12/02 5:28 PM, Dade Register ([EMAIL PROTECTED]) wrote: Hey... I have a question about trim. I don't know if trim() is the right funtion to use, but here is my problem. I am recieving a textarea input from a form and writing it to a data file. I need to change any line breaks or (enter) if you will into a br or something else. When it's in my text file, it screws it up. Please, someone give me an idea of how
Re: [PHP] mysql_connect problem under RedHat 8.0 ?
Hi, Monday, December 9, 2002, 2:29:35 AM, you wrote: BJC Hello! BJC When trying to connect to a mysql database under my linux system, I get the BJC following error: BJC Warning: Can't connect to local MySQL server through socket BJC '/var/lib/mysql/mysql.sock' (2) in /webroot/dbconnect.php on line 2 BJC Here is a copy of the code I am using: BJC ? BJC $link = mysql_connect(localhos , username , password) BJC or die(Couldn't Connect.); BJC ? BJC I am currently running Apache with Mysql and PHP version 4 on Redhat 8. Any BJC suggestions? BJC Thank you. BJC -- BJC --- BJC Brian J. Celenza BJC [EMAIL PROTECTED] BJC ICQ: 100942424 BJC AIM: BJCKnight If that is the location of the socket (mysql default is /tmp/mysql.sock but I don't know with RH)you could try $link = mysql_connect(:/var/lib/mysql/mysql.sock , username , password) If that fails, check the permissions of the path to the socket for the apache user and that mysqld is running. -- regards, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mysql_connect problem under RedHat 8.0 ?
On Monday 09 December 2002 00:29, Brian J. Celenza wrote: Hello! When trying to connect to a mysql database under my linux system, I get the following error: How did you install your apache, mysql php? Source/RPM? If RPM, where did you get the RPMs? IIRC Redhat's packaging of MySQL differs from that provided by www.mysql.com and this difference could potentially cause the problem you're seeing ... Warning: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /webroot/dbconnect.php on line 2 Here is a copy of the code I am using: ? $link = mysql_connect(localhos , username , password) or die(Couldn't Connect.); ? ... assuming that the above really is a typo and you _are_ using 'localhost' and not 'localhos'. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* Your business will assume vast proportions. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] mysql_connect problem under RedHat 8.0 ?
I'm almost positive that the socket file is in the correct spot. My installation was with Redhat 8.0, I also have mysqlcc installed, and it uses /var/lib/mysql/mysql.sock successfully. - Original Message - From: Jason Wong [EMAIL PROTECTED] Newsgroups: php.general To: [EMAIL PROTECTED] Sent: Sunday, December 08, 2002 11:53 AM Subject: Re: [PHP] mysql_connect problem under RedHat 8.0 ? On Monday 09 December 2002 00:29, Brian J. Celenza wrote: Hello! When trying to connect to a mysql database under my linux system, I get the following error: How did you install your apache, mysql php? Source/RPM? If RPM, where did you get the RPMs? IIRC Redhat's packaging of MySQL differs from that provided by www.mysql.com and this difference could potentially cause the problem you're seeing ... Warning: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /webroot/dbconnect.php on line 2 Here is a copy of the code I am using: ? $link = mysql_connect(localhos , username , password) or die(Couldn't Connect.); ? ... assuming that the above really is a typo and you _are_ using 'localhost' and not 'localhos'. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* Your business will assume vast proportions. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: mysql_connect problem under RedHat 8.0 ?
Found the problem... Somehow my version of mysql had become uninstalled, and I have no idea why that is. Thanks for all the help :) Brian J. Celenza [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hello! When trying to connect to a mysql database under my linux system, I get the following error: Warning: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /webroot/dbconnect.php on line 2 Here is a copy of the code I am using: ? $link = mysql_connect(localhos , username , password) or die(Couldn't Connect.); ? I am currently running Apache with Mysql and PHP version 4 on Redhat 8. Any suggestions? Thank you. -- --- Brian J. Celenza [EMAIL PROTECTED] ICQ: 100942424 AIM: BJCKnight -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] open_basedir
Przemysaw czyski PRV wrote: When I am try toput photo to the server I get this: Warning: open_basedir restriction in effect. File is in wrong directory in /mnt/host-users/zolty/tools/addprod.php on line 117 What is this? Przemek open_basedir restricts the directories that may be used. The message is telling you that the file you are trying to use is outside the directories allowed by open_basedir. Check the manual for more details. HTH Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Finding Mode
On Sat, Dec 07, 2002 at 07:12:09PM -0500, Stephen wrote: Another math question... How would I find the mode (number that repeats most often) of an array? Then, if there isn't a number that repeats most often, tell the user that. A while back, I wrote functions for mean, median and mode. I've put them up at http://www.it.ca/software/statsmmm.php . I don't much like the mode function -- it seems awkward, but I couldn't figure out how to write it any smaller. Also included is a function that calculates the 95th percentile of values in an array, roughly the same way the median() function works ... but I don't recommend using this for bandwidth calculations for co-lo customers because of the hassle of pulling all that data into an array. 95th percentile is more easily calculated in the SQL server than in php. -- Paul Chvostek [EMAIL PROTECTED] Operations / Abuse / Whatever +1 416 598- it.canada - hosting and development http://www.it.ca/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] fopen have a setTimeout feature?
Can you set something like a setTimeout feature in fopen? That is, if you use fopen to open a URL for scraping, if that URL's server is down or doesn't respond in x seconds, can you set a feature to show an error message or a friendly error message indicating such? Thanx Phil
[PHP] Can I check MYSQL version
Hi, Can I check mysql version so if version = 4 $sql = 'version 4 stuff' else $sql =version 3 stuff; -- John Taylor-Johnston - If it's not open-source, it's Murphy's Law. - Université de Sherbrooke: http://compcanlit.ca/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Can I check MYSQL version
On Sunday 08 December 2002 20:42, John Taylor-Johnston wrote: Hi, Can I check mysql version so if version = 4 $sql = 'version 4 stuff' else $sql =version 3 stuff; Try this SQL-Statement: SEELCT VERSION(); MySQL-Manual: http://www.mysql.com/doc/en/Miscellaneous_functions.html johannes -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Can I check MYSQL version
mysql SELECT VERSION(); - '3.23.13-log' Ok, how do I PHP it for greater than or equals version 4 :? John Johannes Schlueter wrote: On Sunday 08 December 2002 20:42, John Taylor-Johnston wrote: Hi, Can I check mysql version so if version = 4 $sql = 'version 4 stuff' else $sql =version 3 stuff; Try this SQL-Statement: SEELCT VERSION(); MySQL-Manual: http://www.mysql.com/doc/en/Miscellaneous_functions.html johannes -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Typo -- Re: [PHP] Can I check MYSQL version
On Sunday 08 December 2002 20:40, Johannes Schlueter wrote: SEELCT VERSION(); Should be SELECT VERSION() ;-) johannes -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Can I check MYSQL version
$sql = SELECT VERSION(); $result = mysql_query($sql); $ver = mysql_fetch_assoc($result); if($ver[0] = 4) { echo You have MySQL 4.0 or greater; } else { echo You DON'T have MySQL 4.0 or greater; } Not sure if that'll work or not, I haven't tested it. Hope it does though. - Original Message - From: John Taylor-Johnston [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, December 08, 2002 2:57 PM Subject: Re: [PHP] Can I check MYSQL version mysql SELECT VERSION(); - '3.23.13-log' Ok, how do I PHP it for greater than or equals version 4 :? John Johannes Schlueter wrote: On Sunday 08 December 2002 20:42, John Taylor-Johnston wrote: Hi, Can I check mysql version so if version = 4 $sql = 'version 4 stuff' else $sql =version 3 stuff; Try this SQL-Statement: SEELCT VERSION(); MySQL-Manual: http://www.mysql.com/doc/en/Miscellaneous_functions.html johannes -- 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] Can I check MYSQL version
oh gawd... get the spoons... $query = mysql_query(select version as version) while ($result = mysql_fetch_row($query)) { // do a strcmp() or ereg() on $row['0'] } - Original Message - From: John Taylor-Johnston [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, December 08, 2002 9:57 PM Subject: Re: [PHP] Can I check MYSQL version mysql SELECT VERSION(); - '3.23.13-log' Ok, how do I PHP it for greater than or equals version 4 :? John Johannes Schlueter wrote: On Sunday 08 December 2002 20:42, John Taylor-Johnston wrote: Hi, Can I check mysql version so if version = 4 $sql = 'version 4 stuff' else $sql =version 3 stuff; Try this SQL-Statement: SEELCT VERSION(); MySQL-Manual: http://www.mysql.com/doc/en/Miscellaneous_functions.html johannes -- 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] Hiding URL Variable
How can you hide URL variables without using the POST method in a form? Thanks, Stephen Craton http://www.melchior.us What is a dreamer that cannot persevere? -- http://www.melchior.us -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] fopen have a setTimeout feature?
how about something like... $start = time(); $timeout = 60; // number of seconds to try while (!$file = fopen(...) time() $start + $timeout); if ($file) { // do stuff with file } Tim Ward http://www.chessish.com mailto:[EMAIL PROTECTED] - Original Message - From: Phil Powell [EMAIL PROTECTED] To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Sunday, December 08, 2002 7:32 PM Subject: [PHP] fopen have a setTimeout feature? Can you set something like a setTimeout feature in fopen? That is, if you use fopen to open a URL for scraping, if that URL's server is down or doesn't respond in x seconds, can you set a feature to show an error message or a friendly error message indicating such? Thanx Phil -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Hiding URL Variable
store them in a session or cookie Tim Ward http://www.chessish.com mailto:[EMAIL PROTECTED] - Original Message - From: Stephen [EMAIL PROTECTED] To: PHP List [EMAIL PROTECTED] Sent: Sunday, December 08, 2002 8:10 PM Subject: [PHP] Hiding URL Variable How can you hide URL variables without using the POST method in a form? Thanks, Stephen Craton http://www.melchior.us What is a dreamer that cannot persevere? -- http://www.melchior.us -- 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] Send PHP results in email
Thanks Jason, I saw this a while ago and it solved the problem perfectly. On Thu, 5 Dec 2002 06:11:40 +0800, [EMAIL PROTECTED] (Jason Wong) wrote: On Thursday 05 December 2002 05:58, Malcolm Brownell wrote: Hi, I have some database fields I want to select and email. I have lines like -- $result = mysql_query(SELECT * FROM adopt_main order by idform desc limit 1); while( $row = mysql_fetch_array ($result)) echo .$row[first].,; There are quite a few of these paragraphs in the page -- 15 fields. The page does just what I want. It echos the value, with commas and quotes, all ready to be inserted, but, I can'tseem to figure out how to mail it. I know I need to make all of this a variable to pass to my mail script, but how ? My mail script work fine if I define $body and send that but I can't seem to do that with this code. In your while loop, instead of (or as well as) using echo, assign your values to $body -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* If something has not yet gone wrong then it would ultimately have been beneficial for it to go wrong. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP Configuration - Can't Change Post_Max_Size
I've got 4.1.1 and it's upload_max_filesizemine is default 2 M maybe you have a different version. hth m On Thu, 5 Dec 2002 10:32:44 -0800, [EMAIL PROTECTED] (Roger Lewis) wrote: This is further to my post yesterday on Max File Size. I was able to set upload_max_filesize to 790 and I can therefore upload files up to that size. I would now like to increase that limit, but I am limited by post_max_size which defaults to 8M. I can't seem to change the value of post_max_size. The post_max_size directive is not in my php.ini; however, I tried inserting it into php.ini and setting it to 1600 and to 16M. I inserted it just before the directive, gpc_order = GPC. The change is ignored by phpinfo(), that is, phpinfo() still shows post_max_size = 8M. Furthermore, I tried resetting it using ini_set(post_max_size, 16M), and ini_set(post_max_size, 1600), but neither of these had any effect. Any suggestion for how I might reset post_max_size. I'm using PHP 4.0.6. Thanks in advance. Roger -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: Re[4]: [PHP] Simple text editor for Windows?
As a followup, I know someone mentioned Crimson Editor for my question. It installed fine on WinXP as a general user, but it wanted to access the registry and wouldn't install as a general user under Win2K. FYI... ---John W. Holmes... PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/ -Original Message- From: Jonathan [mailto:[EMAIL PROTECTED]] Sent: Saturday, December 07, 2002 3:19 PM To: [EMAIL PROTECTED] Subject: RE: Re[4]: [PHP] Simple text editor for Windows? Try Winsyntax (http://winsyntax.com/) It's not as robust and colorful as others, but it's simplicity has won me over. It's great is you just want to code. -Original Message- From: Tom Rogers [mailto:[EMAIL PROTECTED]] Sent: Saturday, December 07, 2002 12:51 PM To: DL Neil Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re[4]: [PHP] Simple text editor for Windows? Hi, Sunday, December 8, 2002, 4:22:52 AM, you wrote: DN Hi Tom, I know the text editor question has been beat to death, but I'm looking for a simple editor with syntax highlighting that can be installed in Windows by a general user. It would have to be something that didn't access the registry, as normal users can't do that. Does anyone know of a program like this? Thanks. Take a look at this one it seemed to be pretty good, the closest I've seen DN to homesite functionality without the bloat. http://www.crimsoneditor.com/ DN Looks interesting - and no registry finagling you say! DN One expects that John meant PHP syntax highlighting. From where is the PHP DN control file made available? DN Please advise, DN =dn From the same site http://www.crimsoneditor.com/board/data/user0/php.zip -- regards, Tom -- 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] mpm perchild mod_php4
I ask this list now because nobody could answer my question on the apache list. I installed Apache 2.0.43 --with-mpm=perchild in order to get more security in executing php-scripts. I know that perchild is experimental but I couldn't run it at all. We will make some tests - without success. When I try to connect with http://192.168.0.1 I will get no answers (browser ist loading, loading, loading httpd.conf: Listen 80 ServerAdmin [EMAIL PROTECTED] ServerName 192.168.0.1:80 NameVirtualHost 192.168.0.1 Include /etc/apache/virtual.conf virtual.conf: VirtualHost 192.168.0.1 Servername 192.168.0.1 ServerAdmin [EMAIL PROTECTED] DocumentRoot /www # AssignUserid nobody nobody ChildPerUserId jochen jochen 2 /VirtualHost What should I insert into AssignUserId? Apache ist running as user: nobody group: nobody. ps aux: root 20015 0.0 1.5 3600 2024 ?S16:01 0:00 /usr/local/apache2/bin/httpd -k start nobody 20016 0.0 1.5 3536 1964 ?S16:01 0:00 /usr/local/apache2/bin/httpd -k start nobody 23779 0.0 1.7 13916 2160 ?S16:05 0:00 /usr/local/apache2/bin/httpd -k start nobody 23781 0.0 1.7 13916 2160 ?S16:05 0:00 /usr/local/apache2/bin/httpd -k start nobody 23788 0.0 0.0 00 ?Z16:05 0:00 [httpd defunct] nobody 23789 0.0 1.7 13916 2160 ?S16:05 0:00 /usr/local/apache2/bin/httpd -k start nobody 23790 0.0 1.7 13916 2160 ?S16:05 0:00 /usr/local/apache2/bin/httpd -k start nobody 23791 0.0 0.0 00 ?Z16:05 0:00 [httpd defunct] jochen 24161 0.0 0.0 00 ?Z16:05 0:00 [httpd defunct] nobody 24162 0.0 0.0 00 ?Z16:05 0:00 [httpd defunct] error_log: [Sun Dec 08 16:03:03 2002] [notice] child pid 21526 exit signal Segmentation fault (11) [Sun Dec 08 16:03:03 2002] [notice] child pid 21524 exit signal Segmentation fault (11) [Sun Dec 08 16:03:03 2002] [emerg] (13)Permission denied: apr_proc_mutex_lock failed. Attempting to shutdown process gracefully. [Sun Dec 08 16:03:03 2002] [emerg] (13)Permission denied: apr_proc_mutex_unlock failed. Attempting to shutdown process gracefully. [Sun Dec 08 16:03:03 2002] [emerg] (13)Permission denied: apr_proc_mutex_lock failed. Attempting to shutdown process gracefully. [Sun Dec 08 16:03:03 2002] [emerg] (13)Permission denied: apr_proc_mutex_unlock failed. Attempting to shutdown process gracefully. -- Jochen Kaechelin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Solaris
Sorry I know this is off subject but I'm in a bind. I have a problem with my Solaris box booting up. Does I fairly new to all of this so does anybody know a good newsgroup for Solaris?? My problem is I added a file so a program would auto load. I added the file to etc/rc2.d Now this program loads perfect but continues to run and the rest of the O/S can't load. How can I access that director to delete the file?? Thanks for any help Kris
RE: [PHP] Solaris
Kris, a couple of options for you to try are http://www.sun.com/bigadmin http://www.solariscentral.com also have a search in google also you can try this... resart the machine and press stop a after the banner comes up and you get the ok prompt .. then type boot -s (for single user mode) (you will need to know the root password) it will come up with a message saying something like .. you are about to enter into maintance mode.. press control-c to proceed in normal start up mode. once you have entered in the root password you will be able to mode around the directories via the command line .. then is a simple matter of tying cd /etc/rc2.d ; rm filename -Original Message- From: Kris [mailto:[EMAIL PROTECTED]] Sent: Monday, 9 December 2002 12:04 PM To: PHP List Subject: [PHP] Solaris Sorry I know this is off subject but I'm in a bind. I have a problem with my Solaris box booting up. Does I fairly new to all of this so does anybody know a good newsgroup for Solaris?? My problem is I added a file so a program would auto load. I added the file to etc/rc2.d Now this program loads perfect but continues to run and the rest of the O/S can't load. How can I access that director to delete the file?? Thanks for any help Kris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] date() on two diff. servers
Hi, I'm running the following code on two servers: ? $stamp = 1039525200; echo date('D, d M Y',$stamp); ? On my local development box (Free BSD, PHP 4.1.1, on AUSTRALIAN time), the above echo's Wed, 11 Dec 2002 (I consider this to be the correct date. However on the live server (Red Hat, PHP 4.2.3, hosted in CANADA) the above code echo's Tue, 10 Dec 2002. Now, what could be causing this problem? IMHO, no matter where you are in the world (or more to the point, what timezone you are in), 1039525200 seconds after a certain date (in this case the unix epoch) should be another certain date, yes? What could be causing this difference? What should I talk to my host about, or look for? Thanks, Justin French http://Indent.com.au Web Development Graphic Design -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Solaris
Thank you so much Worked like a charm!! :) Kris - Original Message - From: Peter Houchin [EMAIL PROTECTED] To: Kris [EMAIL PROTECTED]; PHP List [EMAIL PROTECTED] Sent: Monday, December 09, 2002 12:01 PM Subject: RE: [PHP] Solaris Kris, a couple of options for you to try are http://www.sun.com/bigadmin http://www.solariscentral.com also have a search in google also you can try this... resart the machine and press stop a after the banner comes up and you get the ok prompt .. then type boot -s (for single user mode) (you will need to know the root password) it will come up with a message saying something like .. you are about to enter into maintance mode.. press control-c to proceed in normal start up mode. once you have entered in the root password you will be able to mode around the directories via the command line .. then is a simple matter of tying cd /etc/rc2.d ; rm filename -Original Message- From: Kris [mailto:[EMAIL PROTECTED]] Sent: Monday, 9 December 2002 12:04 PM To: PHP List Subject: [PHP] Solaris Sorry I know this is off subject but I'm in a bind. I have a problem with my Solaris box booting up. Does I fairly new to all of this so does anybody know a good newsgroup for Solaris?? My problem is I added a file so a program would auto load. I added the file to etc/rc2.d Now this program loads perfect but continues to run and the rest of the O/S can't load. How can I access that director to delete the file?? Thanks for any help Kris -- 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] date() on two diff. servers
Daylight Savings Time? ---John W. Holmes... PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/ -Original Message- From: Justin French [mailto:[EMAIL PROTECTED]] Sent: Sunday, December 08, 2002 8:59 PM To: php Subject: [PHP] date() on two diff. servers Hi, I'm running the following code on two servers: ? $stamp = 1039525200; echo date('D, d M Y',$stamp); ? On my local development box (Free BSD, PHP 4.1.1, on AUSTRALIAN time), the above echo's Wed, 11 Dec 2002 (I consider this to be the correct date. However on the live server (Red Hat, PHP 4.2.3, hosted in CANADA) the above code echo's Tue, 10 Dec 2002. Now, what could be causing this problem? IMHO, no matter where you are in the world (or more to the point, what timezone you are in), 1039525200 seconds after a certain date (in this case the unix epoch) should be another certain date, yes? What could be causing this difference? What should I talk to my host about, or look for? Thanks, Justin French http://Indent.com.au Web Development Graphic Design -- 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] date() on two diff. servers
Hello, John W. Holmes [EMAIL PROTECTED] wrote: Daylight Savings Time? John, I think Daylight Saving Time creates a difference of 1 hour and not 1 day :) Anyway, I live in a place where we don't practice this so I could be wrong... ...[snip]... Now, what could be causing this problem? IMHO, no matter where you are in the world (or more to the point, what timezone you are in), 1039525200 seconds after a certain date (in this case the unix epoch) should be another certain date, yes? Justin, it depends how you got your timestamp in the first place, I think... I could be wrong again here but aren't these different? mktime() gmmktime() - E ...[snip]... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] date() on two diff. servers
But, then again, it could be just because the other server's time is really late... (caused by old motherboard batteries, etc.) - E @ Edwin [EMAIL PROTECTED] wrote: Hello, John W. Holmes [EMAIL PROTECTED] wrote: Daylight Savings Time? John, I think Daylight Saving Time creates a difference of 1 hour and not 1 day :) Anyway, I live in a place where we don't practice this so I could be wrong... ...[snip]... Now, what could be causing this problem? IMHO, no matter where you are in the world (or more to the point, what timezone you are in), 1039525200 seconds after a certain date (in this case the unix epoch) should be another certain date, yes? Justin, it depends how you got your timestamp in the first place, I think... I could be wrong again here but aren't these different? mktime() gmmktime() - E ...[snip]... -- 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] date() on two diff. servers
on 09/12/02 1:30 PM, @ Edwin ([EMAIL PROTECTED]) wrote: Daylight Savings Time? John, I think Daylight Saving Time creates a difference of 1 hour and not 1 day :) True... but I checked it anyway -- by adding just one and two hours to the stamp... which made no difference... but when I added 86400 to the stamp, it all worked. Justin, it depends how you got your timestamp in the first place, I think... I could be wrong again here but aren't these different? mktime() gmmktime() Actually, they were created with strtotime(). Note, I don't believe there's anything wrong with the stamp itself. The point is, the stamp is displaying as two different dates using date() on two different servers, and I believe this is not what date() is supposed to do. Shouldn't the stamp for 12-09-2002 22:13:09 be the same on every server? My rationale for this is that no matter where you are in the world, it is always a certain number of seconds since 01-01-1970 00:00:00. Perhaps strtotime() is NOT running off GMT, and perhaps date() is... there has to be SOME confusion there -- either on my side, or in my choice of functions, or SOMETHING :) Justin French http://Indent.com.au Web Development Graphic Design -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] date() on two diff. servers
Hi, Monday, December 9, 2002, 11:59:07 AM, you wrote: JF Hi, JF I'm running the following code on two servers: JF ? JF $stamp = 1039525200; JF echo date('D, d M Y',$stamp); ? JF On my local development box (Free BSD, PHP 4.1.1, on AUSTRALIAN time), the JF above echo's Wed, 11 Dec 2002 (I consider this to be the correct date. JF However on the live server (Red Hat, PHP 4.2.3, hosted in CANADA) the above JF code echo's Tue, 10 Dec 2002. JF Now, what could be causing this problem? IMHO, no matter where you are in JF the world (or more to the point, what timezone you are in), 1039525200 JF seconds after a certain date (in this case the unix epoch) should be another JF certain date, yes? JF What could be causing this difference? What should I talk to my host about, JF or look for? JF Thanks, JF Justin French JF JF http://Indent.com.au JF Web Development JF Graphic Design JF Put this at the top of your page $tz = getenv('TZ'); if($tz != 'Australia/Brisbane') putenv(TZ=Australia/Brisbane); -- regards, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: C#
Wilmar Perez wrote: Hello guys I'm sorry if this message disturbs anyone, I know it is completely off topic. I've been thinking about open a C# mailing list for I hadn't been able to find a good one so far. All I want to know is if there is enough people out there interested in joining such list. I posted this message to this list for a couple of reason: it is the only programming list I am in and since you're php developers I thought many of you may be interested. Again please don't get mad at me for this I don't mean to upset or disturb anyone. Sr. Perez: Please visit aspfriends.com (I think that's it) or learnasp.com. There are links there to many c# and other .net-related lists and boards. Good luck. Michael Kimsal http://www.phpappserver.com 734-480-9961 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] date() on two diff. servers
Justin French [EMAIL PROTECTED] wrote: [snip] Perhaps strtotime() is NOT running off GMT, [/snip] Bingo! ...or, Bull's eye!, whatever :) Anyway, I think this is implied in the manual. http://www.php.net/manual/en/function.strtotime.php Also, check User Contributed Notes: piran at pobox dot com php at webdevelopers dot cz HTH, - E -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] date() on two diff. servers
on 09/12/02 3:06 PM, @ Edwin ([EMAIL PROTECTED]) wrote: [snip] Perhaps strtotime() is NOT running off GMT, [/snip] Bingo! *GULP*... so, what we're saying is, that if I intend to pass data around on multiple servers (in different timezones) using a unix timestamp for dates (which i prefer to do), I should be using gmdate() and gmmktime() rather than date() and strtotime()? That will sure as hell be a few lines of code to dig through I'll also need an accurate (and daylight savings compliant!) way of determining the how far ahead of the GMT the server currently is, or for a specific timezone for a specific project (eg this current one, which is basing it's dates on Sydney, Australia. Justin French http://Indent.com.au Web Development Graphic Design -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
php-general Digest 9 Dec 2002 05:40:32 -0000 Issue 1752
php-general Digest 9 Dec 2002 05:40:32 - Issue 1752 Topics (messages 127437 through 127468): Re: mysql_connect problem under RedHat 8.0 ? 127437 by: Tom Rogers 127438 by: Jason Wong 127439 by: Brian J. Celenza 127440 by: Brian J. Celenza Re: open_basedir 127441 by: Chris Hewitt Re: Finding Mode 127442 by: Paul Chvostek fopen have a setTimeout feature? 127443 by: Phil Powell 127451 by: Tim Ward Can I check MYSQL version 127444 by: John Taylor-Johnston 127445 by: Johannes Schlueter 127446 by: John Taylor-Johnston 127448 by: Stephen 127449 by: Chris Knipe Typo -- Re: [PHP] Can I check MYSQL version 127447 by: Johannes Schlueter Hiding URL Variable 127450 by: Stephen 127452 by: Tim Ward Re: Send PHP results in email 127453 by: Malcolm Brownell Re: PHP Configuration - Can't Change Post_Max_Size 127454 by: Malcolm Brownell Re: Simple text editor for Windows? 127455 by: John W. Holmes mpm perchild mod_php4 127456 by: Jochen Kächelin Solaris 127457 by: Kris 127458 by: Peter Houchin 127460 by: Kris date() on two diff. servers 127459 by: Justin French 127461 by: John W. Holmes 127462 by: . Edwin 127463 by: . Edwin 127464 by: Justin French 127465 by: Tom Rogers 127467 by: . Edwin 127468 by: Justin French Re: C# 127466 by: michael kimsal 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, Monday, December 9, 2002, 2:29:35 AM, you wrote: BJC Hello! BJC When trying to connect to a mysql database under my linux system, I get the BJC following error: BJC Warning: Can't connect to local MySQL server through socket BJC '/var/lib/mysql/mysql.sock' (2) in /webroot/dbconnect.php on line 2 BJC Here is a copy of the code I am using: BJC ? BJC $link = mysql_connect(localhos , username , password) BJC or die(Couldn't Connect.); BJC ? BJC I am currently running Apache with Mysql and PHP version 4 on Redhat 8. Any BJC suggestions? BJC Thank you. BJC -- BJC --- BJC Brian J. Celenza BJC [EMAIL PROTECTED] BJC ICQ: 100942424 BJC AIM: BJCKnight If that is the location of the socket (mysql default is /tmp/mysql.sock but I don't know with RH)you could try $link = mysql_connect(:/var/lib/mysql/mysql.sock , username , password) If that fails, check the permissions of the path to the socket for the apache user and that mysqld is running. -- regards, Tom ---End Message--- ---BeginMessage--- On Monday 09 December 2002 00:29, Brian J. Celenza wrote: Hello! When trying to connect to a mysql database under my linux system, I get the following error: How did you install your apache, mysql php? Source/RPM? If RPM, where did you get the RPMs? IIRC Redhat's packaging of MySQL differs from that provided by www.mysql.com and this difference could potentially cause the problem you're seeing ... Warning: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /webroot/dbconnect.php on line 2 Here is a copy of the code I am using: ? $link = mysql_connect(localhos , username , password) or die(Couldn't Connect.); ? ... assuming that the above really is a typo and you _are_ using 'localhost' and not 'localhos'. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * /* Your business will assume vast proportions. */ ---End Message--- ---BeginMessage--- I'm almost positive that the socket file is in the correct spot. My installation was with Redhat 8.0, I also have mysqlcc installed, and it uses /var/lib/mysql/mysql.sock successfully. - Original Message - From: Jason Wong [EMAIL PROTECTED] Newsgroups: php.general To: [EMAIL PROTECTED] Sent: Sunday, December 08, 2002 11:53 AM Subject: Re: [PHP] mysql_connect problem under RedHat 8.0 ? On Monday 09 December 2002 00:29, Brian J. Celenza wrote: Hello! When trying to connect to a mysql database under my linux system, I get the following error: How did you install your apache, mysql php? Source/RPM? If RPM, where did you get the RPMs? IIRC Redhat's packaging of MySQL differs from that provided by www.mysql.com and this difference could potentially cause the problem you're seeing ... Warning: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /webroot/dbconnect.php on line 2 Here is a copy of the code I am using: ? $link = mysql_connect(localhos
Re: [PHP] fopen have a setTimeout feature?
Sorry, your code produced this error and I can't figure out how to debug it :( Warning: fopen(http://www3.brinkster.com/soa/val/profile/display.asp?showLeftNavBann er=1,r) - Error 0 in /users/ppowell/web/profiledisplay.php on line 4 Phil - Original Message - From: Tim Ward [EMAIL PROTECTED] To: Phil Powell [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Sunday, December 08, 2002 3:10 PM Subject: Re: [PHP] fopen have a setTimeout feature? how about something like... $start = time(); $timeout = 60; // number of seconds to try while (!$file = fopen(...) time() $start + $timeout); if ($file) { // do stuff with file } Tim Ward http://www.chessish.com mailto:[EMAIL PROTECTED] - Original Message - From: Phil Powell [EMAIL PROTECTED] To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Sunday, December 08, 2002 7:32 PM Subject: [PHP] fopen have a setTimeout feature? Can you set something like a setTimeout feature in fopen? That is, if you use fopen to open a URL for scraping, if that URL's server is down or doesn't respond in x seconds, can you set a feature to show an error message or a friendly error message indicating such? Thanx Phil -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] date() on two diff. servers
Justin French [EMAIL PROTECTED] wrote: on 09/12/02 3:06 PM, @ Edwin ([EMAIL PROTECTED]) wrote: [snip] Perhaps strtotime() is NOT running off GMT, [/snip] Bingo! *GULP*... so, what we're saying is, that if I intend to pass data around on multiple servers (in different timezones) using a unix timestamp for dates (which i prefer to do), I should be using gmdate() and gmmktime() rather than date() and strtotime()? I'm afraid so... That will sure as hell be a few lines of code to dig through Well... just hope that others chime in and suggest a better solution :) I'll also need an accurate (and daylight savings compliant!) way of determining the how far ahead of the GMT the server currently is, or for a specific timezone for a specific project (eg this current one, which is basing it's dates on Sydney, Australia. If I understand the problem correctly and if my understanding of the functions are correct, I'm not sure if you'd really need something like this. Consider this: ?php $timestamp_local = time(); $timestamp_gmt = gmmktime(); $run_local = date(F j, Y, G:i:s, $timestamp_local); $run_gmt = gmdate(F j, Y, G:i:s, $timestamp_gmt); echo Local Timestamp: $timestamp_localbr /; echo GMT Timestamp: $timestamp_gmtbr /br /; echo This script was run on: br /; echo $run_local (DATE with Local Timestamp)br /; echo $run_gmt (GMDATE with GMT Timestamp)br /; ? As you can see, although the timestamps are different, they produce the same results. So, *I think*, using gmdate() and gmmktime() would be enough. (Or, if you insist on using strtotime(), consider the example(s) in the User Contributed Notes I mentioned earlier.) I hope this give you some hints. - E -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php