[PHP] Working with files

2004-04-07 Thread Teo Mattiozzi Petralia
Hello! If I have a text file like; FindThisBeginning Here goes several text... FindThisEnd FindThisOtherBeginning Here goes other text... FindThisOtherEnd and so on... How can I retrieve the portion of the text between those kind of tags (FindThisBeginning, FindThisEnd, etc), and transfer them

[PHP] php and drop down boxes

2004-04-07 Thread Andy B
hi... i have a few things i need and dont know where to go to get some ideas/examples of how to do some things: 1. i need to know how to take info from a mysql db load it into a dropdown box and then select as the default choice whatever value was in the db: i.e. i have a combo box with the

Re: [PHP] File upload progress

2004-04-07 Thread Raditha Dissanayake
Eric Wood wrote: - Original Message - I posted about this the other day. I was directed to look at megaupload http://www.raditha.com/megaupload/ It works pretty well, I believe it uses Apache::Request to get the raw post info. I recently began to use megaupload, it

RE: [PHP] php and drop down boxes

2004-04-07 Thread Hawkes, Richard
Well, here's the long way of doing it that I ended up using! For my 'tournament' date (for a football web site) I have three stored values: $tournamentDay, $tournamentMonth, $tournamentYear which are evaluated for each drop-down. I might work on a neater solution actually! Cheers Richard tr

[PHP] regular expression

2004-04-07 Thread Robert Kornfeld
hey, professionals out there: i need to write a parser for an email-header to retrieve the email of the 'To:'-field. there are 2 possibilities: 'To: [EMAIL PROTECTED]' or 'To: first foo [EMAIL PROTECTED]' i would only need the email-adress! does anyone know the regular expression that can handle

[PHP] Zlib.output_compression - Problem

2004-04-07 Thread Beck, Mike
Hi everybody, I initially posted this on a german php-list, then i tried on php-install on php.net but did not get one single answer yet. I hope there is somebody on this list that can help me: I am having a problem with zlib-compression-settings in php.ini and the sending of 'normal' files with

RE: [PHP] regular expression

2004-04-07 Thread Simon Hayward
preg_match(/To: ([^]+)?([^]+)??/i,$string,$matches); returns email in $matches[1] in the first instance and name in $matches[1] and email in $matches[2] in the second. -Original Message- From: Robert Kornfeld [mailto:[EMAIL PROTECTED] Sent: 07 April 2004 09:32 To: [EMAIL PROTECTED]

Re: [PHP] regular expression

2004-04-07 Thread Red Wingate
Alright, first of all, in E-Mail Headers every param needs to be written in a seperate line, therefore following will work even with multiple recipients: $recipients = array(); $header = explode( \n , $header ); foreach ( $header AS $param ) { $param = trim ( $param ); if ( strtolower(

Re: [PHP] assign mysql query to a variable first or not

2004-04-07 Thread Richard Davey
Hello Andy, Wednesday, April 7, 2004, 4:09:59 AM, you wrote: AB is it better to give the mysql query string to a variable AB instead of directly doing it with mysql_query? AB i.e. AB $query=select * from table;//is this a better way? AB $query=mysql_query(select * from table);//or is this way

Re: [PHP] assign mysql query to a variable first or not

2004-04-07 Thread Red Wingate
One of the greatest benefits is the fact, that you can easily display your actual query without copying it, passing it to a variable and then display it's content: $result = mysql_query( ); would first become: $var = ; $result = mysql_query( ); echo $var ; now if the query

[PHP] PHP security in a hosting environment

2004-04-07 Thread Ben Joyce
hi. one of my clients whom we host a website for has expressed interest in writing their own php/mySQL applications for their site. i've been looking in to the security implications of offering this service. My concerns are that the client *could* use a php script to access parts of the file

RE: RE: [PHP] Validating form field text input to be a specific v ariable type

2004-04-07 Thread Ford, Mike [LSS]
On 07 April 2004 03:03, [EMAIL PROTECTED] wrote: From: Merritt, Dave [EMAIL PROTECTED] Okay seems to makes sense, but when I do the following it doesn't appear to be working correctly, or I'm viewing my logic incorrectly one: if ( (int)$PageOptions['Default'] ==

RE: [PHP] confused big time

2004-04-07 Thread Robert Cummings
On Tue, 2004-04-06 at 20:09, Chris W. Parker wrote: Chris W. Parker on Tuesday, April 06, 2004 5:01 PM said: let me expand both of my points in an attempt to be more verbose. 1. write readable queries. 2. always put single quotes around array keys. $array['key'] here is how i

[PHP] Re: assign mysql query to a variable first or not

2004-04-07 Thread David Robley
[EMAIL PROTECTED] (Andy B) wrote in news:[EMAIL PROTECTED]: hi... is it better to give the mysql query string to a variable instead of directly doing it with mysql_query? i.e. $query=select * from table;//is this a better way? $query=mysql_query(select * from table);//or is this way

RE: [PHP] PHP security in a hosting environment

2004-04-07 Thread Hawkes, Richard
My suggestion would be to run the PHP Web Server on a different server to where you are retrieving your files. The file server can then define its own polices of what you can read/write to etc. Your web server can then map a drive to the file server, and anybody writing PHP scripts won't be able

RE: [PHP] stuck with simple query..... Plz have a look

2004-04-07 Thread Jay Blanchard
[snip] We have two tables [/snip] Please do not cross-post, send only to the list where needed. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Validating form field text input to be a specific variable type

2004-04-07 Thread William Lovaton
Instead of doing a lot of casting, you can use is_numeric() to see if a variable is a number or a numeric string. -William El mar, 06-04-2004 a las 14:19, John W. Holmes escribió: Well, if (int)$string == $string, then the value is an integer. Same for (float)$string == $string for a real

Re: [PHP] Validating form field text input to be a specificvariable type

2004-04-07 Thread John W. Holmes
From: William Lovaton [EMAIL PROTECTED] Instead of doing a lot of casting, you can use is_numeric() to see if a variable is a number or a numeric string. Yeah, but the OP wanted to be able to tell an integer from a real number from a string. is_numeric() is going to validate 5, 5.5, and

Re: [PHP] PHP security in a hosting environment

2004-04-07 Thread Raditha Dissanayake
Ben Joyce wrote: hi. one of my clients whom we host a website for has expressed interest in writing their own php/mySQL applications for their site. i've been looking in to the security implications of offering this service. My concerns are that the client *could* use a php script to access

Re: [PHP] PHP security in a hosting environment

2004-04-07 Thread John W. Holmes
From: Ben Joyce [EMAIL PROTECTED] one of my clients whom we host a website for has expressed interest in writing their own php/mySQL applications for their site. i've been looking in to the security implications of offering this service. My concerns are that the client *could* use a php

[PHP] Error messages configuration

2004-04-07 Thread Germán M. Rivera
Hi all! I would like to know if it is possible to change the format of error and warning messages that PHP shows. Now my error notifications look like: [Fatal error | Warning | ...]: error in file on line line. It would be helpful for me that those messages included some additional

Re: [PHP] Error messages configuration

2004-04-07 Thread John W. Holmes
From: Germán M. Rivera [EMAIL PROTECTED] I would like to know if it is possible to change the format of error and warning messages that PHP shows. Now my error notifications look like: [Fatal error | Warning | ...]: error in file on line line. It would be helpful for me that

Re[2]: [PHP] Validating form field text input to be a specificvariable type

2004-04-07 Thread Richard Davey
Hello John, Wednesday, April 7, 2004, 2:05:22 PM, you wrote: JWH Yeah, but the OP wanted to be able to tell an integer from a real number JWH from a string. is_numeric() is going to validate 5, 5.5, and 5.05E6, for JWH example. What about is_integer() ? -- Best regards, Richard Davey

[PHP] Graphical Map of My Web Site

2004-04-07 Thread Hawkes, Richard
Hi Gang, I'm looking for a way to produce a graphical walk of my web site (ie following the links around). Does anybody know anything free I can use to do this? I also have an area that you login to, which then stores a session ID value, so how would I get over that element?! Cheers Richard

RE: [PHP] Re: Weird variable issue encountered... help needed!

2004-04-07 Thread gvarosky
Thanks again everyone for your assistance. I found an un-related bug in the PHP bugs database here: http://bugs.php.net/bug.php?id=18648 (which was for an earlier version than 4.3.4, which I was running) and applied that band-aid patch to some of the places where this was happening, and it

RE: [PHP] smarty

2004-04-07 Thread Jason Sheets
I use Smarty for most of my commericial and non commercial websites, it makes it very easy to share and re-use code because the appliciation logic is separate from the presentation logic. It also makes it possible to encode the scripts using Zend Encoder, Turck MMCache or similar projects which

Re: [PHP] Graphical Map of My Web Site

2004-04-07 Thread Raditha Dissanayake
Hawkes, Richard wrote: Hi Gang, I'm looking for a way to produce a graphical walk of my web site (ie following the links around). Does anybody know anything free I can use to do this? I also have an area that you login to, which then stores a session ID value, so how would I get over that

[PHP] large file uploads

2004-04-07 Thread Arthur Radulescu
Hello! Does any one now how I can handle large file uploads (around 10-20 MB) with PHP. I need this functionality into an intranet but I cannot figure out what I must configure to handle this. Thanks, Arthur Looking for a job!? Use

Re: Re[2]: [PHP] Validating form field text input to be a specificvariable type

2004-04-07 Thread William Lovaton
Hi, El mi? 07-04-2004 a las 08:38, Richard Davey escribió: Hello John, Wednesday, April 7, 2004, 2:05:22 PM, you wrote: JWH Yeah, but the OP wanted to be able to tell an integer from a real number JWH from a string. is_numeric() is going to validate 5, 5.5, and 5.05E6, for JWH example.

RE: [PHP] large file uploads

2004-04-07 Thread Jay Blanchard
[snip] Does any one now how I can handle large file uploads (around 10-20 MB) with PHP. I need this functionality into an intranet but I cannot figure out what I must configure to handle this. [/snip] http://us3.php.net/features.file-upload The manual is your fried, read it, love it, use it.

Re: [PHP] large file uploads

2004-04-07 Thread Raditha Dissanayake
Arthur Radulescu wrote: Hello! Does any one now how I can handle large file uploads (around 10-20 MB) with PHP. I need this functionality into an intranet but I cannot figure out what I must configure to handle this. http://www.radinks.com/upload/config.php will tell you all the parameters

Re: [PHP] large file uploads

2004-04-07 Thread John Nichel
Jay Blanchard wrote: [snip] Does any one now how I can handle large file uploads (around 10-20 MB) with PHP. I need this functionality into an intranet but I cannot figure out what I must configure to handle this. [/snip] http://us3.php.net/features.file-upload The manual is your fried, read

RE: [PHP] large file uploads

2004-04-07 Thread Jay Blanchard
[snip] ...fried... And it is served with a heaping serving of home fries, and covered with a delicious white country gravy. (Low calorie fried manuals available upon request). Sorry...couldn't resist. ;) [/snip] Thanks, I needed that! -- PHP General Mailing List (http://www.php.net/) To

Re: [PHP] Validating form field text input to be a specificvariable type

2004-04-07 Thread William Lovaton
El mi? 07-04-2004 a las 08:05, John W. Holmes escribió: From: William Lovaton [EMAIL PROTECTED] Instead of doing a lot of casting, you can use is_numeric() to see if a variable is a number or a numeric string. Yeah, but the OP wanted to be able to tell an integer from a real number from

Re: [PHP] large file uploads

2004-04-07 Thread Arthur Radulescu
I have forgot to mention that I have tried this and modified the php.ini on a windows system but had no success. There is no error but the file does not get uploaded either. Arthur - Original Message - From: Jay Blanchard [EMAIL PROTECTED] To: John Nichel [EMAIL PROTECTED]; [EMAIL

RE: [PHP] large file uploads

2004-04-07 Thread Jay Blanchard
[snip] I have forgot to mention that I have tried this and modified the php.ini on a windows system but had no success. There is no error but the file does not get uploaded either. [/snip] Did you restart your web server? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP] large file uploads

2004-04-07 Thread Arthur Radulescu
Yes I restarted the server and then the computer... No success... The page timeouts after a while but the file does not gets uploaded Arthur Looking for a job!? Use the smart search engine!! Find a Job from Millions WorldWide...

RE: [PHP] large file uploads

2004-04-07 Thread Jay Blanchard
[snip] Yes I restarted the server and then the computer... No success... The page timeouts after a while but the file does not gets uploaded [/snip] Please trim your replies, and please do not top post. Can we see your upload code? -- PHP General Mailing List (http://www.php.net/) To

Re: [PHP] large file uploads

2004-04-07 Thread Arthur Radulescu
The code is below (pieces of it). The folders have write permissions. It works just fine with smaller files but nothing happens with larger files if(!is_uploaded_file($_FILES['file']['tmp_name'])){ $ERR['file']=1; }

Re: [PHP] Validating form field text input to be a specificvariable type

2004-04-07 Thread Red Wingate
An RegExp will work but is not as fast as native functions, but you could use something like: $len1 = strlen ( $input ); $len2 = strspn ( $input , 1234567890,. ); if ( $len1 == $len2 ) { echo 'yuuhooo'; } else { echo 'd\'oh'; } [...] From: William Lovaton [EMAIL PROTECTED] Instead

[PHP] radio buttons checked or not

2004-04-07 Thread Andy B
hi... i have this code: ?if($old['Type']==Annual){? input type=radio name=eventtype value=Annualchecked accesskey=yYes ?}else {? input type=radio name=eventtype value=OneTime checked accesskey=nNo?}? was just wondering if that was the right way to determine the state of a radio button...? if the

Re: [PHP] large file uploads

2004-04-07 Thread Jason Wong
On Wednesday 07 April 2004 22:14, Arthur Radulescu wrote: The code is below (pieces of it). The folders have write permissions. It works just fine with smaller files but nothing happens with larger files 1) What are your upload-related settings in php.ini? 2) Have you enabled FULL error

RE: [PHP] radio buttons checked or not

2004-04-07 Thread Jay Blanchard
[snip] i have this code: ?if($old['Type']==Annual){? input type=radio name=eventtype value=Annualchecked accesskey=yYes ?}else {? input type=radio name=eventtype value=OneTime checked accesskey=nNo?}? was just wondering if that was the right way to determine the state of a radio button...? if the

Re: [PHP] smarty

2004-04-07 Thread Chris de Vidal
Kelly Hallman said: Going even one step further (the beauty of Smarty: always another level), just extend the Smarty object itself. Then, instead of making all your templates includes other templates (such as a header or a footer), you can make your overall page be a template, and the extended

Re: [PHP] Validating form field text input to be a specificvariable type

2004-04-07 Thread William Lovaton
I guess that works but every possible solution posted in this thread is a lot of lines of code to perform a simple validation. PHP should offer/modify the appropriate API to do this. I remember that is_numeric() didn't exist before. Something like: is_float_string(mixed value) or modify

Re: [PHP] radio buttons checked or not

2004-04-07 Thread John W. Holmes
From: Andy B [EMAIL PROTECTED] i have this code: ?if($old['Type']==Annual){? input type=radio name=eventtype value=Annualchecked accesskey=yYes ?}else {? input type=radio name=eventtype value=OneTime checked accesskey=nNo?}? was just wondering if that was the right way to determine the

RE: [PHP] Validating form field text input to be aspecificvariable type

2004-04-07 Thread Jay Blanchard
[snip] May be filing a bug report will do the trick. ;-) [/snip] Maybe filing a feature request would be better, since this is not a bug. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Validating form field text input to be aspecificvariable type

2004-04-07 Thread John W. Holmes
From: William Lovaton [EMAIL PROTECTED] I guess that works but every possible solution posted in this thread is a lot of lines of code to perform a simple validation. PHP should offer/modify the appropriate API to do this. I remember that is_numeric() didn't exist before. Something like:

[PHP] warning:supplied argument to mysql_fetch_array not valid resource type?

2004-04-07 Thread Andy B
i have this query set: $EditQuery=select * from $EventsTable where Id='$edit'; $query=mysql_query($EditQuery)||die(mysql_error()); //later in the code i have this: while($old=mysql_fetch_array($query)){ //do stuff } when i run the page i get: warning: supplied argument to mysql_fetch_array is not

Re: [PHP] smarty

2004-04-07 Thread John W. Holmes
From: Chris de Vidal [EMAIL PROTECTED] Kelly Hallman said: Going even one step further (the beauty of Smarty: always another level), just extend the Smarty object itself. Then, instead of making all your templates includes other templates (such as a header or a footer), you can make your

RE: [PHP] warning:supplied argument to mysql_fetch_array not valid resource type?

2004-04-07 Thread Jay Blanchard
[snip] i have this query set: $EditQuery=select * from $EventsTable where Id='$edit'; $query=mysql_query($EditQuery)||die(mysql_error()); [/snip] You forgot the connection string arguement in mysql_query -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP] warning:supplied argument to mysql_fetch_array not valid resource type?

2004-04-07 Thread Jason Wong
On Wednesday 07 April 2004 22:56, Andy B wrote: i have this query set: $EditQuery=select * from $EventsTable where Id='$edit'; $query=mysql_query($EditQuery)||die(mysql_error()); //later in the code i have this: while($old=mysql_fetch_array($query)){ //do stuff } when i run the page i get:

Re: [PHP] radio buttons checked or not

2004-04-07 Thread Andy B
Assuming $old['Type'] somehow comes from $_REQUEST['eventtype'] (or is related to it), then yeah, that'll work. no its coming from a db result from fetch_array() of which im having an interesting problem with right now but thats in another post -- PHP General Mailing List (http://www.php.net/)

Re: [PHP] warning:supplied argument to mysql_fetch_array not valid resource type?

2004-04-07 Thread John Nichel
Andy B wrote: i have this query set: $EditQuery=select * from $EventsTable where Id='$edit'; $query=mysql_query($EditQuery)||die(mysql_error()); //later in the code i have this: while($old=mysql_fetch_array($query)){ //do stuff } when i run the page i get: warning: supplied argument to

[PHP] Merge 2 XML files using PHP 4

2004-04-07 Thread Gal
Hello all, Does anyone here add some good experience of writing PHP script which is merging 2 XML files. example: --- file 1: = XML NODE name=aaa value=old_value / NODE name=bbb value=hello all / /XML file 2: = XML NODE name=aaa value=NEW_value /

Re: [PHP] warning:supplied argument to mysql_fetch_array not valid resource type?

2004-04-07 Thread John W. Holmes
From: Andy B [EMAIL PROTECTED] i have this query set: $EditQuery=select * from $EventsTable where Id='$edit'; $query=mysql_query($EditQuery)||die(mysql_error()); //later in the code i have this: while($old=mysql_fetch_array($query)){ //do stuff } when i run the page i get: warning:

[PHP] Can I get varaibles from an include file without exectuting it?

2004-04-07 Thread Al
I have a script that is run with a cronjob and would like to fetch some variables from it, using another file, without the script executing. I could resort to putting the variables in a third file, or reading the script as a text file and reconstructing the variables. But, I was hoping there

RE: [PHP] Can I get varaibles from an include file without exectuting it?

2004-04-07 Thread Dave Avent
pipe the infomation from the script that is run by crond directly into the second script at run-time Dave -Original Message- From: Al [mailto:[EMAIL PROTECTED] Sent: 07 April 2004 4:13 PM To: [EMAIL PROTECTED] Subject: [PHP] Can I get varaibles from an include file without exectuting it?

Re: [PHP] warning:supplied argument to mysql_fetch_array not valid resource type?

2004-04-07 Thread Andy B
[snip] i have this query set: $EditQuery=select * from $EventsTable where Id='$edit'; $query=mysql_query($EditQuery)||die(mysql_error()); [/snip] You forgot the connection string arguement in mysql_query even after putting in my standard mysql_connect(.) stuff it still fails now the

Re: [PHP] update mysql from php web page

2004-04-07 Thread Chip Wiegand
Daniel Clark [EMAIL PROTECTED] wrote on 04/06/2004 03:27:34 PM: I think you need a WHERE clause for the UPDATE, otherwise it will update ALL the records. e.g. WHERE OwnerName='$result' Then perhaps a redirect to another page. Thanks for the reminder. I set that, and found the problem

Re: [PHP] Validating form field text input to be a specificvariable type

2004-04-07 Thread Curt Zirzow
* Thus wrote William Lovaton ([EMAIL PROTECTED]): or modify is_numeric() to explictly perform an integer validation: is_numeric(mixed value [, bool is_integer = false]) um.. ctype_digit(). Curt -- I used to think I was indecisive, but now I'm not so sure. -- PHP General Mailing List

Re: [PHP] Can I get varaibles from an include file without exectuting it?

2004-04-07 Thread John W. Holmes
From: Al [EMAIL PROTECTED] I have a script that is run with a cronjob and would like to fetch some variables from it, using another file, without the script executing. I could resort to putting the variables in a third file, or reading the script as a text file and reconstructing the

Re: [PHP] warning:supplied argument to mysql_fetch_array not valid resource type?

2004-04-07 Thread Jason Wong
On Wednesday 07 April 2004 23:16, Andy B wrote: anybody know why that is or what the deal is... i had to modify the query set to read: mysql_connect(...)||die(mysql_error())//works $EditQuery=select * from $EventsTable where Id='$edit'; $query=mysql_query($EditQuery);//||die(mysql_error())

[PHP] PHP based Voice Chat Module

2004-04-07 Thread Pushpinder Singh
Hello everyone, I was wondering if anyone has used any PHP/MySQL based voice chat system. (for MAC OS X Platform) thanks in advance Pushpinder -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Validating form field text input to be aspecificvariable type

2004-04-07 Thread William Lovaton
That's not bloat. And using a lot of lines of code to do a simple validation like this is not fun. -William El mi? 07-04-2004 a las 09:54, John W. Holmes escribió: Don't add more bloat to the code. Don't be afraid of actually using a couple of lines to accomplish something instead of

[PHP] stuck with simple query..... Plz have a look

2004-04-07 Thread Tariq Murtaza
We have two tables Table1: - ID |Name 1 |name1 2 |name2 3 |name3 4 |name4 Table2: --- PL | PC

RE: [PHP] warning:supplied argument to mysql_fetch_array not vali d resource type?

2004-04-07 Thread Ford, Mike [LSS]
On 07 April 2004 15:56, Andy B wrote: i have this query set: $EditQuery=select * from $EventsTable where Id='$edit'; $query=mysql_query($EditQuery)||die(mysql_error()); Don't use || for this, use or -- they have different precedence, and it *matters*. //later in the code i have this:

Re: [PHP] Validating form field text input to be a specificvariable type

2004-04-07 Thread William Lovaton
Hi Curt, El mi? 07-04-2004 a las 10:29, Curt Zirzow escribió: * Thus wrote William Lovaton ([EMAIL PROTECTED]): or modify is_numeric() to explictly perform an integer validation: is_numeric(mixed value [, bool is_integer = false]) um.. ctype_digit(). Very nice! it works fine. The

RE: [PHP] Validating form field text input to be a specificvariab le type

2004-04-07 Thread Ford, Mike [LSS]
On 07 April 2004 15:48, William Lovaton wrote: I guess that works but every possible solution posted in this thread is a lot of lines of code to perform a simple validation. Uh -- how are: if(strcmp((int)$PageOptions['Default'],$PageOptions['Default'])==0) if

Re: [PHP] large file uploads

2004-04-07 Thread Raditha Dissanayake
Arthur Radulescu wrote: I have forgot to mention that I have tried this and modified the php.ini on a windows system but had no success. There is no error but the file does not get uploaded either. The error message is in your log file. Arthur -- Raditha Dissanayake.

Re: [PHP] Merge 2 XML files using PHP 4

2004-04-07 Thread Raditha Dissanayake
Gal wrote: Hello all, Does anyone here add some good experience of writing PHP script which is merging 2 XML files. Looks like this should go into an algorithms mailing list :-) in the mean time you might want to start looking at sax parser functions, and associated arrays in the php manual.

Re: [PHP] PHP based Voice Chat Module

2004-04-07 Thread Raditha Dissanayake
Pushpinder Singh wrote: Hello everyone, I was wondering if anyone has used any PHP/MySQL based voice chat system. (for MAC OS X Platform) What kind of voice chat are you talking about? are you refering to one user saying something into the microphone that the other users hears? If so php is

Re: [PHP] confused big time

2004-04-07 Thread Mark Ackroyd
I always found this way of inserting data into a database messy. Here is a handy function to do array inserts and it builds the sql for you. function arrayINSERT($a,$tablename) { $sql = INSERT INTO $tablename (; foreach($a as $key = $value)

Re: [PHP] Merge 2 XML files using PHP 4

2004-04-07 Thread Gal
Raditha Dissanayake wrote: Gal wrote: Hello all, Does anyone here add some good experience of writing PHP script which is merging 2 XML files. Looks like this should go into an algorithms mailing list :-) in the mean time you might want to start looking at sax parser functions, and

Re: [PHP] PHP based Voice Chat Module

2004-04-07 Thread Pushpinder Singh
Thanks Raditha, Yes we are primarily looking at a PHP chat module which will allow us conduct an audio conference. I know there are Flash Voice Chat versions but they are all for Windoze... we are primarily a MAC environment and our hosting company uses LINUX. Please advise on the best

Re: [PHP] confused big time

2004-04-07 Thread John W. Holmes
From: Mark Ackroyd [EMAIL PROTECTED] I always found this way of inserting data into a database messy. Here is a handy function to do array inserts and it builds the sql for you. function arrayINSERT($a,$tablename) { $sql = INSERT INTO $tablename (; foreach($a as $key = $value) { $sql

Re: [PHP] PHP based Voice Chat Module

2004-04-07 Thread Pushpinder Singh
Sorry I did not answer your question in my earlier reply, Thats right the user will use a headset and microphone to communicate. Thanks Pushpinder On Wednesday, April 7, 2004, at 12:06 PM, Raditha Dissanayake wrote: What kind of voice chat are you talking about? are you refering to

Re[2]: [PHP] confused big time

2004-04-07 Thread Richard Davey
Hello Mark, Wednesday, April 7, 2004, 5:16:04 PM, you wrote: MA it builds the sql statement for you. It covers 99.9% of the inserts MA your likely to need. I use an update and insert function like this all MA the time. :-) That .1% of the time being when you need to insert a value as now() ?

Re: [PHP] PHP based Voice Chat Module

2004-04-07 Thread Raditha Dissanayake
Pushpinder, 1 message is enough! (i recieved 6 messages from you 3 copies each of two messages.) As as i said PHP is not the best option you will have to look at varius commercial voice chat systems. possibly on google. Pushpinder Singh wrote: Sorry I did not answer your question in my

[PHP] PDF Page Pulling

2004-04-07 Thread Adam Voigt
I need to be able to pull a certain page out of a multi-page PDF, and then be able to save that single page to it's own PDF file. Anyone know how to do this with free tools? Thanks. -- Adam Voigt [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP] update mysql from php web page

2004-04-07 Thread Daniel Clark
For the submit button to work it has to be in a form. FORM ACTION=blah_blah.php METHOD=post INPUT TYPE=submit /FORM Hope this helps. Daniel Clark pcenterinput type=submit name=submit value=Update Data/center/p ... more code ... /table ? endif; ? /body /html

Re: [PHP] confused big time

2004-04-07 Thread Mark Ackroyd
RD That .1% of the time being when you need to insert a value as now() ? RD (which will break the string check as it'll wrap it with '' which will RD cause MySQL to insert -00-00 00:00:00) or if it's an enum field RD with a numeric allowed value? :) Not really, since you usally format a

Re: [PHP] PHP security in a hosting environment

2004-04-07 Thread Chris Shiflett
--- Ben Joyce [EMAIL PROTECTED] wrote: one of my clients whom we host a website for has expressed interest in writing their own php/mySQL applications for their site. i've been looking in to the security implications of offering this service. How are you not offering it now? Can the client

Re[2]: [PHP] confused big time

2004-04-07 Thread Richard Davey
Hello Mark, Wednesday, April 7, 2004, 6:19:31 PM, you wrote: RD That .1% of the time being when you need to insert a value as now() ? RD (which will break the string check as it'll wrap it with '' which will RD cause MySQL to insert -00-00 00:00:00) or if it's an enum field RD with a numeric

[PHP] Can someone with list access please remove these two?

2004-04-07 Thread Richard Davey
Hi, Subject says it all - they're causing auto-responder junk to any list poster and it's annoying: Information Desk [EMAIL PROTECTED] Advance Credit Suisse Bank [EMAIL PROTECTED] -- Best regards, Richard Davey http://www.phpcommunity.org/wiki/296.html -- PHP General Mailing List

Re: [PHP] confused big time

2004-04-07 Thread Mark Ackroyd
RD But now() IS a DB friendly format for MySQL and is the recommended RD way of inserting the current time into a datetime or timestamp RD field. But what about MsSQL, Oracle and postgres to name a few. I have worked on a few projects where you read from one db and load into another db. Dates

Re: [PHP] smarty

2004-04-07 Thread Chris de Vidal
John W. Holmes said: From: Chris de Vidal [EMAIL PROTECTED] Kelly Hallman said: Going even one step further (the beauty of Smarty: always another level), just extend the Smarty object itself. Then, instead of making all your templates includes other templates (such as a header or a

Re: [PHP] Validating form field text input to be aspecificvariable type

2004-04-07 Thread Red Wingate
Why not add a function: display_my_cms(); This function will check the current cirumstances and displays an CMS system which fits 100% in every enviroment and layout. Even if new technics are available those will suddenly appear ( maybe CSS3 ). [...] That's not bloat. And using a lot of

Re: [PHP] Validating form field text input to be a specificvariable type

2004-04-07 Thread Red Wingate
No, as this would be yet another line of source. Maybe get those guys to add another function ctype_digit_and_not_empty(); -- red [...] * Thus wrote William Lovaton ([EMAIL PROTECTED]): or modify is_numeric() to explictly perform an integer validation: is_numeric(mixed value [, bool

Re[2]: [PHP] confused big time

2004-04-07 Thread Richard Davey
Hello Mark, Wednesday, April 7, 2004, 6:35:31 PM, you wrote: MA But what about MsSQL, Oracle and postgres to name a few. I have worked MA on a few projects where you read from one db and load into another db. MA Dates then become the spawn of satan. But the MySQL syntax for insert is not the

Re: [PHP] confused big time

2004-04-07 Thread Red Wingate
You could even do: $sql .= ( '.implode( ',' , $a ).' ); This way everything is quoted though ( but this doesn't matter using MySQL anyway ). If you want to escape the values of $a you could use array_map to do this also without having to loop :-) -- red [...] To get your list of columns,

[PHP] Re: php + lynx + grep

2004-04-07 Thread Catalin Trifu
Hi, I had same problem myself once. Try adding the apache user to sudoers in /etc/sudoers if not already there Cheers, Catalin Brian L. Ollom [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] lynx --source http://weather.noaa.gov/weather/current/KTOL.html |grep -v

Re: [PHP] Re: php + lynx + grep

2004-04-07 Thread Michal Migurski
Try adding the apache user to sudoers in /etc/sudoers if not already there DANGER WILL ROBINSON. Don't add the Apache user to /etc/sudoers -- Apache's security model relies on that user being unprivileged. lynx --source http://weather.noaa.gov/weather/current/KTOL.html |grep -v

Re: [PHP] Can I get varaibles from an include file without exectuting it?

2004-04-07 Thread Daniel Clark
I agree, the only way I see it can be done is to read the include file in as Text, and parse it. I have a script that is run with a cronjob and would like to fetch some variables from it, using another file, without the script executing. I could resort to putting the variables in a third

Re: [PHP] regular expression

2004-04-07 Thread Curt Zirzow
* Thus wrote Robert Kornfeld ([EMAIL PROTECTED]): hey, professionals out there: i need to write a parser for an email-header to retrieve the email of the 'To:'-field. there are 2 possibilities: 'To: [EMAIL PROTECTED]' or 'To: first foo [EMAIL PROTECTED]' Actually the second one needs to

RE: [PHP] confused big time

2004-04-07 Thread Chris W. Parker
Andy B mailto:[EMAIL PROTECTED] on Tuesday, April 06, 2004 7:56 PM said: $query=insert into table values( '{$array['index1']['index2']}', '{$array[index2']['index3']}', //so on down the list ); if i understand the readable way right... no, not quite. here is how you should do it

Re: [PHP] update mysql from php web page

2004-04-07 Thread Chip Wiegand
Daniel Clark [EMAIL PROTECTED] wrote on 04/07/2004 10:17:36 AM: For the submit button to work it has to be in a form. FORM ACTION=blah_blah.php METHOD=post INPUT TYPE=submit /FORM Hope this helps. Daniel Clark Of course, I didn't notice I left that line out of my code, although I

Re: [PHP] smarty

2004-04-07 Thread Jochem Maas
Chris W. Parker wrote: Chris de Vidal mailto:[EMAIL PROTECTED] on Tuesday, April 06, 2004 11:43 AM said: I could have put a tag in the template like {bio} but that'd mean maintaining HTML in the PHP code which I wanted to avoid (left the prettyness to the Front Page developer). Instead, I

Re: [PHP] smarty

2004-04-07 Thread John W. Holmes
From: Chris de Vidal [EMAIL PROTECTED] Or are you saying: $pt = new MyPage; $pt-render('contact.tpl'); OR $pt = new MyPage; $pt -render('prices.tpl'); OR $pt = new MyPage; $pt-render('index.tpl'); I can see the benefit of this method if that's what you mean. That's what I meant. :) I

Re: [PHP] update mysql from php web page

2004-04-07 Thread Daniel Clark
Something I like to do during troubleshooting is to have the page display the SQL statement I'm processing. Something like: print sql_query ; That was I can verify all the parameters are correct. Do you have autocommit ON? Or need to pass a commit statement? Daniel Clark Of course, I

  1   2   >