[PHP] File reading code2

2007-01-06 Thread Delta Storm
Hi, Can someone make me an example of simple reading a *.txt file on a hard drive and displaying that file with a echo command or some loop or anything path to file: (C:\Program Files\XAMPP\xampp\htdocs\test_folder\test1.txt) btw the script is in this folder to. Full code please. Thanks

RE: [PHP] File reading code2

2007-01-06 Thread Peter Lauri
This just dumps the content to the browsers. You could use file() instead if you want to loop thru every line. $file = test1.txt; if(file_exists($file)) { if(is_readable($file)) { if($file_content = get_file_contents($file)) { echo pre;

Re: [PHP] newbie question regarding URL parameters

2007-01-06 Thread Robert Cummings
On Sat, 2007-01-06 at 13:31 +1100, Ryan Fielding wrote: Robert Cummings wrote: On Fri, 2007-01-05 at 20:57 -0500, Jim the Standing Bear wrote: Hello, I have a newbie question regarding URL parameters. The PHP script I wrote need to read parameters passed in from a URL, so as an

[PHP] convert w date to l format

2007-01-06 Thread Steven Macintyre
Um ... can anyone point me to somewhere that it explains this ... I am trying to convert a int (1 through 7) to a day name (Monday through Friday) while in a loop with mysql results I have tried $day = date('w', $day); But this does not seem to work ... can anyone assist? Kind Regards,

Re: [PHP] convert w date to l format

2007-01-06 Thread Stut
Steven Macintyre wrote: Um ... can anyone point me to somewhere that it explains this ... I am trying to convert a int (1 through 7) to a day name (Monday through Friday) while in a loop with mysql results What happened to the weekend? I'd hate to lose the weekend!! I have tried $day =

Re: [PHP] convert w date to l format

2007-01-06 Thread Robert Cummings
On Sat, 2007-01-06 at 14:46 +0200, Steven Macintyre wrote: Um ... can anyone point me to somewhere that it explains this ... I am trying to convert a int (1 through 7) to a day name (Monday through Friday) while in a loop with mysql results I have tried $day = date('w', $day); But this

Re: [PHP] convert w date to l format

2007-01-06 Thread Robert Cummings
On Sat, 2007-01-06 at 12:59 +, Stut wrote: Steven Macintyre wrote: Um ... can anyone point me to somewhere that it explains this ... I am trying to convert a int (1 through 7) to a day name (Monday through Friday) while in a loop with mysql results What happened to the weekend?

Re: [PHP] convert w date to l format

2007-01-06 Thread Jochem Maas
Robert Cummings wrote: On Sat, 2007-01-06 at 14:46 +0200, Steven Macintyre wrote: Um ... can anyone point me to somewhere that it explains this ... I am trying to convert a int (1 through 7) to a day name (Monday through Friday) while in a loop with mysql results I have tried $day =

[PHP] Access array data in foreach?

2007-01-06 Thread William Stokes
Hello, I Have an array $toplevel containing arrays: Array ( [0] = Array ( [0] = 1 [1] = 1 [2] = eka [3] = eka.php ) [1] = Array ( [0] = 2 [1] = 1 [2] = toka [3] = toka.php ) [2] = Array (

Re: [PHP] Access array data in foreach?

2007-01-06 Thread Casey Chu
$value holds the value of the current array element. On 1/6/07, William Stokes [EMAIL PROTECTED] wrote: Hello, I Have an array $toplevel containing arrays: Array ( [0] = Array ( [0] = 1 [1] = 1 [2] = eka [3] = eka.php ) [1] = Array (

Re: [PHP] Access array data in foreach?

2007-01-06 Thread William Stokes
Uh. (Embarrassed) Thanks anyway!! -W Casey Chu [EMAIL PROTECTED] kirjoitti viestissä:[EMAIL PROTECTED] $value holds the value of the current array element. On 1/6/07, William Stokes [EMAIL PROTECTED] wrote: Hello, I Have an array $toplevel containing arrays: Array ( [0] = Array (

[PHP] Windows directory listings

2007-01-06 Thread Beauford
Hi, I am trying to write a script that reads a directory on Windows. All the PHP functions I have looked at all seem to work with the Linux dietary structure. Is there another way to do this. Thanks -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

[PHP] Uninitialized string offset: 0

2007-01-06 Thread Albert Padley
I have the following class that generates a Notice: Uninitialized string offset: 0 each time it is called. The lines generating the notice are marked. How do I fix this? class InputFilter { var $tagsArray; var $attrArray; var $tagsMethod; var $attrMethod;

Re: [PHP] Uninitialized string offset: 0

2007-01-06 Thread Dave Goodchild
Can you show us what you're calling it with? Al Padley -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- http://www.web-buddha.co.uk

Re: [PHP] Uninitialized string offset: 0

2007-01-06 Thread Albert Padley
Sure. $myFilter = new InputFilter('','',0,0); $_POST = $myFilter-process($_POST); BTW - for what I'm trying to do at the moment, if I change the first line to: $myFilter = new InputFilter(); it takes care of the Notice problem. Thanks. Al On Jan 6, 2007, at 12:36 PM, Dave Goodchild

Re: [PHP] Uninitialized string offset: 0

2007-01-06 Thread Robert Cummings
On Sat, 2007-01-06 at 12:43 -0700, Albert Padley wrote: Sure. $myFilter = new InputFilter('','',0,0); The first two parameters should be arrays (not strings as you have above). Cheers, Rob. -- .. | InterJinn Application Framework -

Re: [PHP] Uninitialized string offset: 0

2007-01-06 Thread Albert Padley
Ah, of course. Thanks. Al On Jan 6, 2007, at 12:57 PM, Robert Cummings wrote: On Sat, 2007-01-06 at 12:43 -0700, Albert Padley wrote: Sure. $myFilter = new InputFilter('','',0,0); The first two parameters should be arrays (not strings as you have above). Cheers, Rob. --

[PHP] PHP Sockets - How to detect client disconnection?

2007-01-06 Thread Anthony Rasmussen
How do I detect a disconnected client from a socket resource? In an infinite loop, I socket_read() every open resource that passes a socket_select(). As far as I know, the only way to detect if the client disconnected unexpectedly from their socket resource is when socket_read() returns

RE: [PHP] PHP Sockets - How to detect client disconnection?

2007-01-06 Thread Aras
I used Process Control Functions in PHP and installed some signals to catch socket disconnection. My attempt to do this in loops were a harder way or i could not manage it. There must be some notes about this in archives or i can send some of my code so that you can have a look at them. Aras

[PHP] reading/editing php file with php script

2007-01-06 Thread jekillen
Hello; I have been writing a php script which is supposed to open and edit a php file on the same server, in the same directory. But I have not been able to get regex as in function ereg() to work to match a line of code to alter. I also have not been able to get strpos() to work in this code.

[PHP] Search script problem

2007-01-06 Thread Wikus Moller
Hi. I am having problems with a script I wrote which searches keywords from a field in a mysql db table. It is a very simple, one-page script. My site is a toplist, very basic, still in it's infancy. When I go to the page, key in the keywords and press submit, the head, body etc. part of the

[PHP] Re: Search script problem

2007-01-06 Thread Wikus Moller
And the hits_in of the mysql query are the same, I just made a typing mistake. On 1/7/07, Wikus Moller [EMAIL PROTECTED] wrote: Hi. I am having problems with a script I wrote which searches keywords from a field in a mysql db table. It is a very simple, one-page script. My site is a toplist,

[PHP] Re: Search script problem

2007-01-06 Thread Wikus Moller
So it should be like this (it still doesn't show the results): ?php echo ?xml version=\1.0\ encoding=\UTF-8\?; echo !DOCTYPE HTML PUBLIC \-//W3C//DTD XHTML Mobile 1.0//EN\ \http://www.wapforum.org/DTD/xhtml-mobile10.dtd\;; echo html xmlns=\http://www.w3.org/1999/xhtml\;; error_reporting(E_ALL

RE: [PHP] Re: Search script problem

2007-01-06 Thread Peter Lauri
Have you tried to catch (echo) the query you try to execute in mysql and then debug it from there? I saw that you in your code did all in one row. Separate it to: $Query = your query; echo $Query; //Use this in phpMyAdmin or any other MySQL administrator and see if the query is correct. If you

Re: [PHP] reading/editing php file with php script

2007-01-06 Thread Robert Cummings
On Sat, 2007-01-06 at 15:12 -0800, jekillen wrote: Hello; I have been writing a php script which is supposed to open and edit a php file on the same server, in the same directory. But I have not been able to get regex as in function ereg() to work to match a line of code to alter. I also

Re: [PHP] php, curl and aol addressbook import problem

2007-01-06 Thread Richard Lynch
On Fri, January 5, 2007 10:31 pm, Iqbal Naved wrote: I am desparately looking for a solution for importing address book from aol webmail to my browser. I found some commercial solution (such as, http://svetlozar.net) which was done using cURL. But couldnt find any php classes to implement