Re: [PHP] Dettach problem

2006-06-14 Thread grape
Hello, Jochem Maas skrev: pure guess work coming up... grape wrote: Hi all, I would like run a php-script via CLI which outputs some information to stdout, and then go into background. I use code similar to this to fork and to dettach the child I/O from the TTY (some error handling remove

Re: [PHP] Dettach problem

2006-06-14 Thread Jochem Maas
grape wrote: > Hello, > ... >> >> > I get the same result. > In fact, I tried a *lot* of variations of this code without success. good man, sorry to hear your not finding the problem - seems to look more like a bug - maybe post some more detailed code? (or does the problem occur with the actu

Re: [PHP] Dettach problem

2006-06-14 Thread grape
Hello Richard, Richard Lynch skrev: This seems to me like a cogent bug report... http://bugs.php.net/ Yup, I'll report it if we cannot find a explaination in a couple of days. But what does the posix_setsid() bit do? Seems like you could take that out too, no?... Or does that "promote"

Re: [PHP] php->html "rendering"

2006-06-14 Thread Jochem Maas
Richard Lynch wrote: > On Mon, June 12, 2006 4:49 pm, Jochem Maas wrote: >> Ryan A wrote: >>> Thanks for the suggestion, I am not too familier with >>> wget but (correct me if i am wrong) wont wget just get >>> the output from the pages ignoreing the links? >> that's the default behaviour - but wge

[PHP] Problem with the passthru function

2006-06-14 Thread Venkatesh Babu
Hello All, I have a small php file (test.php) whose code is shown below: This test.php works fine when I execute from command prompt as "php test.php", but when I access it through web browser, it seems not to be working fine, I get an exit status of 127 (which means command not found). I check

Re: [PHP] PHP6 build help

2006-06-14 Thread Rabin Vincent
On 6/14/06, Rory Browne <[EMAIL PROTECTED]> wrote: Only if (s)he''s on a debian based linux distro. I see from his configure output, that he's on Linux, but what makes you think he's on Debian ( or on a system with apt-rpm ) ? The first line of Ligaya's email said: "Ubuntu Breezy Badger, AMD

Re: [PHP] Dettach problem

2006-06-14 Thread Jochem Maas
grape wrote: > Hello Richard, > > Richard Lynch skrev: > >> >> This seems to me like a cogent bug report... >> http://bugs.php.net/ >> >> > Yup, I'll report it if we cannot find a explaination in a couple of days. as a last resort you might as on internals@lists.php.net as to whether anyone th

Re: [PHP] Problem with the passthru function

2006-06-14 Thread Rabin Vincent
On 6/14/06, Venkatesh Babu <[EMAIL PROTECTED]> wrote: I have a small php file (test.php) whose code is shown below: This test.php works fine when I execute from command prompt as "php test.php", but when I access it through web browser, it seems not to be working fine, I get an exit status of

Re: [PHP] Problem with the passthru function

2006-06-14 Thread Venkatesh Babu
Hi, Thanks for your response safe_mode is Off but still I'm getting this problem. Thank you, Venkatesh --- Rabin Vincent <[EMAIL PROTECTED]> wrote: > On 6/14/06, Venkatesh Babu <[EMAIL PROTECTED]> > wrote: > > I have a small php file (test.php) whose code is > shown > > below: > > > > >

Re: [PHP] preg_replace \\1 yIKES!

2006-06-14 Thread sam
On Jun 13, 2006, at 1:58 PM, tedd wrote: At 11:33 AM -0700 6/13/06, sam wrote: Wow this is hard I can't wait till I get the hang of it. Capitalize the first letter of a word. Try: This blows my mind. What should one think, "everything is an array"? Well, okay not every but everything

Re: [PHP] preg_replace \\1 yIKES!

2006-06-14 Thread Jochem Maas
sam wrote: > > On Jun 13, 2006, at 1:58 PM, tedd wrote: > >> At 11:33 AM -0700 6/13/06, sam wrote: >>> Wow this is hard I can't wait till I get the hang of it. >>> >>> Capitalize the first letter of a word. >> >> Try: >> >> > $word = "yikes"; >> $word[0]=strtoupper($word[0]); >> echo($word); >> ?

Re: [PHP] Dettach problem

2006-06-14 Thread grape
Hi, Jochem Maas skrev: as a last resort you might as on internals@lists.php.net as to whether anyone there considers this a possible bug. I'll do that. Jochem, Richard - thank you for your input. /Grape -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.

Re: [PHP] preg_replace \\1 yIKES!

2006-06-14 Thread Stut
Jochem Maas wrote: I did berate the fact that you waited no more than 7 minutes before sending a 'help me' reminder regarding your original post. While I agree with most of what you are saying, you may want to check that email again. Sams 'for Eyes burning...' email was in response to someo

Re: [PHP] preg_replace \\1 yIKES!

2006-06-14 Thread sam
And hey yo, Jochem, I did RTFM, for hours, I always do before I post to the list. I just I'd tell you to RTFM (although I did tell you to read the manual regarding the specifics of using preg_replace()'s 'e' modifier after showing you a working example of how to use it, based on your ori

[PHP] references for beginner...

2006-06-14 Thread BBC
Hii all I just joined this forum, I'm beginner of PHP programming. I didn't understand almost all the syntax you're talking about (ups too honest, right?), so please... Does anyone have a kinds of references like soft books or something, which talk about all the syntax, and what for are they

Re: [PHP] references for beginner...

2006-06-14 Thread nicolas figaro
BBC a écrit : Hii all I just joined this forum, I'm beginner of PHP programming. welcome. I didn't understand almost all the syntax you're talking about (ups too honest, right?), so please... Does anyone have a kinds of references like soft books or something, which talk about all the synt

Re: [PHP] preg_replace \\1 yIKES!

2006-06-14 Thread Jochem Maas
Stut wrote: > Jochem Maas wrote: >> I did berate the fact that you waited no more than 7 minutes before >> sending a 'help me' reminder regarding your original post. > > While I agree with most of what you are saying, you may want to check > that email again. Sams 'for Eyes burning...' email was

RE: [PHP] Re: Setting headers for file download

2006-06-14 Thread Peter Lauri
I got it working on one server, but not the real server. I just took your code and voila it was working (with some modifications). It works on: Localhost Windows Plesk Server running Plesk 7.5 Not working on: Plesk Server running Plesk 7.0 Then the questions is: Where should I start to search in

[PHP] Re: Setting headers for file download

2006-06-14 Thread Barry
Peter Lauri schrieb: Best group member, This is how I try to push files to download using headers: header("Content-type: $file_type"); header("Content-Disposition: attachment; filename=$filename"); print $file; It works fine in FireFox, but not that good in IE. I have been googled to find th

RE: [PHP] Re: Setting headers for file download

2006-06-14 Thread Peter Lauri
That did it, thanks... Ok, my knowledge about HTTP is not the best. But how can you send three different content-type headers? :) -Original Message- From: Barry [mailto:[EMAIL PROTECTED] Sent: Wednesday, June 14, 2006 8:36 PM To: php-general@lists.php.net Subject: [PHP] Re: Setting head

Re: [PHP] Re: Setting headers for file download

2006-06-14 Thread Barry
Peter Lauri schrieb: That did it, thanks... Ok, my knowledge about HTTP is not the best. But how can you send three different content-type headers? :) There are not so different at all. Just giving the browser the job to download that thing. Every browser likes to interpret every content-typ

Re: [PHP] preg_replace \\1 yIKES!

2006-06-14 Thread tedd
At 3:45 AM -0700 6/14/06, sam wrote: >On Jun 13, 2006, at 1:58 PM, tedd wrote: > >>At 11:33 AM -0700 6/13/06, sam wrote: >>>Wow this is hard I can't wait till I get the hang of it. >>> >>>Capitalize the first letter of a word. >> >>Try: >> >>>$word = "yikes"; >>$word[0]=strtoupper($word[0]); >>echo

Re: [PHP] Re: Setting headers for file download [medium]

2006-06-14 Thread Rafael
Barry wrote: Peter Lauri schrieb: Ok, my knowledge about HTTP is not the best. But how can you send three different content-type headers? :) There are not so different at all. Just giving the browser the job to download that thing. Every browser likes to interpret every content-type like he w

Re: [PHP] references for beginner...

2006-06-14 Thread tedd
At 5:16 AM -0700 6/14/06, BBC wrote: >Hii all >I just joined this forum, I'm beginner of PHP programming. >I didn't understand almost all the syntax you're talking about (ups too >honest, right?), so please... >Does anyone have a kinds of references like soft books or something, which >talk a

Re: [PHP] PHP6 build help

2006-06-14 Thread Rory Browne
/me goes and bangs head against wall. On 6/14/06, Rabin Vincent <[EMAIL PROTECTED]> wrote: On 6/14/06, Rory Browne <[EMAIL PROTECTED]> wrote: > Only if (s)he''s on a debian based linux distro. > > I see from his configure output, that he's on Linux, but what makes you > think he's on Debian (

Re: [PHP] Seeking recommendations for use of include()

2006-06-14 Thread Dave M G
Larry, Thank you for responding. $untrusted_var = '../../../../../../../etc/passwd'; include($untrusted_var); Or in later versions of PHP, I *think* the following may even work: $untrusted_var = 'http://evilsite.com/pub/evil.php'; include($untrusted_var); I'm still not sure I see the danger

[PHP] Simple class declaration returns error

2006-06-14 Thread Dave M G
PHP List, I am in the preliminary stages of designing my first object oriented PHP based web site. I've created file called "article.class" and included it in my index.php file. I put in a very simple echo statement, just as a place marker before I put in the real code, and just to make sure

Re: [PHP] Simple class declaration returns error

2006-06-14 Thread Brad Bonkoski
What version of PHP are you using? I suspect something less then 5.0 which means the public/private declarations are not supported... (So remove 'public' and see if it works) -Brad Dave M G wrote: PHP List, I am in the preliminary stages of designing my first object oriented PHP based web s

[PHP] Calculating difference between two days

2006-06-14 Thread afan
Hi, I need to calculate no. of days between two dates, actually between date stored in DB and today's date. Does anybody has an example I can use? I found an example on http://www.developertutorials.com/tutorials/php/calculating-difference-between-dates-php-051018/page1.html but function gregori

Re: [PHP] Calculating difference between two days

2006-06-14 Thread Brad Bonkoski
You could just parse the dates out and feed them to mktime(), subtract the difference between the two (in seconds) and use that to determin the number of days... Something like: [EMAIL PROTECTED] wrote: Hi, I need to calculate no. of days between two dates, actually between date stored in

Re: [PHP] Calculating difference between two days

2006-06-14 Thread D. Dante Lorenso
[EMAIL PROTECTED] wrote: I need to calculate no. of days between two dates, actually between date stored in DB and today's date. Does anybody has an example I can use? Your database will have this function. In PostgreSQL: SELECT data_column - NOW() AS date_diff; There are similar funct

Re: [PHP] Simple class declaration returns error

2006-06-14 Thread Dave M G
Brad, What version of PHP are you using? I suspect something less then 5.0 which means the public/private declarations are not supported... (So remove 'public' and see if it works) Yes, it turns out that I am using PHP 4, and I thought I was using 5. Thank you for pointing it out. Now I ha

Re: [PHP] references for beginner...

2006-06-14 Thread BBC
Thank Mr.Figaro. - Original Message - From: "nicolas figaro" <[EMAIL PROTECTED]> To: Sent: Wednesday, June 14, 2006 5:21 AM Subject: Re: [PHP] references for beginner... BBC a écrit : Hii all I just joined this forum, I'm beginner of PHP programming. welcome. I didn't unde

[PHP] Using PHP/HTML effectivly

2006-06-14 Thread Alex Major
Hi List, I've been (very slowly) working my way through some basic php, and putting it into my html site. However recently (after trying things out such as cookies or redirects where they have to be set before any page output) I've found that the combination or certainly the way that I'm using

RE: [PHP] references for beginner...

2006-06-14 Thread Jay Blanchard
[snip] I just joined this forum [/snip] Some must read info; http://zirzow.dyndns.org/php-general/NEWBIE http://www.php.net/manual/en/security.php http://phpsec.org/ http://www.hardened-php.net/advisories.15.html http://phpsec.org/projects/guide/ -- PHP General Mailing List (http://www.php.n

Re: [PHP] Using PHP/HTML effectivly

2006-06-14 Thread tg-php
I'm guessing that phpBB is doing things the "right way".. that is, separating presentation and logic. In cases like that, you have your PHP code and your HTML in separate files with as little 'logic' in the HTML as possible. I'm kind of oversimplifying the explaination and I'm sure there are "m

Re: [PHP] Calculating difference between two days

2006-06-14 Thread tg-php
Shouldn't be too difficult in PHP. \n"; echo "Minutes difference: $minutesdiff\n"; echo "Hours difference: $hoursdiff\n"; echo "Days difference: $daysdiff\n"; ?> And if you want a larger example to play with, here's something I did a couple years ago (forgive the word wrapping and any unr

[PHP] declaring a class as stdClass?

2006-06-14 Thread Mariano Guadagnini
Hi list, I hace an existencial doubt: i've seem many scripts declaring classes as stdClass. In the documentation (for PHP5 and also for 4), it says that this class is internal of php, and should't be used. By the manner I saw it's being used, i guess that it can be handy to create a 'generic' o

[PHP] Checking for empty()

2006-06-14 Thread Ashley M. Kirchner
I have a form with various fields on it that I want to make sure aren't empty or the user didn't just hit the space bar or return (in a text field). What's the best way to do this? Seems empty() will fail on a textarea if the user simply hits a space or return and submits the form. --

Re: [PHP] Checking for empty()

2006-06-14 Thread Brad Bonkoski
Weel, since this is a PHP list I will assume you are checking once the page is posted/submitted... off the top of my head, the functions strlen() and isset() come to mind. -Brad Ashley M. Kirchner wrote: I have a form with various fields on it that I want to make sure aren't empty or the

Re: [PHP] Checking for empty()

2006-06-14 Thread Ashley M. Kirchner
Brad Bonkoski wrote: Weel, since this is a PHP list I will assume you are checking once the page is posted/submitted... That would be correct. At the moment I'm checking with if (empty($_POST['var'])) { throw error flag } But as I read up on empty() I realized that if one simply hi

Re: [PHP] Simple class declaration returns error

2006-06-14 Thread Jochem Maas
Dave M G wrote: > Brad, >> What version of PHP are you using? >> I suspect something less then 5.0 which means the public/private >> declarations are not supported... >> (So remove 'public' and see if it works) > > Yes, it turns out that I am using PHP 4, and I thought I was using 5. > Thank you f

Re: [PHP] Checking for empty()

2006-06-14 Thread D. Dante Lorenso
Ashley M. Kirchner wrote: I have a form with various fields on it that I want to make sure aren't empty or the user didn't just hit the space bar or return (in a text field). What's the best way to do this? Seems empty() will fail on a textarea if the user simply hits a space or return and su

Re: [PHP] Checking for empty()

2006-06-14 Thread Stut
Ashley M. Kirchner wrote: I have a form with various fields on it that I want to make sure aren't empty or the user didn't just hit the space bar or return (in a text field). What's the best way to do this? Seems empty() will fail on a textarea if the user simply hits a space or return and

Re: [PHP] declaring a class as stdClass?

2006-06-14 Thread D. Dante Lorenso
Mariano Guadagnini wrote: Hi list, I hace an existencial doubt: i've seem many scripts declaring classes as stdClass. In the documentation (for PHP5 and also for 4), it says that this class is internal of php, and should't be used. By the manner I saw it's being used, i guess that it can be ha

Re: [PHP] Checking for empty()

2006-06-14 Thread Jochem Maas
Ashley M. Kirchner wrote: > >I have a form with various fields on it that I want to make sure > aren't empty or the user didn't just hit the space bar or return (in a > text field). What's the best way to do this? Seems empty() will fail > on a textarea if the user simply hits a space or ret

Re: [PHP] Seeking recommendations for use of include()

2006-06-14 Thread Jochem Maas
Dave M G wrote: > Larry, > > Thank you for responding. >> >> $untrusted_var = '../../../../../../../etc/passwd'; >> include($untrusted_var); >> >> Or in later versions of PHP, I *think* the following may even work: >> >> $untrusted_var = 'http://evilsite.com/pub/evil.php'; >> include($untrusted_va

Re: [PHP] Using PHP/HTML effectivly

2006-06-14 Thread Jon Anderson
This is my opinion on the matter... From experience, I would say that mixing PHP and HTML together in a complicated page can often get very ugly. I prefer to separate out presentation and code into separate layers as much as possible. I have most often used template systems such as Smarty (sm

Re: [PHP] Calculating difference between two days

2006-06-14 Thread afan
Thanks for all your, very usefull examples. -afan > Shouldn't be too difficult in PHP. > >$yesterday = date("m/d/y", mktime(0,0,0,date("m"), date("d") - 1, > date("y"))); > $today = date("m/d/y"); > > $secondsdiff = strtotime($today) - strtotime($yesterday); > $minutesdiff = $secondsd

[PHP] order of include on include()

2006-06-14 Thread blackwater dev
If I have a file: /code/folder1/test.php and in that file, it has these includes: include_once("../../file1.php"); include_once("../../file2.php"); include_once("../../file3.php"); I then have another file: /code/test2.php That file pulls in test.php. include_once("folder1/test.php"); Why

RE: [PHP] order of include on include()

2006-06-14 Thread Jay Blanchard
[snip] Why do I get errors on the includes? [/snip] Includes are included in the order of their inclusion. If an include includes a child function (such as a class declaration) its parent must be included first. What error did you get? My bet is it is a path issue. -- PHP General Mailing List

Re: [PHP] Using PHP/HTML effectivly

2006-06-14 Thread BBC
I used many functions as template to change the html syntax. this is one of the function as a sample: function tabletag($border="0",$width="100%",$height="100%",$cellpadding = "0",$cellspacing="0",$style="") { print ("cellspacing=\"$cellspacing\" cellpadding=\"$cellpadding\" style=\"$style\">"

[PHP] Re: [PHP-WIN] Re: Executing External Application

2006-06-14 Thread Stut
Please include the list when replying. [EMAIL PROTECTED] wrote: Stut wrote: Eww!! Eww!! and thrice EWW!! There is *never*, and I mean *never* an acceptable reason to run a GUI app in response to a web request - even on an Intranet. *NEVER* IMMHO Bah. Pure ignorance. Here's one reas

Re: [PHP] Re: [PHP-WIN] Re: Executing External Application

2006-06-14 Thread Stut
Oops, wrong list, sorry guys. Stut wrote: Please include the list when replying. [EMAIL PROTECTED] wrote: Stut wrote: Eww!! Eww!! and thrice EWW!! There is *never*, and I mean *never* an acceptable reason to run a GUI app in response to a web request - even on an Intranet. *NEVER* IMM

Re: [PHP] Using PHP/HTML effectivly

2006-06-14 Thread Alex Major
Thankyou everyone who responded to my original message. All of your ideas have showed me the various ways of doing it, however I believe that the idea from Jons message is best suited to my needs. I realise the logic behind it, its put together some knowledge I have already so I think I'll use it f

Re: [PHP] Re: [PHP-WIN] Re: Executing External Application

2006-06-14 Thread Jochem Maas
Stut wrote: > Oops, wrong list, sorry guys. no worries - made me laugh anyway :-) but one worries about the one you were trying to help: cron to run apache to run php to run a gui app. are the loons running the nut house after all? > > Stut wrote: >> Please include the list when reply

Re: [PHP] Re: [PHP-WIN] Re: Executing External Application

2006-06-14 Thread Stut
Jochem Maas wrote: Stut wrote: Oops, wrong list, sorry guys. no worries - made me laugh anyway :-) but one worries about the one you were trying to help: cron to run apache to run php to run a gui app. are the loons running the nut house after all? Well, it was on the PHP-Windows

[PHP] can I do this: update table while selecting data from table?

2006-06-14 Thread afan
Am I allowde to do this: $query = mysql_query("SELECT member_id, member_name FROM members"); while($result = mysql_fetch_array($query)) { if(empty($result['member_name'])) { mysql_query("UPDATE members SET member_name = 'N/A' WHERE member_id = ".$result['member_id'].""); } } As far as I

[PHP] Production release of 4.4.3 soon?

2006-06-14 Thread Paul Ellis
Greetings - Is there any further word on the production release of PHP 4.4.3? Last I heard, (May 22nd) Derick Rethans had kindly put an RC (4.4.3RC1) out at http://downloads.php.net/derick/ and mentioned May 30th as possible date for production release. I haven't seen anything since that time,

[PHP] Re: can I do this: update table while selecting data from table?

2006-06-14 Thread Rafael
As far as *I* know, yes, the SELECT statement is excuted at that particular moment, and any further execution will be independant of your initial (SELECT) query. Was there any problem? [EMAIL PROTECTED] wrote: Am I allowde to do this: $query = mysql_query("SELECT member_id, member_name FROM

Re: [PHP] can I do this: update table while selecting data from table?

2006-06-14 Thread Jochem Maas
[EMAIL PROTECTED] wrote: > Am I allowde to do this: > > $query = mysql_query("SELECT member_id, member_name FROM members"); > while($result = mysql_fetch_array($query)) > { > if(empty($result['member_name'])) > { > mysql_query("UPDATE members SET member_name = 'N/A' WHERE member_id = > ".$

Re: [PHP] can I do this: update table while selecting data from table?

2006-06-14 Thread Satyam
It looks very much as if you did: update members set member_name = 'N/A' where member_name = null Nevertheless, I would rather keep null within the database and use 'N/A' at the presentation level. My rule is that the data in the database should be in a machine oriented format. For exampl

Re: [PHP] Re: [PHP-WIN] Re: Executing External Application

2006-06-14 Thread tedd
At 10:23 PM +0100 6/14/06, Stut wrote: >Jochem Maas wrote: >>Stut wrote: >>>Oops, wrong list, sorry guys. >> >>no worries - made me laugh anyway :-) >> >>but one worries about the one you were trying to help: >> >> cron to run apache to run php to run a gui app. >> >>are the loons running the

Re: [PHP] Using PHP/HTML effectivly

2006-06-14 Thread tedd
At 1:28 PM -0700 6/14/06, BBC wrote: >I used many functions as template to change the html syntax. >this is one of the function as a sample: >function tabletag($border="0",$width="100%",$height="100%",$cellpadding = >"0",$cellspacing="0",$style="") >{ > print (" cellspacing=\"$cellspacing\" cellpa

Re: [PHP] can I do this: update table while selecting data from table?

2006-06-14 Thread afan
?!?!?!?!?!?! > [EMAIL PROTECTED] wrote: >> Am I allowde to do this: >> >> $query = mysql_query("SELECT member_id, member_name FROM members"); >> while($result = mysql_fetch_array($query)) >> { >> if(empty($result['member_name'])) >> { >> mysql_query("UPDATE members SET member_name = 'N/A

Re: [PHP] can I do this: update table while selecting data from table?

2006-06-14 Thread afan
No, that was just an exapmle to explain better. Of course this is not the REAL code. :) And there are some more thing to do inside while loop. Thanks. -afan > It looks very much as if you did: > > update members set member_name = 'N/A' where member_name = null > > Nevertheless, I would rather k

Re: [PHP] declaring a class as stdClass?

2006-06-14 Thread Larry Garfield
To answer both of you: $var = new stdClass(); is perfectly acceptable. I do it all the time. The caveat is that the behavior is slightly different in PHP 4 than PHP 5. In PHP 4, $var would behave exactly like an associative array, just with different funky characters to access its properties

Re: [PHP] Seeking recommendations for use of include()

2006-06-14 Thread Dave M G
Jochem, ::index.php Wouldn't strip_tags() eliminate the tags that make this possible? -- Dave M G -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Simulating a POST

2006-06-14 Thread Man-wai Chang
I hit the script by http://server/netgeo.post.php?ip=192.168.1.1 But the script entered an endless loop. What's wrong? -- .~. Might, Courage, Vision, SINCERITY. http://www.linux-sxs.org / v \ Simplicity is Beauty! May the Force and Farce be with you! /( _ )\ (Ubuntu 6.06) Linux 2.6.16.20

[PHP] Simulating a POST

2006-06-14 Thread Man-wai Chang
I hit the script by http://server/haha.php?ip=192.168.1.1 But the script entered an endless loop. What's wrong? -- .~. Might, Courage, Vision, SINCERITY. http://www.linux-sxs.org / v \ Simplicity is Beauty! May the Force and Farce be with you! /( _ )\ (Ubuntu 6.06) Linux 2.6.16.20 ^ ^

[PHP] Upgrade to PHP5 on Fedora Core

2006-06-14 Thread Dave M G
PHP List, My hosting service allows me enough access to do things like handle my own upgrades and full administrative access. Usually, because I am more of a web designer than an server administrator, I get their support staff to manage upgrades and installations. However, that does cost mon

[PHP] mysql + PHP

2006-06-14 Thread weetat
Hi all, I have SQL query , for example , Select country , name from tbl_chassis order by country. The problem of the sql statement is that , if there are empty value in country field , it be sorted first . How to do sorting the empty value last ? I can cp() function to do this ? or any m

Re: [PHP] order of include on include()

2006-06-14 Thread Richard Lynch
On Wed, June 14, 2006 3:23 pm, blackwater dev wrote: > If I have a file: > > /code/folder1/test.php > > and in that file, it has these includes: > > include_once("../../file1.php"); > include_once("../../file2.php"); > include_once("../../file3.php"); ../ is just gonna give you headaches, sooner o

[PHP] Re: Simulating a POST

2006-06-14 Thread David Dorward
Man-wai Chang wrote: > I hit the script by http://server/netgeo.post.php?ip=192.168.1.1 > > But the script entered an endless loop. What's wrong? Either there is a bug in the script, or you put in unexpected data, or both. (Since "server" isn't a host we can access, and since you haven't shown u

Re: [PHP] can I do this: update table while selecting data from table?

2006-06-14 Thread Jochem Maas
[EMAIL PROTECTED] wrote: > ?!?!?!?!?!?! I hope youi used str_repeat() to generate that. >> >> seriously though, have you tried it? >> >> that said your [probably] better off just doing 1 query: >> >> UPDATE members SET member_name = 'N/A' WHERE member_name = ''; >> >> that said your [probabl

Re: [PHP] Checking for empty()

2006-06-14 Thread Richard Lynch
If you just want to disallow strings of only whitespace, http://php.net/trim them first. The ideal sanitization, however, lists all the characters you DO want to allow, rather than attempting (and probably failing) to try to consider all the ways a user might (intentionally or not) screw up. $CLE

Re: [PHP] declaring a class as stdClass?

2006-06-14 Thread Richard Lynch
On Wed, June 14, 2006 1:08 pm, Mariano Guadagnini wrote: > I hace an existencial doubt: i've seem many scripts declaring classes > as > stdClass. In the documentation (for PHP5 and also for 4), it says that > this class is internal of php, and should't be used. By the manner I > saw > it's being us

Re: [PHP] mysql + PHP

2006-06-14 Thread Satyam
perhaps this will work: Select country , name from tbl_chassis order by ifnull(country,'') didn't try it. - Original Message - From: "weetat" <[EMAIL PROTECTED]> To: Sent: Thursday, June 15, 2006 8:14 AM Subject: [PHP] mysql + PHP Hi all, I have SQL query , for example , S

Re: [PHP] declaring a class as stdClass?

2006-06-14 Thread Richard Lynch
On Wed, June 14, 2006 1:26 pm, D. Dante Lorenso wrote: > Mariano Guadagnini wrote: >> Hi list, >> I hace an existencial doubt: i've seem many scripts declaring >> classes >> as stdClass. In the documentation (for PHP5 and also for 4), it says >> that this class is internal of php, and should't be u

Re: [PHP] Using PHP/HTML effectivly

2006-06-14 Thread Richard Lynch
On Wed, June 14, 2006 12:37 pm, Alex Major wrote: > I've been (very slowly) working my way through some basic php, and > putting it into my html site. However recently (after trying things > out such > as cookies or redirects where they have to be set before any page > output) > I've found that

Re: [PHP] mysql + PHP

2006-06-14 Thread weetat
hi , not working . The empty value still sorted first. Thanks. Satyam wrote: perhaps this will work: Select country , name from tbl_chassis order by ifnull(country,'') didn't try it. - Original Message - From: "weetat" <[EMAIL PROTECTED]> To: Sent: Thursday, June 15, 2006 8:14

Re: [PHP] Calculating difference between two days

2006-06-14 Thread Richard Lynch
On Wed, June 14, 2006 11:45 am, [EMAIL PROTECTED] wrote: > I need to calculate no. of days between two dates, actually between > date > stored in DB and today's date. Almost for sure your best answer is actually in your SQL engine with something like date_subtract in MySQL. PHP's date functions a