[PHP] mysql + PHP

2006-06-15 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

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

2006-06-15 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 or later. Just

[PHP] Re: Simulating a POST

2006-06-15 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 us

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

2006-06-15 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 [probably] better off

Re: [PHP] Checking for empty()

2006-06-15 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.

Re: [PHP] declaring a class as stdClass?

2006-06-15 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 used, i

Re: [PHP] mysql + PHP

2006-06-15 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: php-general@lists.php.net Sent: Thursday, June 15, 2006 8:14 AM Subject: [PHP] mysql + PHP Hi all, I have SQL

Re: [PHP] declaring a class as stdClass?

2006-06-15 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 used. By

Re: [PHP] Using PHP/HTML effectivly

2006-06-15 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 the

Re: [PHP] mysql + PHP

2006-06-15 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: php-general@lists.php.net Sent:

Re: [PHP] Calculating difference between two days

2006-06-15 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

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

2006-06-15 Thread Larry Garfield
On Wednesday 14 June 2006 21:48, Dave M G wrote: Jochem, ::index.php ?php include $_GET['page']; ? Wouldn't strip_tags() eliminate the ?php ? tags that make this possible? No, because that's not what the hole is. YOUR CODE is include $_GET['page']. That's an easily exploitable

Re: [PHP] transfer file

2006-06-15 Thread Richard Lynch
On Tue, June 13, 2006 9:55 pm, kristianto adi widiatmoko wrote: $remote = fopen(http://B/file.txt,w+); HTTP just plain ain't gonna let you open a file up for writing -- thank god. Can you imagine the number of websites that would get hacked? [shudder] But if you have FTP access to B, you can

Re: [PHP] mysql + PHP

2006-06-15 Thread Satyam
Actually, does the country field contains null or an empty string? If it is an empty string this will nor work. Try Control Flow Functions: http://dev.mysql.com/doc/refman/5.0/en/control-flow-functions.html Satyam - Original Message - From: weetat [EMAIL PROTECTED] To:

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

2006-06-15 Thread Richard Lynch
On Tue, June 13, 2006 9:17 pm, Dave M G wrote: Richard Lynch wrote: The problem with making it dynamic, is that you've just made it AWFULLY easy for some Bad Guy to inject their own PHP file into your system... Think about that for awhile. I have thought about it, and I can only see it as

Re: [PHP] mysql + PHP

2006-06-15 Thread Martin Alterisio
2006/6/15, weetat [EMAIL PROTECTED]: 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

Re: [PHP] Upgrade to PHP5 on Fedora Core

2006-06-15 Thread nicolas figaro
Dave M G a écrit : 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.

[PHP] Re: Simulating a POST

2006-06-15 Thread Barry
Man-wai Chang schrieb: I hit the script by http://server/haha.php?ip=192.168.1.1 But the script entered an endless loop. What's wrong? htmlhead/head body onload=document.myform.submit() This is causing the

Re: [PHP] Using PHP/HTML effectivly

2006-06-15 Thread Larry Garfield
On Thursday 15 June 2006 01:50, Richard Lynch wrote: I can guarantee that somebody on this list is going to be agahst at this recommendation of such a crude solution -- But it has served me well for a decade for SIMPLE WEB APPLICATIONS and is much less effort and more maintainable simply by

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

2006-06-15 Thread Richard Lynch
No. He's saying YOUR code is, more or less, not unlike: ?php include $_GET['page']; ? Maybe it's more like this: ?php include $page; ? Well, if at some point, you forget to initialize $page, AND IF you have register_globals on, for some reason, perhaps even because you later install some

Re: [PHP] Simple class declaration returns error

2006-06-15 Thread Jochem Maas
Dave M G wrote: PHP List, Okay, I've upgraded to php 5 on my home machine, and I'm still getting what version? some syntax errors. Parse error: syntax error, unexpected T_NEW in /home/dave/web_sites/thinkingworks.com/web/database.class on line 5 This is the code producing the error:

Re: [PHP] Simple class declaration returns error

2006-06-15 Thread Dave M G
PHP List, Okay, I've upgraded to php 5 on my home machine, and I'm still getting some syntax errors. Parse error: syntax error, unexpected T_NEW in /home/dave/web_sites/thinkingworks.com/web/database.class on line 5 This is the code producing the error: class database { public static

[PHP] File Download Headers

2006-06-15 Thread Richard Lynch
Can any experts on this list explain to me why, despite the 1,000,000 places that application/octet-stream is documented to work, and has always worked, since Mosaic 1.0 days, people manage to find these goofball Content-type: headers that are supposed to work, but only work in a handful of

Re: [PHP] Problem with the passthru function

2006-06-15 Thread Richard Lynch
On Wed, June 14, 2006 4:51 am, Venkatesh Babu wrote: I have a small php file (test.php) whose code is shown below: ?php $retval=1; $command='/bin/ls'; passthru($command, $retval); print(Exit status: . $retval); ? This test.php works fine when I execute from command

Re: [PHP] mysql + PHP

2006-06-15 Thread Richard Lynch
On Thu, June 15, 2006 1:14 am, weetat wrote: 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 ?

Re: [PHP] Using PHP/HTML effectivly

2006-06-15 Thread Richard Lynch
On Wed, June 14, 2006 3:28 pm, BBC wrote: I used many functions as template to change the html syntax. this is one of the function as a sample: ?php function tabletag($border=0,$width=100%,$height=100%,$cellpadding = 0,$cellspacing=0,$style=) { print (table width=\$width\ height

Re: [PHP] mysql + PHP

2006-06-15 Thread weetat
Thank all for your inputs. Yes . the data should be null , really bad data , will try to change database structure. Richard Lynch wrote: On Thu, June 15, 2006 1:14 am, weetat wrote: I have SQL query , for example , Select country , name from tbl_chassis order by country. The problem

RE: [PHP] Setting headers for file download

2006-06-15 Thread Richard Lynch
Something else is very very very wrong if Content-type: application/octet-stream does not force a download... http://pastebin your code or something, and we'll look at it. On Tue, June 13, 2006 7:19 pm, Peter Lauri wrote: Hi, when I do that I do not get any download frame showing up. Can that

[PHP] Re: File Download Headers

2006-06-15 Thread Barry
Richard Lynch schrieb: and are all you can find from Google? O_o Anybody? What?!? I for myself use this: header(Content-Type: application/force-download); header(Content-Type: application/octet-stream); header(Content-Type: application/download); Never had any problems with any browser.

[PHP] serving video files with php

2006-06-15 Thread Andras Kende
Hello, Is there any drawback servings video files through php downloader script on high load site? Or just straight link to the videos are more efficient? Thank you, Andras Kende http://www.kende.com

Re: [PHP] Using PHP/HTML effectivly

2006-06-15 Thread BBC
Thank Mr.tedd(I guess you are a man) I think you should check one of my site http://aztec-indianart.com while you're surfing this site actually you are visiting one page only with different variable (see url). I used many data in html, php, inc, txt, css, js and MySQL off course. then I

Re: [PHP] Using PHP/HTML effectivly

2006-06-15 Thread Jochem Maas
Richard Lynch wrote: On Wed, June 14, 2006 3:28 pm, BBC wrote: I used many functions as template to change the html syntax. this is one of the function as a sample: ?php function tabletag($border=0,$width=100%,$height=100%,$cellpadding = 0,$cellspacing=0,$style=) { print (table

[PHP] Re: Simulating a POST

2006-06-15 Thread Man-wai Chang
body onload=document.myform.submit() It says : everytime page loads submit the form. And since submitting a form is like reloading a page it will go over and over again. Then how could I make it happen once only? I already had a if..then..else to separate the 2 sections of codes. -- .~.

[PHP] Re: Simulating a POST

2006-06-15 Thread Man-wai Chang
Here is the new version: -- .~. 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 ^ ^ 16:48:01 up 9 days 2:31 1 user load average: 1.02 1.04 1.00 news://news.3home.net

[PHP] Re: Simulating a POST

2006-06-15 Thread Man-wai Chang
Here is the new version: -- .~. 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 ^ ^ 16:48:01 up 9 days 2:31 1 user load average: 1.02 1.04 1.00 news://news.3home.net

[PHP] Re: Simulating a POST

2006-06-15 Thread Barry
Man-wai Chang schrieb: Here is the new version: this should work. Have you tested it? -- Smileys rule (cX.x)C --o(^_^o) Dance for me! ^(^_^)o (o^_^)o o(^_^)^ o(^_^o) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: Simulating a POST

2006-06-15 Thread Barry
Man-wai Chang schrieb: Here is the new version: ?php function getLocationCaidaNetGeo($ip) { $NetGeoURL = http://netgeo.caida.org/perl/netgeo.cgi?target=.$ip; if($NetGeoFP = fopen($NetGeoURL,r)) { ob_start();

[PHP] Simple blog software... Simple but clean code... suggestions?

2006-06-15 Thread Micky Hulse
Hi, I am looking for a very simple blog software... I would prefer something that functions well with CSS and is standards compliant. I am getting tired of setting-up the bigger full-featured blogging packages for small/quick/simple sites. It would be nice to know what others people prefer.

[PHP] A tricky little problem

2006-06-15 Thread Ross
I have a multiple choice quiz where the questions answers are extracted from an external file $q1 = what is the capital of Scotland ; $a1 = Edinburgh; $b1 =Glasgow; $c1 =dundee; $d1 =Stirling; $q1_answer = $a1; $q2 = what is the capital of France; $a2 = Lyon; $b2 =Paris; $c2 =Carcassonne; $d2

[PHP] Re: Simple blog software... Simple but clean code... suggestions?

2006-06-15 Thread Barry
Micky Hulse schrieb: Hi, I am looking for a very simple blog software... I would prefer something that functions well with CSS and is standards compliant. I am getting tired of setting-up the bigger full-featured blogging packages for small/quick/simple sites. It would be nice to know what

Re: [PHP] Simple blog software... Simple but clean code... suggestions?

2006-06-15 Thread Dave Goodchild
On 15/06/06, Micky Hulse [EMAIL PROTECTED] wrote: Hi, I am looking for a very simple blog software... I would prefer something that functions well with CSS and is standards compliant. I am getting tired of setting-up the bigger full-featured blogging packages for small/quick/simple sites. It

[PHP] progress monitor in php

2006-06-15 Thread weetat
Hi all , I was using PEAR:HTTP_Upload to upload file in php 4.3.2. Is ok , however i need to display some sort of progress monitor to the user because some file is very large and took some times to upload. I need to inform the users to uploading is in progress. I have search google ,and

Re: [PHP] Re: File Download Headers

2006-06-15 Thread Jochem Maas
Barry wrote: Richard Lynch schrieb: and are all you can find from Google? O_o Anybody? What?!? Barry, chances are Richard was already initiating downloads when you were still eating from a bottle. I for myself use this: header(Content-Type: application/force-download);

Re: [PHP] Re: File Download Headers

2006-06-15 Thread Barry
Jochem Maas schrieb: Barry wrote: Barry, chances are Richard was already initiating downloads when you were still eating from a bottle. I don't think so well because the Zuse had no network capability. I for myself use this: header(Content-Type: application/force-download);

[PHP] [EMAIL PROTECTED]

2006-06-15 Thread Pham Huu Le Quoc Phuc
-Original Message- From: Jochem Maas [mailto:[EMAIL PROTECTED] Sent: Thursday, June 15, 2006 5:20 PM To: Barry Cc: php-general@lists.php.net Subject: Re: [PHP] Re: File Download Headers Barry wrote: Richard Lynch schrieb: and are all you can find from Google? O_o Anybody?

Re: [PHP] Calculating difference between two days

2006-06-15 Thread tedd
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. If you want to do this via mysql, see: http://dev.mysql.com/doc/refman/5.0/en/date-and-time-type-overview.html

[PHP] CMS Typo 3 (Slightly 0T(?))

2006-06-15 Thread Ryan A
Hey all, Am looking to start working with a CMS for a large site, after comparing quite a few CMSs Typo3 comes out looking very very attractive in features and price. Before I commit my time to using it I would like a quick review from those of you who have used/use it, as from the docs it says

[PHP] Re: CMS Typo 3 (Slightly 0T(?))

2006-06-15 Thread Barry
Ryan A schrieb: How hard was it for you to learn it? It's like a new language... How useful has it been to you? Very. Depends on what you. When you get into meodul coding you are very near to a extremly useable CMS system. Support when you hit a programming wall? The community is quite

Re: [PHP] mysql + PHP

2006-06-15 Thread tedd
At 2:14 PM +0800 6/15/06, weetat wrote: 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

[PHP] readdir problem with white spaces

2006-06-15 Thread Francisco Morales
Hello, I the following problem with readdir When I read the directory, if the file has more than one white spaces, readdir only return me the file with one space ... so if I have on the file system . ROAD 1 005.JPG or ROAD1 0005.JPG php readdir return me ROAD 1 005.JPG!!

Re: [PHP] progress monitor in php

2006-06-15 Thread tedd
At 5:48 PM +0800 6/15/06, weetat wrote: Hi all , I was using PEAR:HTTP_Upload to upload file in php 4.3.2. Is ok , however i need to display some sort of progress monitor to the user because some file is very large and took some times to upload. I need to inform the users to uploading is in

RE: [PHP] readdir problem with white spaces

2006-06-15 Thread Jay Blanchard
[snip] When I read the directory, if the file has more than one white spaces, readdir only return me the file with one space ... so if I have on the file system . ROAD 1 005.JPG or ROAD1 0005.JPG php readdir return me ROAD 1 005.JPG!! [/snip] Additional white space is

[PHP] Re: readdir problem with white spaces

2006-06-15 Thread Barry
Francisco Morales schrieb: Hello, I the following problem with readdir When I read the directory, if the file has more than one white spaces, readdir only return me the file with one space ... so if I have on the file system . ROAD 1 005.JPG or ROAD1 0005.JPG php readdir

Re: [PHP] Re: File Download Headers

2006-06-15 Thread Chris Shiflett
Barry wrote: You can send every header twice, triple. a zillion times if you want. Sure, but you have to know how to use header(): http://php.net/header By default it will replace, but if you pass in FALSE as the second argument you can force multiple headers of the same type. Regardless,

Re: [PHP] Re: File Download Headers

2006-06-15 Thread Barry
Chris Shiflett schrieb: Barry wrote: You can send every header twice, triple. a zillion times if you want. Sure, but you have to know how to use header(): http://php.net/header By default it will replace, but if you pass in FALSE as the second argument you can force multiple headers of the

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

2006-06-15 Thread afan
I wonder why this sarcasm? Why so rude? -afan [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

Re: [PHP] CMS Typo 3 (Slightly 0T(?))

2006-06-15 Thread Nick Talbott
Hi Ryan On Thursday 15 June 2006 12:48 pm, Ryan A wrote: Am looking to start working with a CMS for a large site, after comparing quite a few CMSs Typo3 comes out looking very very attractive in features and price. Before I commit my time to using it I would like a quick review from those

Re: [PHP] Calculating difference between two days

2006-06-15 Thread afan
Thanks Ted. Very helpfull. -afan 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. If you want to do this via mysql, see:

[PHP] basic php problem

2006-06-15 Thread Ross
I want to set a page number of a page if(!isset($_REQUEST['page'])) { $page =$_REQUEST['page'] + 1; echo page is .$page; // this echos out page is 1 } The problem is when I try and use $page further down in the body $page is 0 Question ?=$page; ? BR / ? echo page is.$page; ?

Re: [PHP] Using PHP/HTML effectivly

2006-06-15 Thread tedd
At 1:14 AM -0700 6/15/06, BBC wrote: Thank Mr.tedd(I guess you are a man) I think you should check one of my site http://aztec-indianart.com while you're surfing this site actually you are visiting one page only with different variable (see url). I used many data in html, php, inc, txt, css,

Re: [PHP] basic php problem

2006-06-15 Thread nicolas figaro
Ross a écrit : I want to set a page number of a page if(!isset($_REQUEST['page'])) { $page =$_REQUEST['page'] + 1; echo page is .$page; // this echos out page is 1 } The problem is when I try and use $page further down in the body $page is 0 Question ?=$page; ? BR / ? echo page is.$page; ?

Re: [PHP] progress monitor in php

2006-06-15 Thread weetat
hi , That gd. However i did not see any upload progress monitor at all. Anybody have any ideas how to implement it? Thanks tedd wrote: At 5:48 PM +0800 6/15/06, weetat wrote: Hi all , I was using PEAR:HTTP_Upload to upload file in php 4.3.2. Is ok , however i need to display some sort

Re: [PHP] basic php problem

2006-06-15 Thread nicolas figaro
nicolas figaro a écrit : Ross a écrit : I want to set a page number of a page if(!isset($_REQUEST['page'])) { $page =$_REQUEST['page'] + 1; echo page is .$page; // this echos out page is 1 } The problem is when I try and use $page further down in the body $page is 0 Question ?=$page; ?

Re: [PHP] basic php problem

2006-06-15 Thread Dave Goodchild
On 15/06/06, Ross [EMAIL PROTECTED] wrote: I want to set a page number of a page if(!isset($_REQUEST['page'])) { $page =$_REQUEST['page'] + 1; echo page is .$page; // this echos out page is 1 } The problem is when I try and use $page further down in the body $page is 0 Question ?=$page;

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

2006-06-15 Thread afan
Jochem, You are wrong. I tried and it worked. But, when I asked can I, I meant Am I allowed to do that. The same as many security or other kind questions where answer is: Yes, it works - but it's NOT correct. Yes, I did search php.net but didn't find answer. Yes, I did search mysql.com but didn't

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

2006-06-15 Thread Jochem Maas
[EMAIL PROTECTED] wrote: You are wrong. there's a first for everything, heh. I tried and it worked. But, when I asked can I, I meant Am I allowed to do that. The same as many security or other kind then say what you mean in future. you already knew that you *can* do it, you should have

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

2006-06-15 Thread Jochem Maas
[EMAIL PROTECTED] wrote: I wonder why this sarcasm? Why so rude? your original question could have been answered by: a, trying to run the code provided (thats called testing btw) b, reading php.net c, reading mysql.com/docs (or where ever they have the docs this week) my reply not only

Re: [PHP] Re: CMS Typo 3 (Slightly 0T(?))

2006-06-15 Thread Ryan A
Hey! @Barry, Thanks for the info. To answer your Q: nope, never coded a CMS but have a rough (very rough) idea on how it works, I have been coding for years from C-Java-PHP Top3 is a very big Hammer when you start from scratch. Thats what i wanted to know... @Nick T, Thanks for the huge

[PHP] Re: serving video files with php

2006-06-15 Thread Adam Zey
Andras Kende wrote: Hello, Is there any drawback servings video files through php downloader script on high load site? Or just straight link to the videos are more efficient? Thank you, Andras Kende http://www.kende.com Yes, there is. The PHP downloader script

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

2006-06-15 Thread tedd
At 4:11 PM +0200 6/15/06, [EMAIL PROTECTED] wrote: Jochem, You are wrong. I tried and it worked. But, when I asked can I, I meant Am I allowed to do that. The same as many security or other kind questions where answer is: Yes, it works - but it's NOT correct. Yes, I did search php.net but didn't

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

2006-06-15 Thread afan
Yes, you are right, I had to be more carefull about how to write my post. Thanks. for bruising your ego? or for originally giving 2 suggestions as to better strategies for doing what you *seemed* to be wanting to achieve - 2 suggestions which you blatantly seemed to ignore in favor of

Re: [PHP] Simple class declaration returns error

2006-06-15 Thread Eric Butera
On 6/14/06, Dave M G [EMAIL PROTECTED] wrote: 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 that the index.php file is successfully including the class. After you fix your parse errors you might take a look at:

[PHP] Accepting File Uploads from CURL

2006-06-15 Thread Brad Bonkoski
Hello All, I am using PERL to generate an XML file from a database query. no problems there. I then try to use curl to send it to an upload script. Essentially the command line looks like this: curl -H 'Content-Type:text/xml' -d file.xml server/up.php for my up.php I am just trying to dump

Re: [PHP] Accepting File Uploads from CURL

2006-06-15 Thread Rabin Vincent
On 6/15/06, Brad Bonkoski [EMAIL PROTECTED] wrote: Hello All, I am using PERL to generate an XML file from a database query. no problems there. I then try to use curl to send it to an upload script. Essentially the command line looks like this: curl -H 'Content-Type:text/xml' -d file.xml

Re: [PHP] File Download Headers

2006-06-15 Thread Jon Anderson
Richard Lynch wrote: Can any experts on this list explain to me why, despite the 1,000,000 places that application/octet-stream is documented to work, and has always worked, since Mosaic 1.0 days, people manage to find these goofball Content-type: headers that are supposed to work, but only work

[PHP] Replacing text with criteria

2006-06-15 Thread Jeff Lewis
I have been working on a script to parse a CSV file and in the process I clean out a lot of the garbage not needed but I am a bit stumped on one aspect of this file. It's a list of over 3000 contacts and I'm trying to mask a lot of the information with *. So as I loop through this list I am

Re: [PHP] progress monitor in php

2006-06-15 Thread Martin Alterisio
2006/6/15, weetat [EMAIL PROTECTED]: Hi all , I was using PEAR:HTTP_Upload to upload file in php 4.3.2. Is ok , however i need to display some sort of progress monitor to the user because some file is very large and took some times to upload. I need to inform the users to uploading is in

Re: [PHP] basic php problem

2006-06-15 Thread D. Dante Lorenso
Dave Goodchild wrote: if $_REQUEST['page'] is not set, why not do this: $page = isset($_REQUEST['page']) ? $_REQUEST['page'] : 1; (ternary operator) // test, numeric read, with default and bounds checking $page = empty($_REQUEST['page']) ? 1 : intval($_REQUEST['page']); $page = min(max($page,

Re: [PHP] Using PHP/HTML effectivly

2006-06-15 Thread Robert Cummings
On Thu, 2006-06-15 at 03:16, Larry Garfield wrote: Another recommendation: Do not, under any circumstances, try to write your own template engine. All you'll be doing is writing a syntax parser in PHP for another syntax that will give you fewer options, less flexibility, and worse

[PHP] paging results in large resultsets: mysql vs postgresql?

2006-06-15 Thread D. Dante Lorenso
All, I just discovered this neat little gem in MySQL which makes it easy to page large result sets: * SELECT SQL_CALC_FOUND_ROWS * FROM table LIMIT 10, 10 * SELECT FOUND_ROWS() The neat thing is that SQL_CALC_FOUND_ROWS will cause MySQL to tally up all the rows that WOULD

[PHP] How to run one php app from another?

2006-06-15 Thread tedd
Hi gang: This seems like so obvious a question, I am reluctant to ask. In any event, I simply want my php application to run another, like so: switch (option) { case a: run a.php; exit; break; case b: run b.php; exit; break; case c: run c.php; exit;

[PHP] Re: How to run one php app from another?

2006-06-15 Thread Adam Zey
tedd wrote: Hi gang: This seems like so obvious a question, I am reluctant to ask. In any event, I simply want my php application to run another, like so: switch (option) { case a: run a.php; exit; break; case b: run b.php; exit; break; case c: run c.php;

[PHP] Re: Replacing text with criteria

2006-06-15 Thread Adam Zey
Jeff Lewis wrote: I have been working on a script to parse a CSV file and in the process I clean out a lot of the garbage not needed but I am a bit stumped on one aspect of this file. It's a list of over 3000 contacts and I'm trying to mask a lot of the information with *. So as I loop through

Re: [PHP] paging results in large resultsets: mysql vs postgresql?

2006-06-15 Thread tedd
At 11:11 AM -0500 6/15/06, D. Dante Lorenso wrote: I can't seem to find the equivalent of it in PostgreSQL! The only options I see are: 1. TWO queries. The first query will perform a SELECT COUNT(*) ...; and the second query performs the actualy SELECT ... LIMIT x OFFSET y; -snip-

Re: [PHP] Simple blog software... Simple but clean code... suggestions?

2006-06-15 Thread Micky Hulse
Dave Goodchild wrote: Use WordPress - clean, css-based, standards-compliant. You can set up a basic site very quickly. If you want me to walk you through an example contact me off list ( [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]). I set up two installations, www.abuddhistpodcast.com

Re: [PHP] Re: Simple blog software... Simple but clean code... suggestions?

2006-06-15 Thread Micky Hulse
Barry wrote: Well if you have that often this case, i would prefer you code one for yourself. Oh, for sure. I completely agree... For the longest time (i.e. the college years) I was against using other peoples blog software or scripts... I would have never learned anything about PHP if it

Re: [PHP] Simple blog software... Simple but clean code... suggestions?

2006-06-15 Thread Micky Hulse
Dave Goodchild wrote: www.abuddhistpodcast.com http://www.abuddhistpodcast.com and www.mediamasters.co.uk/dg/insp http://www.mediamasters.co.uk/dg/insp Cool sites btw! Good work. :) Cheers, M -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP] paging results in large resultsets: mysql vs postgresql?

2006-06-15 Thread Richard Lynch
On Thu, June 15, 2006 11:11 am, D. Dante Lorenso wrote: I just discovered this neat little gem in MySQL which makes it easy to page large result sets: * SELECT SQL_CALC_FOUND_ROWS * * SELECT FOUND_ROWS() I can't seem to find the equivalent of it in PostgreSQL! The only options I

Re: [PHP] How to run one php app from another?

2006-06-15 Thread Richard Lynch
Just include 'a.php'; and it will get done. On Thu, June 15, 2006 11:11 am, tedd wrote: Hi gang: This seems like so obvious a question, I am reluctant to ask. In any event, I simply want my php application to run another, like so: switch (option) { case a: run a.php;

Re: [PHP] Simple blog software... Simple but clean code... suggestions?

2006-06-15 Thread Anthony Ettinger
echo $_GET['comment'] htdocs/comments.html :) On 6/15/06, Micky Hulse [EMAIL PROTECTED] wrote: Dave Goodchild wrote: www.abuddhistpodcast.com http://www.abuddhistpodcast.com and www.mediamasters.co.uk/dg/insp http://www.mediamasters.co.uk/dg/insp Cool sites btw! Good work. :) Cheers,

Re: [PHP] basic php problem

2006-06-15 Thread Richard Lynch
On Thu, June 15, 2006 8:11 am, Ross wrote: I want to set a page number of a page if(!isset($_REQUEST['page'])) { $page =$_REQUEST['page'] + 1; These two together make no sense at all... If the $_REQUEST['page'] is NOT set, then why use it? It's NOT THERE. echo page is .$page; // this

Re: [PHP] Using PHP/HTML effectivly

2006-06-15 Thread Jochem Maas
Robert Cummings wrote: On Thu, 2006-06-15 at 03:16, Larry Garfield wrote: Another recommendation: Do not, under any circumstances, try to write your own template engine. All you'll be doing is writing a syntax parser in PHP for another syntax that will give you fewer options, less

Re: [PHP] generating/transforming HTML so that it 'works' in a flash file

2006-06-15 Thread Jochem Maas
Richard Lynch wrote: I suspect the first question would be if Flash people have bothered to document what HTML subset they support. they do, to a point (although trying to figure out what is supported across all version is painful) and reading what they do apparently support made me cry.

Re: [PHP] A tricky little problem

2006-06-15 Thread Richard Lynch
On Thu, June 15, 2006 4:30 am, Ross wrote: I have a multiple choice quiz where the questions answers are extracted from an external file $q1 = what is the capital of Scotland ; $a1 = Edinburgh; $b1 =Glasgow; $c1 =dundee; $d1 =Stirling; $q1_answer = $a1; $q2 = what is the capital of

Re: [PHP] Re: Simple blog software... Simple but clean code... suggestions?

2006-06-15 Thread Richard Lynch
On Thu, June 15, 2006 2:17 pm, Micky Hulse wrote: Barry wrote: Well if you have that often this case, i would prefer you code one for yourself. Oh, for sure. I completely agree... For the longest time (i.e. the college years) I was against using other peoples blog software or scripts... I

Re: [PHP] serving video files with php

2006-06-15 Thread Richard Lynch
On Thu, June 15, 2006 3:04 am, Andras Kende wrote: Is there any drawback servings video files through php downloader script on high load site? Or just straight link to the videos are more efficient? TAANSTAAFL There certainly IS some overhead using PHP downloader script, and a straight link

Re: [PHP] progress monitor in php

2006-06-15 Thread Richard Lynch
On Thu, June 15, 2006 4:48 am, weetat wrote: I was using PEAR:HTTP_Upload to upload file in php 4.3.2. Is ok , however i need to display some sort of progress monitor to the user because some file is very large and took some times to upload. I need to inform the users to uploading is in

Re: [PHP] paging results in large resultsets: mysql vs postgresql?

2006-06-15 Thread D. Dante Lorenso
Richard Lynch wrote: 3. use the built-in cursor of PostgreSQL which pre-dates MySQL LIMIT and OFFSET clauses, which are non-standard hacks Rasmus introduced back in the day. Care to elaborate? Cast into context of PDO if you can...? Dante -- PHP General Mailing List (http://www.php.net/) To

[PHP] Re: Replacing text with criteria

2006-06-15 Thread Rafael
Try with preg_replace('/\d(?!(?\d*)\))/X', '*', $phone) wich would be a bit more efficient than preg_replace('/\d(?!\d*\))/X', '*', $phone) Jeff Lewis wrote: I have been working on a script to parse a CSV file and in the process I clean out a lot of the garbage not needed but I am a

Re: [PHP] Re: File Download Headers

2006-06-15 Thread Richard Lynch
On Thu, June 15, 2006 3:04 am, Barry wrote: Richard Lynch schrieb: and are all you can find from Google? O_o Anybody? What?!? I for myself use this: header(Content-Type: application/force-download); header(Content-Type: application/octet-stream); header(Content-Type:

  1   2   >