Re: [PHP] Static Array vs MySQL query
- Edwin - wrote: Hi, On 2003/11/29, at 8:10, John Nichel wrote: Hi, I'm designing my site to use drop down menus, and am having php generate the content of the main manus, as well as the sub-menus. What I'm wondering is what the performance hit will be with putting all the menu variables into an array in a config file vs storing the info in a MySQL table, and retriving the data from there. ...[snipped]... Instead of generating the menu(s) each time, why not create a static [HTML] file which you can call by using file_get_contents() or something and just insert it where it's needed? Just an idea... And a better idea it is. That's what I get for thinking I have to 'program' everything. Thanks! -- By-Tor.com It's all about the Rush http://www.by-tor.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] File upload issue
Hi all, In my php.ini file, file_uploads value is set to OFF. Hence stopping HTTP_UPLOAD functionlaity. But in my script i am turning it On using ini_set(file_uploads,1) but still it doesn't upload the file. I don have access to modify the php.ini file hence trying to play with script only. Though manual says u can't set the value of file_uploads in the script, but its getting set (looked in phpinfo()). Why this is happening ... and if it is getting set why HTTP_UPLOAD doesn't work. Thanks in advance Binay
Re: [PHP] File upload issue
On Sat, 2003-11-29 at 02:36, Binay wrote: Hi all, In my php.ini file, file_uploads value is set to OFF. Hence stopping HTTP_UPLOAD functionlaity. But in my script i am turning it On using ini_set(file_uploads,1) but still it doesn't upload the file. I don have access to modify the php.ini file hence trying to play with script only. Though manual says u can't set the value of file_uploads in the script, but its getting set (looked in phpinfo()). Why this is happening ... and if it is getting set why HTTP_UPLOAD doesn't work. If the docs say it doesn't work then it probably doesn't work. Chances are it's being set in the PHP code when you use ini_set() but not in PHP's core where it counts. Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] File upload issue
Are u working in safe mode? What does the ini_set function return? did u try ini_get then to see what is current value? Brona Hi all, In my php.ini file, file_uploads value is set to OFF. Hence stopping HTTP_UPLOAD functionlaity. But in my script i am turning it On using ini_set(file_uploads,1) but still it doesn't upload the file. I don have access to modify the php.ini file hence trying to play with script only. Though manual says u can't set the value of file_uploads in the script, but its getting set (looked in phpinfo()). Why this is happening ... and if it is getting set why HTTP_UPLOAD doesn't work. Thanks in advance Binay -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] File upload issue
- Original Message - From: Bronislav Klucka [EMAIL PROTECTED] To: PHP Konference [EMAIL PROTECTED]; Binay [EMAIL PROTECTED] Sent: Saturday, November 29, 2003 1:08 PM Subject: RE: [PHP] File upload issue Are u working in safe mode? safe_mode is OFF What does the ini_set function return? did u try ini_get then to see what is current value? returns 1. Brona Hi all, In my php.ini file, file_uploads value is set to OFF. Hence stopping HTTP_UPLOAD functionlaity. But in my script i am turning it On using ini_set(file_uploads,1) but still it doesn't upload the file. I don have access to modify the php.ini file hence trying to play with script only. Though manual says u can't set the value of file_uploads in the script, but its getting set (looked in phpinfo()). Why this is happening ... and if it is getting set why HTTP_UPLOAD doesn't work. Thanks in advance Binay -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] DAMN
On Saturday 29 November 2003 12:54 am, Bronislav Klucka wrote: because we know that this bug has easy solution... [jumps in] Yes - X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600. [jumps out] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] DAMN
what does it mean? -Original Message- From: Gerard Samuel [mailto:[EMAIL PROTECTED] Sent: Saturday, November 29, 2003 8:50 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] DAMN On Saturday 29 November 2003 12:54 am, Bronislav Klucka wrote: because we know that this bug has easy solution... [jumps in] Yes - X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600. [jumps out] -- 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] Test
Send test :)
[PHP] Re: Test
why do you test here at the honored PHP General mailing list? César aracena [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Send test :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Problem loading fonts in gd()
Hello all PHP gurus I have a small problem about loading fonts with imageloadfont() I have copyed fonts with the extension .fon or .ttf to the same directory as my script, and i give them the font as an argument: $font = imageloadfont('arial.ttf'); But i just keep getting the message: Warning: imageloadfont(): Error reading font in c:\program files\apache group\apache\htdocs\gd_test.php on line 35 Does anyone know how to properly load fonts into gd, without getting this error message? Eric -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] DAMN
On Saturday 29 November 2003 03:20 am, Bronislav Klucka wrote: what does it mean? I don't want to get into this debate too much, but from what little I read when it was going on earlier this past week, people who seemed to complain the most are the ones using Outlook. Seems like Outlook isn't mailing list friendly. To get more/accurate info, look at the archives from earlier this past week... On Saturday 29 November 2003 12:54 am, Bronislav Klucka wrote: because we know that this bug has easy solution... [jumps in] Yes - X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600. [jumps out] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] what's the story with html_entity_decode?
According to the manual it appears to support UTF-8, but it complains loudly about not supporting MBCS when invoked? Warning: cannot yet handle MBCS in html_entity_decode()! Will html_entity_decode produce output in UTF-8 when e.g. invoked like this: $a=Zuuml;rich, \klonk\ aelig; 'aring;' ; $b=html_entity_decode( $a, ENT_QUOTES, UTF-8 ); It seems to default to ISO-8859-1? thanks /Per -- Per Jessen, Zurich http://timian.jessen.ch - an analog report formatter using XSLT. http://jessen.ch/dansk-listen - for alle danskere i udlandet! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Checking if a host is online
I'm creating an application for an Intranet that, among other things, is supposed to check to see if particular hosts are online, and if so, what their IP address is. Anyone know how I can accomplish this? I tried using exec(host $host); (where $host is the hostname) and while this gets the IP it gets the IP address sometimes even if the host is not active, because a DNS record for the system still exists. I also looked into the gethostbyname() function, but that has similar problems to using the external host command. I also tried to use an external ping command (ping -c 1 $host), and while I could get that to work, since it returns non-zero status if the host can not be contacted, it takes quite a while to execute for even a few hosts at once. Anyone ever do this king=d of thing before or have any suggestions on what might work? -- Jason Giangrande [EMAIL PROTECTED] http://www.giangrande.org http://www.dogsiview.com signature.asc Description: This is a digitally signed message part
Re: [PHP] Checking if a host is online
Jason Giangrande wrote: I'm creating an application for an Intranet that, among other things, is supposed to check to see if particular hosts are online, and if so, what their IP address is. Anyone know how I can accomplish this? I tried using exec(host $host); (where $host is the hostname) and while this gets the IP it gets the IP address sometimes even if the host is not active, because a DNS record for the system still exists. I also looked into the gethostbyname() function, but that has similar problems to using the external host command. I also tried to use an external ping command (ping -c 1 $host), and while I could get that to work, since it returns non-zero status if the host can not be contacted, it takes quite a while to execute for even a few hosts at once. Anyone ever do this king=d of thing before or have any suggestions on what might work? why not try: passthru(ping $host); Adam -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Checking if a host is online
On Sat, 2003-11-29 at 12:20, Adam Maas wrote: why not try: passthru(ping $host); Adam That still takes a little while to execute on multiple hosts, Plus I need to modify the output of the command to print just the IP address and discard the rest of the output. -- Jason Giangrande [EMAIL PROTECTED] http://www.giangrande.org http://www.dogsiview.com signature.asc Description: This is a digitally signed message part
Re: [PHP] Checking if a host is online
Adam Maas wrote: Jason Giangrande wrote: I'm creating an application for an Intranet that, among other things, is supposed to check to see if particular hosts are online, and if so, what their IP address is. Anyone know how I can accomplish this? I tried using exec(host $host); (where $host is the hostname) and while this gets the IP it gets the IP address sometimes even if the host is not active, because a DNS record for the system still exists. I also looked into the gethostbyname() function, but that has similar problems to using the external host command. I also tried to use an external ping command (ping -c 1 $host), and while I could get that to work, since it returns non-zero status if the host can not be contacted, it takes quite a while to execute for even a few hosts at once. Anyone ever do this king=d of thing before or have any suggestions on what might work? why not try: passthru(ping $host); Adam My bad, didn't read closely enough. It's not likely to be able to do this fast, ef you only want it to query when asked. You may want to look into a monitoring solution like NOCOL. Adam -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Suggestions for optimization?
I'm working on some database search ranking code. It currently represents 95-98% of the time spent when doing fuzzy seaches. I have tried my best to optimize my code - algorithmic shortcuts, eliminating session variables, unsetting irrelevant results, etc and benchmarking to find the best techniques. That's given me over a 10x improvement. Unfortunately, because of the number of results it must process (up to 20,000), it is still somewhat slow. I think it could use some code structure/formating tweaks to eek out that last bit of performance, but I don't know much about optimizing PHP code in that way. Does anybody have suggestions? Also, might there be some tweaks for PHP itself to improve performance? I already know about the Zend Optimizer and have it installed, it does help. Thanks! Here's my code: if ($search_results[0][relevancy] == ) { function cmp($a, $b) { if($a[relevancy] $b[relevancy]) { return 1; } elseif($a[relevancy] $b[relevancy]) { return -1; } else { return 0; } } $search_statements = $_SESSION[search][statements]; foreach($search_results as $key1 = $value1) { $num_fields_matched = 0; $result_score = 0; $metaphone_ratio = 0; foreach($search_statements as $key = $value) { if ($value != AND $value1[$key] != $value) { $value = strtolower(trim($value)); $value1[$key] = strtolower(trim(($value1[$key]))); $num_fields_matched++; $value_metaphone = metaphone($value1[$key]); $search_metaphone = metaphone($value); $search_position = strpos($value1[$key], $value); $string_count = substr_count($value1[$key], $value); $levenshtein = levenshtein($value, $value1[$key], 0.5, 1, 1); if ($search_metaphone == $value_metaphone AND $value_metaphone != ) { $metaphone_ratio = 1; } elseif ($search_metaphone != 0) { $metaphone_ratio = 0.6 * (1 / levenshtein($search_metaphone, $value_metaphone)); } $result_score = $result_score + ($levenshtein + (8 * $search_position)) - (2 * ($string_count - 1)) - (1.1 * $metaphone_ratio * $levenshtein); } elseif ($value1[$key] == $value) { $result_score = $result_score - 5; } } if ($num_fields_matched == 0) { $num_fields_matched = 1; } $search_results[$key1][relevancy] = ($result_score * -1) / $num_fields_matched; if ($fuzzy_search == true AND $search_results[$key1][relevancy] -5) { unset($search_results[$key1]); } } usort($search_results, cmp); } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Checking if a host is online
Jason -- ...and then Jason Giangrande said... % % I'm creating an application for an Intranet that, among other things, is % supposed to check to see if particular hosts are online, and if so, what % their IP address is. Anyone know how I can accomplish this? I tried ... % a while to execute for even a few hosts at once. 1) If you're first checking to see if it's alive and second checking for its IP address you are, IMHO, doing it backwards :-) 2) It sounds like you're rewriting BigBrother. Check out bb4.com for info. It absolutely rocks and I wouldn't run a real site[1] without it. 3) At the very least, cut your ping timeout down to the smallest acceptable; in general, a full second is plenty of time to get nearly anywhere on your continent (ain't it great? :-) and so your intranet should be more than happy with that allowance. 4) I know that BB has already beaten this problem, so you should also check there, but there may be a way to ping numerous hosts at once (netping or such). Try some googling. If nothing else, I know that you could whip up a perl script which will fork the load and then run them in parallel and could return the live/dead/notfound results; I don't think that php has forking. [1] My house must therefore by definition not be a real site, but it aspires to be -- and shall whenever I can find some unallocated time :-) HTH HAND :-D -- David T-G * There is too much animal courage in (play) [EMAIL PROTECTED] * society and not sufficient moral courage. (work) [EMAIL PROTECTED] -- Mary Baker Eddy, Science and Health http://justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg! pgp0.pgp Description: PGP signature
[PHP] EOR (Was: [PHP] DAMN)
--- Bronislav Klucka [EMAIL PROTECTED] wrote: I've just realized I'm replaying to JeRRy only Could anybody fixt this problem by setting the Reply To header correctly? to be able to reply PHP conf. directly using Reply button?!!! Hi Brona, Not only has this been discussed in great detail, it is also a useless argument. Rasmus has already given the definitive stance. In short, we will not be mangling the Reply-To header in the way you suggest. It violates standards and is just wrong. The Reply-To header is set by the sender, and it is where the sender wants replies to the message sent. If you can't figure out how to use email correctly, ask for help about that (the Reply All button might be worth trying first), but don't suggest breaking things and describing it as fixing something. No amount of arguing is going to change anything. This list is maintained by extremely competent people who are not going to be swayed by uninformed opinions. If you disagree with the way this list is maintained (at least in terms of issues that have obviously been raised before), you should probably find somewhere else to ask questions. Chris = Chris Shiflett - http://shiflett.org/ PHP Security Handbook Coming mid-2004 HTTP Developer's Handbook http://httphandbook.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] speed conection ???
Hi , I need to know the conecction speed of a person who is visiting my site. How can I know his speed? Thaks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
php-general Digest 29 Nov 2003 18:27:30 -0000 Issue 2444
php-general Digest 29 Nov 2003 18:27:30 - Issue 2444 Topics (messages 171340 through 171363): Re: DAMN 171340 by: RT 171343 by: John Nichel 171349 by: Gerard Samuel 171350 by: Bronislav Klucka 171354 by: Gerard Samuel Re: php as cgi script 171341 by: Ivone Uribe Re: help with Log() function 171342 by: Jason Wong Re: Static Array vs MySQL query 171344 by: John Nichel File upload issue 171345 by: Binay 171346 by: Robert Cummings 171347 by: Bronislav Klucka 171348 by: Binay Test 171351 by: César Aracena 171352 by: Eric Problem loading fonts in gd() 171353 by: Eric what's the story with html_entity_decode? 171355 by: Per Jessen Checking if a host is online 171356 by: Jason Giangrande 171357 by: Adam Maas 171358 by: Jason Giangrande 171359 by: Adam Maas 171361 by: David T-G Suggestions for optimization? 171360 by: Galen EOR (Was: [PHP] DAMN) 171362 by: Chris Shiflett speed conection ??? 171363 by: tony 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--- On Fri, 2003-11-28 at 23:55, Bronislav Klucka wrote: I've just realized I'm replaying to JeRRy only Could anybody fixt this problem by setting the Reply To header correctly? to be able to reply PHP conf. directly using Reply button?!!! Brona -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php I believe we just discussed this for the past 2 or 3 daysI have an ingenious idea. Read the mailing lists archive. http://www.phparch.com/mailinglists/msg.php?a=734755s=Reply-to+headerp=0g= Starts at the link above -- I have a photographic memory. I just forgot the film --Unknown = Ryan Thompson [EMAIL PROTECTED] http://osgw.sourceforge.net ---End Message--- ---BeginMessage--- - Edwin - wrote: On 2003/11/29, at 14:17, John Nichel wrote: Bronislav Klucka wrote: I've just realized I'm replaying to JeRRy only Could anybody fixt this problem by setting the Reply To header correctly? to be able to reply PHP conf. directly using Reply button?!!! Brona How many times is someone going to start this flame war this month? Hmm... A *better* question would be How many people does NOT start it? ;) -- - E - Well, I did my part, and stayed out of the first onebut I did bite my tongue quite a bit. ;) -- By-Tor.com It's all about the Rush http://www.by-tor.com ---End Message--- ---BeginMessage--- On Saturday 29 November 2003 12:54 am, Bronislav Klucka wrote: because we know that this bug has easy solution... [jumps in] Yes - X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600. [jumps out] ---End Message--- ---BeginMessage--- what does it mean? -Original Message- From: Gerard Samuel [mailto:[EMAIL PROTECTED] Sent: Saturday, November 29, 2003 8:50 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] DAMN On Saturday 29 November 2003 12:54 am, Bronislav Klucka wrote: because we know that this bug has easy solution... [jumps in] Yes - X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600. [jumps out] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php ---End Message--- ---BeginMessage--- On Saturday 29 November 2003 03:20 am, Bronislav Klucka wrote: what does it mean? I don't want to get into this debate too much, but from what little I read when it was going on earlier this past week, people who seemed to complain the most are the ones using Outlook. Seems like Outlook isn't mailing list friendly. To get more/accurate info, look at the archives from earlier this past week... On Saturday 29 November 2003 12:54 am, Bronislav Klucka wrote: because we know that this bug has easy solution... [jumps in] Yes - X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600. [jumps out] ---End Message--- ---BeginMessage--- Thanks very much to all, Ok, I understand now.. so I need to install php as a cgi oppose to the module apache. Do you have some good page that can help me to configure and compile correctly the php as cgi? Thanks in advance, Kisses, Ivone --- Kelly Hallman [EMAIL PROTECTED] wrote: On Fri, 28 Nov 2003, Nicole Lallande wrote: Ivone -- You are using a PERL invocation for php. PHP scripts begin ?php #! is not a perl invocation, it is a Unix convention to tell the shell which program should be used to process the file
Re: [PHP] Problem loading fonts in gd()
On Saturday 29 November 2003 23:15, Eric wrote: I have a small problem about loading fonts with imageloadfont() I have copyed fonts with the extension .fon or .ttf to the same directory as my script, and i give them the font as an argument: $font = imageloadfont('arial.ttf'); But i just keep getting the message: Warning: imageloadfont(): Error reading font in c:\program files\apache group\apache\htdocs\gd_test.php on line 35 Does anyone know how to properly load fonts into gd, without getting this error message? Try using the full, absolute path to the font. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* There is no such thing as the right feed -- Murphy's Horse Laws n18 */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Checking if a host is online
Jason Giangrande said: command (ping -c 1 $host), and while I could get that to work, since it returns non-zero status if the host can not be contacted, it takes quite a while to execute for even a few hosts at once. fping may help. Running a background job that just monitors ping status and updates a record somewhere is probably the best way. The PHP script needs only read the records to understand the status of the 'world'. As mentioned, this is what big brother does, to a certain extent. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem loading fonts in gd()
Jason Wong [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On Saturday 29 November 2003 23:15, Eric wrote: I have a small problem about loading fonts with imageloadfont() I have copyed fonts with the extension .fon or .ttf to the same directory as my script, and i give them the font as an argument: $font = imageloadfont('arial.ttf'); But i just keep getting the message: Warning: imageloadfont(): Error reading font in c:\program files\apache group\apache\htdocs\gd_test.php on line 35 Does anyone know how to properly load fonts into gd, without getting this error message? Try using the full, absolute path to the font. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* There is no such thing as the right feed -- Murphy's Horse Laws n18 */ I have already tried that: imageloadfont(C:/WINDOWS/Fonts/arial.ttf); i also tried: imageloadfont(C:\\WINDOWS\\Fonts\\arial.ttf); I ALSO tried this: imageloadfont($_SERVER['DOCUMENT_ROOT'].'/gd_test.php'); and that didn't work either So I'm unfortunately still stuck. Eric -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem loading fonts in gd()
On Sunday 30 November 2003 03:59, Eric wrote: I have already tried that: imageloadfont(C:/WINDOWS/Fonts/arial.ttf); i also tried: imageloadfont(C:\\WINDOWS\\Fonts\\arial.ttf); I ALSO tried this: imageloadfont($_SERVER['DOCUMENT_ROOT'].'/gd_test.php'); and that didn't work either So I'm unfortunately still stuck. If you're using TTF fonts then you should be using imagettftext(). -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* Peers's Law: The solution to a problem changes the nature of the problem. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php blog site for 123php.com
Hi, Can anyone recomend a good blog software that does the following: 1. Have differient articles on the first page and show the first x ( or 10) words then a link to the rest eg Php make leaps and bounds in the field of ... click here to read article 2. Users have to register to post replies/comments (or if possible to read the whole article) 3. makes search engine friendly urls eg 123php.com/blog/article777 I have checked hotscripts: http://www.hotscripts.com/cgi-bin/search.cgi?bool=ANDquery=blogcatid=2 and these ones seems a bit good, http://dev2.bblog.com/item/19/ http://www.acervus.ca/ Any URLs/ideas/suggestions etc are most welcome. Thanks, -Ryan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] php blog site for 123php.com
Have a look at http://www.weberblog.com. If the site does what you need, you can follow the powered by link on the bottom of every page. Sincerely berber Visit http://www.weberdev.com/ http://www.weberblog.com/ Today!!! To see where PHP might take you tomorrow. Share your code : http://addexample.weberdev.com Search for PHP Code from your browser http://toolbar.weberdev.com Share your thoughts : http://www.weberblog.com/submit.php?type=story -Original Message- From: Ryan A [mailto:[EMAIL PROTECTED] Sent: Saturday, November 29, 2003 10:19 PM To: [EMAIL PROTECTED] Subject: [PHP] php blog site for 123php.com Hi, Can anyone recomend a good blog software that does the following: 1. Have differient articles on the first page and show the first x ( or 10) words then a link to the rest eg Php make leaps and bounds in the field of ... click here to read article 2. Users have to register to post replies/comments (or if possible to read the whole article) 3. makes search engine friendly urls eg 123php.com/blog/article777 I have checked hotscripts: http://www.hotscripts.com/cgi-bin/search.cgi?bool=ANDquery=blogcatid=2 and these ones seems a bit good, http://dev2.bblog.com/item/19/ http://www.acervus.ca/ Any URLs/ideas/suggestions etc are most welcome. Thanks, -Ryan -- 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] Checking if a host is online
On Sat, 2003-11-29 at 12:32, David T-G wrote: 3) At the very least, cut your ping timeout down to the smallest acceptable; in general, a full second is plenty of time to get nearly anywhere on your continent (ain't it great? :-) and so your intranet should be more than happy with that allowance. HTH HAND :-D Thanks for your help guys. Cutting the ping timeout helped speed things up quite a bit. I will also look into BigBrother and your other suggestions. Thanks again. -- Jason Giangrande [EMAIL PROTECTED] http://www.giangrande.org http://www.dogsiview.com signature.asc Description: This is a digitally signed message part
[PHP] completely stumped by ereg()
Why doesn't this match? var_dump(ereg('C:W', 'C:WINNTTEMP\\tst5B.tmp')); should print int(1), prints bool(false) Thanks, Greg -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] completely stumped by ereg()
You should try var_dump(ereg('C:W', 'C:\\WINNT\\TEMP\tst5B.tmp')); The reason is that in simple quotes, antislashes don't have to be escaped. Still, they need to be escaped in a regular epr ie in the first argument of ereg() (the first and the secon argument are both string, but in the reakity they are not really the same type) Why doesn't this match? var_dump(ereg('C:W', 'C:WINNTTEMP\\tst5B.tmp')); should print int(1), prints bool(false) Thanks, Greg -- 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] Problem in the output of an array
I have this code, I would like, if this could be done ? $array['dim1']['dim2']['dim3'][3] = value; $dim1 = 'dim1'; $dim2 = 'dim2'; $dim3 = 'dim3'; $dim4 = 3; $test = [$dim1][$dim2][$dim3][$dim4]; $result = $array$test; echo $result; ? The output is : Array[dim1][dim2][dim3][3] I need that the output was: value Thanks in advanced for any help.
Re: [PHP] Checking if a host is online
This may be OT but have you looked at Netsaint (http://www.netsaint.org/ and http://www.netsaint.org/indexold.php), now called Nagios (http://www.nagios.org/) by the looks of it. Note: It's not written in PHP from what I remember. You may be able to get some ideas from it or even use it. I've used it in the past to monitor a small web cluster and it worked nicely. Additionally, freshmeat has a bunch of network monitors listed written in PHP. Jason Giangrande wrote: I'm creating an application for an Intranet that, among other things, is supposed to check to see if particular hosts are online, and if so, what their IP address is. Anyone know how I can accomplish this? I tried using exec(host $host); (where $host is the hostname) and while this gets the IP it gets the IP address sometimes even if the host is not active, because a DNS record for the system still exists. I also looked into the gethostbyname() function, but that has similar problems to using the external host command. I also tried to use an external ping command (ping -c 1 $host), and while I could get that to work, since it returns non-zero status if the host can not be contacted, it takes quite a while to execute for even a few hosts at once. Anyone ever do this king=d of thing before or have any suggestions on what might work? -- No, mon, let's go home to Jamaica. I and I been in Babylon too long. -- Homer Simpson -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Problem in the output of an array
I have this code, I would like, if this could be done ? $array['dim1']['dim2']['dim3'][3] = value; $dim1 = 'dim1'; $dim2 = 'dim2'; $dim3 = 'dim3'; $dim4 = 3; $test = [$dim1][$dim2][$dim3][$dim4]; $result = $array$test; echo $result; ? The output is : Array[dim1][dim2][dim3][3] I need that the output was: value Thanks in advanced for any help. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem in the output of an array
I'm soory but your code doesn't make me understand what you want to do... Be more precise, it will help you to get some help I have this code, I would like, if this could be done ? $array['dim1']['dim2']['dim3'][3] = value; $dim1 = 'dim1'; $dim2 = 'dim2'; $dim3 = 'dim3'; $dim4 = 3; $test = [$dim1][$dim2][$dim3][$dim4]; $result = $array$test; echo $result; ? The output is : Array[dim1][dim2][dim3][3] I need that the output was: value Thanks in advanced for any help. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem in the output of an array
now i understand your pb but have no idea to solve it good luck... I'm soory but your code doesn't make me understand what you want to do... Be more precise, it will help you to get some help I have this code, I would like, if this could be done ? $array['dim1']['dim2']['dim3'][3] = value; $dim1 = 'dim1'; $dim2 = 'dim2'; $dim3 = 'dim3'; $dim4 = 3; $test = [$dim1][$dim2][$dim3][$dim4]; $result = $array$test; echo $result; ? The output is : Array[dim1][dim2][dim3][3] I need that the output was: value Thanks in advanced for any help. - This situation above was presented in a class that I have been developing, I want the value of the array, that is value, but the script print Array[dim1][dim2][dim3][3], I don't if there is another way to do that but as the way above, I hope you can understand my problem, thanks for any help :). -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem in the output of an array
On Sat, 2003-11-29 at 19:29, [EMAIL PROTECTED] wrote: I'm soory but your code doesn't make me understand what you want to do... Be more precise, it will help you to get some help I have this code, I would like, if this could be done ? $array['dim1']['dim2']['dim3'][3] = value; $dim1 = 'dim1'; $dim2 = 'dim2'; $dim3 = 'dim3'; $dim4 = 3; $test = [$dim1][$dim2][$dim3][$dim4]; $result = $array$test; echo $result; ? The output is : Array[dim1][dim2][dim3][3] I need that the output was: value $test = $array[$dim1][$dim2][$dim3][$dim4]; or: $test = 'some text '.$array[$dim1][$dim2][$dim3][$dim4].' more text.'; or (untested since I never use this style): $test = some text {$array[$dim1][$dim2][$dim3][$dim4]} more text.; Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Problem in the output of an array
?php $array['dim1']['dim2']['dim3'][3] = value; $dim1 = 'dim1'; $dim2 = 'dim2'; $dim3 = 'dim3'; $dim4 = 3; $result = {$array[$dim1][$dim2][$dim3][$dim4]}; echo $result; ? Regards, Greg -- phpDocumentor http://www.phpdoc.org [EMAIL PROTECTED] wrote: I have this code, I would like, if this could be done ? $array['dim1']['dim2']['dim3'][3] = value; $dim1 = 'dim1'; $dim2 = 'dim2'; $dim3 = 'dim3'; $dim4 = 3; $test = [$dim1][$dim2][$dim3][$dim4]; $result = $array$test; echo $result; ? The output is : Array[dim1][dim2][dim3][3] I need that the output was: value Thanks in advanced for any help. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem in the output of an array
On Sat, 2003-11-29 at 19:47, Robert Cummings wrote: On Sat, 2003-11-29 at 19:29, [EMAIL PROTECTED] wrote: I'm soory but your code doesn't make me understand what you want to do... Be more precise, it will help you to get some help I have this code, I would like, if this could be done ? $array['dim1']['dim2']['dim3'][3] = value; $dim1 = 'dim1'; $dim2 = 'dim2'; $dim3 = 'dim3'; $dim4 = 3; $test = [$dim1][$dim2][$dim3][$dim4]; $result = $array$test; echo $result; ? The output is : Array[dim1][dim2][dim3][3] I need that the output was: value Ignore my last answer, I read your problem wrong. Answer below: ? $array['dim1']['dim2']['dim3'][3] = value; $dim1 = 'dim1'; $dim2 = 'dim2'; $dim3 = 'dim3'; $dim4 = 3; $test = '[$dim1][$dim2][$dim3][$dim4]'; $result = eval( 'return $array'.$test.';' ); echo $result; ? HTH, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Problem in the output of an array
$result = eval( 'return $array'.$test.';' ); Um... echo $array[$dim1][$dim2][$dim3][$dim4]; eval == evil. I can't think of a single legimiate reason why you'd want/need to make a string [$dim1] first, and if you have to I'd suspect that something is very wrong with the way you are writing your script. Feel free to prove me wrong, though :) John Robert Cummings writes: On Sat, 2003-11-29 at 19:47, Robert Cummings wrote: On Sat, 2003-11-29 at 19:29, [EMAIL PROTECTED] wrote: I'm soory but your code doesn't make me understand what you want to do... Be more precise, it will help you to get some help I have this code, I would like, if this could be done ? $array['dim1']['dim2']['dim3'][3] = value; $dim1 = 'dim1'; $dim2 = 'dim2'; $dim3 = 'dim3'; $dim4 = 3; $test = [$dim1][$dim2][$dim3][$dim4]; $result = $array$test; echo $result; ? The output is : Array[dim1][dim2][dim3][3] I need that the output was: value Ignore my last answer, I read your problem wrong. Answer below: ? $array['dim1']['dim2']['dim3'][3] = value; $dim1 = 'dim1'; $dim2 = 'dim2'; $dim3 = 'dim3'; $dim4 = 3; $test = '[$dim1][$dim2][$dim3][$dim4]'; $result = eval( 'return $array'.$test.';' ); echo $result; ? HTH, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- 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] move_uploaded_file, umask, and permissions
Hi, all -- I have set my umask to 117 (and I change it when making a directory) and I use move_uploaded_file to handle submitted files. The temporary file is mode 600 when it lands in /var/tmp but somehow gets changed to 666 during the move. It seems that move_uploaded_file changes the file perms and yet does not honor the umask. Must I really run chmod() on every move_uploaded_file() I process? Isn't there a better way? TIA HAND :-D -- David T-G * There is too much animal courage in (play) [EMAIL PROTECTED] * society and not sufficient moral courage. (work) [EMAIL PROTECTED] -- Mary Baker Eddy, Science and Health http://justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg! pgp0.pgp Description: PGP signature
Re: [PHP] php blog site for 123php.com
Hi, Nope, installed the 26 megs but still its not all that good...at least I couldnt get it to work... one last requirment i forgot to mention was...I need to ask the user if the article was good and to rate it from 1-10 like hotscripts etc Any ideas? All we will have on 123php.com is articles. Thanks, -Ryan - Original Message - From: Boaz Yahav [EMAIL PROTECTED] To: Ryan A [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Saturday, November 29, 2003 10:19 PM Subject: RE: [PHP] php blog site for 123php.com Have a look at http://www.weberblog.com. If the site does what you need, you can follow the powered by link on the bottom of every page. Sincerely berber Visit http://www.weberdev.com/ http://www.weberblog.com/ Today!!! To see where PHP might take you tomorrow. Share your code : http://addexample.weberdev.com Search for PHP Code from your browser http://toolbar.weberdev.com Share your thoughts : http://www.weberblog.com/submit.php?type=story -Original Message- From: Ryan A [mailto:[EMAIL PROTECTED] Sent: Saturday, November 29, 2003 10:19 PM To: [EMAIL PROTECTED] Subject: [PHP] php blog site for 123php.com Hi, Can anyone recomend a good blog software that does the following: 1. Have differient articles on the first page and show the first x ( or 10) words then a link to the rest eg Php make leaps and bounds in the field of ... click here to read article 2. Users have to register to post replies/comments (or if possible to read the whole article) 3. makes search engine friendly urls eg 123php.com/blog/article777 I have checked hotscripts: http://www.hotscripts.com/cgi-bin/search.cgi?bool=ANDquery=blogcatid=2 and these ones seems a bit good, http://dev2.bblog.com/item/19/ http://www.acervus.ca/ Any URLs/ideas/suggestions etc are most welcome. Thanks, -Ryan -- 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] Re: Problem in the output of an array
On Sat, 2003-11-29 at 21:25, john wrote: $result = eval( 'return $array'.$test.';' ); Um... echo $array[$dim1][$dim2][$dim3][$dim4]; eval == evil. I can't think of a single legimiate reason why you'd want/need Eval is not evil, but it is often insecurely used. It has it's purpose otherwise it wouldn't exist. to make a string [$dim1] first, and if you have to I'd suspect that something is very wrong with the way you are writing your script. *shrug* I merely answered what appeared to be the posed problem. I never indicated why one might do what the original poster was doing, nor was it an issue for my answer. That said, there are definitely uses whether you happen to have one handy or not. Feel free to prove me wrong, though :) Different strokes for different folks :) Cheers, Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] entering in text data and losing the \n
I have a form with a text area. When the user submits the data it is saved to a mysql database in a field of type text. When I extract the data from the database and display it in php it loses the line return and the data is all crammed together. Here is an example This is line 1 This is line 2 This is line 3 Here is what it would be after I extracted it and displayed it to the screen This is line 1 This is line 2 This is line 3 What do I need to do to get it to retain the line feeds? Thanks Randy
Re: [PHP] entering in text data and losing the \n
Randy Johnson wrote: I have a form with a text area. When the user submits the data it is saved to a mysql database in a field of type text. When I extract the data from the database and display it in php it loses the line return and the data is all crammed together. Here is an example This is line 1 This is line 2 This is line 3 Here is what it would be after I extracted it and displayed it to the screen This is line 1 This is line 2 This is line 3 Displayed to the screen, as inbrowser window, or terminal? What do I need to do to get it to retain the line feeds? Thanks Randy -- By-Tor.com It's all about the Rush http://www.by-tor.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] entering in text data and losing the \n
--- Randy Johnson [EMAIL PROTECTED] wrote: I have a form with a text area. When the user submits the data it is saved to a mysql database in a field of type text. When I extract the data from the database and display it in php it loses the line return and the data is all crammed together. It doesn't lose it. In HTML, a newline isn't rendered as a newline by a browser unless it is surrounded by pre tags. You probably want to use the br tag instead. PHP has a function to help with this: http://www.php.net/nl2br Hope that helps. Chris = Chris Shiflett - http://shiflett.org/ PHP Security Handbook Coming mid-2004 HTTP Developer's Handbook http://httphandbook.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] entering in text data and losing the \n
Yep that was it. Thank you very much. Randy - Original Message - From: Chris Shiflett [EMAIL PROTECTED] To: Randy Johnson [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Sunday, November 30, 2003 1:17 AM Subject: Re: [PHP] entering in text data and losing the \n --- Randy Johnson [EMAIL PROTECTED] wrote: I have a form with a text area. When the user submits the data it is saved to a mysql database in a field of type text. When I extract the data from the database and display it in php it loses the line return and the data is all crammed together. It doesn't lose it. In HTML, a newline isn't rendered as a newline by a browser unless it is surrounded by pre tags. You probably want to use the br tag instead. PHP has a function to help with this: http://www.php.net/nl2br Hope that helps. Chris = Chris Shiflett - http://shiflett.org/ PHP Security Handbook Coming mid-2004 HTTP Developer's Handbook http://httphandbook.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
php-general Digest 30 Nov 2003 06:29:41 -0000 Issue 2445
php-general Digest 30 Nov 2003 06:29:41 - Issue 2445 Topics (messages 171364 through 171388): Re: Problem loading fonts in gd() 171364 by: Jason Wong 171366 by: Eric 171367 by: Jason Wong Re: Checking if a host is online 171365 by: Duncan 171370 by: Jason Giangrande 171374 by: jacob.keystreams.com php blog site for 123php.com 171368 by: Ryan A 171369 by: Boaz Yahav 171383 by: Ryan A completely stumped by ereg() 171371 by: Greg Beaver 171372 by: sophie.sitadelle.com Problem in the output of an array 171373 by: orlandopozo.icnet.com.ve 171375 by: orlandopozo.icnet.com.ve 171376 by: sophie.sitadelle.com 171377 by: sophie.sitadelle.com 171378 by: Robert Cummings 171379 by: Greg Beaver 171380 by: Robert Cummings 171381 by: john 171384 by: Robert Cummings move_uploaded_file, umask, and permissions 171382 by: David T-G entering in text data and losing the \n 171385 by: Randy Johnson 171386 by: John Nichel 171387 by: Chris Shiflett 171388 by: Randy Johnson 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--- On Saturday 29 November 2003 23:15, Eric wrote: I have a small problem about loading fonts with imageloadfont() I have copyed fonts with the extension .fon or .ttf to the same directory as my script, and i give them the font as an argument: $font = imageloadfont('arial.ttf'); But i just keep getting the message: Warning: imageloadfont(): Error reading font in c:\program files\apache group\apache\htdocs\gd_test.php on line 35 Does anyone know how to properly load fonts into gd, without getting this error message? Try using the full, absolute path to the font. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* There is no such thing as the right feed -- Murphy's Horse Laws n18 */ ---End Message--- ---BeginMessage--- Jason Wong [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] On Saturday 29 November 2003 23:15, Eric wrote: I have a small problem about loading fonts with imageloadfont() I have copyed fonts with the extension .fon or .ttf to the same directory as my script, and i give them the font as an argument: $font = imageloadfont('arial.ttf'); But i just keep getting the message: Warning: imageloadfont(): Error reading font in c:\program files\apache group\apache\htdocs\gd_test.php on line 35 Does anyone know how to properly load fonts into gd, without getting this error message? Try using the full, absolute path to the font. -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* There is no such thing as the right feed -- Murphy's Horse Laws n18 */ I have already tried that: imageloadfont(C:/WINDOWS/Fonts/arial.ttf); i also tried: imageloadfont(C:\\WINDOWS\\Fonts\\arial.ttf); I ALSO tried this: imageloadfont($_SERVER['DOCUMENT_ROOT'].'/gd_test.php'); and that didn't work either So I'm unfortunately still stuck. Eric ---End Message--- ---BeginMessage--- On Sunday 30 November 2003 03:59, Eric wrote: I have already tried that: imageloadfont(C:/WINDOWS/Fonts/arial.ttf); i also tried: imageloadfont(C:\\WINDOWS\\Fonts\\arial.ttf); I ALSO tried this: imageloadfont($_SERVER['DOCUMENT_ROOT'].'/gd_test.php'); and that didn't work either So I'm unfortunately still stuck. If you're using TTF fonts then you should be using imagettftext(). -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* Peers's Law: The solution to a problem changes the nature of the problem. */ ---End Message--- ---BeginMessage--- Jason Giangrande said: command (ping -c 1 $host), and while I could get that to work, since it returns non-zero status if the host can not be contacted, it takes quite a while to execute for even a
RE: [PHP] BUG: require_once() or die(); = fatal error
By default the CLI version turns off the html in the error messages. And no, really, there is no bug here. You are testing the return code of something that doesn't have one. It doesn't make sense. -Rasmus On Fri, 28 Nov 2003, Daevid Vincent wrote: Hmm... Well Rasmus, I do see your point, however it still seems to me it 'should' at least compile and work as I expect it to. My way, the logic is that the file *is* 'required' (whereas I view 'include' files as optional), and I want to exit the program with a graceful message instead of the fatal error (which doesn't really doesn't tell me what the problem is -- Failed opening required '1' doesn't mean anything to me or the user) that is shown. My intent was to put a @require_once() so that I could do just that. Especially since I'm running my script on the command line, and your stock fatal error message uses HTML tags. Not a critical bug or a show stopper, but I do still feel it is a bug. -Original Message- From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 26, 2003 8:55 PM To: Daevid Vincent Cc: [EMAIL PROTECTED] Subject: Re: [PHP] BUG: require_once() or die(); = fatal error This code doesn't make much sense. By definition, if require cannot open a file it throws a fatal error, so you would never hit the or case anyway. Hence there is no return code from require and you can't write code like this. If you want to test the return code you need to use 'include' instead. -Rasmus On Wed, 26 Nov 2003, Daevid Vincent wrote: Using PHP 4.2.2 on Linux RH8: In a PHP script run from command line, require_once(gibberator_data.php) or die(No Data file found\n); Causes: [EMAIL PROTECTED] gibberator]# ./gibberator.php br / bFatal error/b: Failed opening required '1' (include_path='.:/php/includes;/usr/share/phpwebtools') in b/home/gibberator/gibberator.php/b on line b13/bbr / However require_once(gibberator_data.php); Works just fine. -- 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