RE: [PHP] file_exists

2002-05-06 Thread Craig Westerman
ED] -Original Message- From: Craig Westerman [mailto:[EMAIL PROTECTED]] Sent: Monday, May 06, 2002 7:58 PM To: php-general-list Subject: [PHP] file_exists What am I doing wrong? I get parse error between first echo statement and else. Thanks Craig ><> [EMAIL PROTECTED] &q

[PHP] file_exists

2002-05-06 Thread Craig Westerman
What am I doing wrong? I get parse error between first echo statement and else. Thanks Craig ><> [EMAIL PROTECTED] "; else echo ""; } ?> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] odd behavior

2002-04-30 Thread Craig Westerman
When I run this the first time, file.txt contains value of 30. Then I add 15 to it with following script and file now contains value of 45. I look at file.txt after write and it does indeed contain number 45. But when I run script 24 hours later via cron job, it still thinks file.txt is holding nu

[PHP] Removing empty elements from an array

2002-04-28 Thread Craig Westerman
I have an array that contains several empty elements. What is simplest way to remove these elements? Array ( [0] => [1] => [2] => [3] => 16/Mar/02 [4] => [5] => 17/Mar/02 [6] => 18/Mar/02 [7] => 19/Mar/02 [8] => 20/Mar/02 [9] => 21/Mar/02 [10] => 22/Mar/02 [11] => 23/Mar/02 [12] => [13] => 24/Mar

RE: [PHP] remove last character in a string

2002-04-22 Thread Craig Westerman
Wouldn't it be better to check to see if charicater is indeed a comma before removing it? I was guessing eregi_replace would be the way to go. Am I thinking wrong? Craig ><> [EMAIL PROTECTED] First, you'll need to get the length of the str with the str_len() function. After you have that, use

[PHP] remove last character in a string

2002-04-22 Thread Craig Westerman
I have a string that ends in a comma. What is best method to remove the comma? Craig ><> [EMAIL PROTECTED]

[PHP] adding numbers to a file

2002-04-22 Thread Craig Westerman
I have a simple count file named count_db that contains ONLY the following: { 'total' => 3954 } How do I open file, find numbers in the file, add $newnumbers to existing numbers. Then write these new numbers over the original numbers and close the file. I'm just needing to do this once a day

[PHP] adding numbers in a text file

2002-04-21 Thread Craig Westerman
I have a simple count file named count_db that contains ONLY the following: { 'total' => 3954 } I need to open file, find numbers in the file, add $newnumbers to existing numbers. Then write these new numbers over the original numbers and close the file. Also while I'm doing this a coun

[PHP] grab a number

2002-04-20 Thread Craig Westerman
I get the following report from Analog. Daily Report (Go To: Top: Monthly Report: Daily Report: Request Report) This report lists the activity in each day. Each unit () represents 3,000 requests for pages or part thereof. date: reqs: pages: -: ---: ---: 10/Mar/02: 1109810:

[PHP] Pass variables via URL

2002-04-11 Thread Craig Westerman
I'm trying to set $image = imageA via a URL: http://www.abc123.com/php001/image_switch.php?image=imageA Script is: Image Switch Image link ends up as: http://www.abc123.com/php001/.gif Link needs to be: http://www.abc123.com/php001/imageA.gif What am I doing wrong? Thanks Crai

[PHP] counter for HIGH traffic site

2002-04-06 Thread Craig Westerman
I'm needing counter for site that receives 60 to 80 hits a minute. Many I have tried cause excessive server load and need to be deactivated or they lose data and return to zero without warning. All tried so far have been written in Perl. Anyone here know of a PHP counter that would handle HIGH tr

RE: [PHP] php - copy problem

2002-04-03 Thread Craig Westerman
I did that first thing. Also tried chmod g+rwx I can copy manually via Telnet, but something is wrong with my PHP script. Thanks Craig ><> [EMAIL PROTECTED] -Original Message- From: Julian [mailto:[EMAIL PROTECTED]] Hi! You must to set the folder where you want to save the file to

[PHP] php - copy problem

2002-04-03 Thread Craig Westerman
I'm trying to copy daily Analog Stats Report to a archive file. (see code below) Destination file doesn't exist. I get this error: Warning: Unable to create '030402.html': Permission denied in /usr/www/users/cfth/WWW_REPORTS/analogarchive.php on line 9 /WWW_REPORTS/analogarchive.php:Error failed

RE: [PHP] Retreiving website contents

2002-03-24 Thread Craig Westerman
http://curl.haxx.se/libcurl/php/examples/ -Original Message- From: Liam [mailto:[EMAIL PROTECTED]] Sent: Saturday, March 23, 2002 9:57 AM To: [EMAIL PROTECTED] Subject: [PHP] Retreiving website contents Hi, I've asked this before but I'm still ost. How can I receive the contents of a

[PHP] PHP Developer's Cookbook, Second Edition

2002-03-23 Thread Craig Westerman
Is the second edition much different from the 1st? If one has 1st Edition, is it worth $39.95 to get the second? Thanks Craig ><> [EMAIL PROTECTED]

[PHP] data to multi-dimensional array

2002-03-07 Thread Craig Westerman
Thanks again for your help last night Jim. I found another source that by passes the middle man and this script (see below) is quicker. It works great for ONE ticker symbol. Yahoo allows one to retrieve multiple quotes by typing in comma separated tickers with no spaces.msft,rhat,^dji The com

RE: [PHP] image creation to file

2002-03-06 Thread Craig Westerman
lp. Craig ><> [EMAIL PROTECTED] Hi use ImagePNG($im,"test.png") Tom At 12:17 PM 7/03/2002, Craig Westerman wrote: >The following creates a red rectangle png image > >Header("Content-Type: image/png"); >$im = ImageCreate(500, 75); >$red = ImageColorAl

[PHP] image creation to file

2002-03-06 Thread Craig Westerman
The following creates a red rectangle png image This sends created image to browser ImagePNG($im); How would I save this image as test.png to file to be hard coded in static web pages? Thanks Craig ><> [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, v

RE: [PHP] data from service into array

2002-03-06 Thread Craig Westerman
to:[EMAIL PROTECTED]] Sent: Wednesday, March 06, 2002 4:23 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] data from service into array Craig Westerman <[EMAIL PROTECTED]> wrote: > I'm just now trying to learn PHP. I don't know ANYTHING about XML. I don't > even have any XML ref

RE: [PHP] data from service into array

2002-03-06 Thread Craig Westerman
egi($lowpattern, $rawdata, $low)) $volumepattern = "((.*))"; if (eregi($volumepattern, $rawdata, $volume)) ?> On Tue, 5 Mar 2002, Craig Westerman wrote: > I'm retrieving data from a data service. > This is the ENTIRE source code of the URL they let me recei

[PHP] data from service into array

2002-03-05 Thread Craig Westerman
I'm retrieving data from a data service. This is the ENTIRE source code of the URL they let me receive: RHAT 6.82 3/4/2002 3:59pm 0.32 6.59 6.99 6.53 932400 How can I insert the data values into an array ? Thanks Craig ><> [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net

[PHP] data into an array

2002-03-04 Thread Craig Westerman
I'm retrieving data from a service. The data is in the following format. RHAT 6.82 3/4/2002 3:59pm 0.32 6.59 6.99 6.53 932400 How can I insert the data values into an array? Thanks Craig ><> [EMAIL PROTECTED]

RE: [PHP] form variables

2002-03-04 Thread Craig Westerman
quote=RHAT&submitquote=Get+Quote How do I get rid of the extra&submitquote=Get+Quote in the URL? Why is enter and submit acting differently? Thanks Craig ><> [EMAIL PROTECTED] -Original Message- From: Tom Rogers [mailto:[EMAIL PROTECTED]] Sent: Monday, March 04, 2002

RE: [PHP] form variables

2002-03-04 Thread Craig Westerman
Thanks Donald, I tried that before and this is URL returnedquotestest.php?quote= Craig ><> [EMAIL PROTECTED] -Original Message- From: Greg Donald [mailto:[EMAIL PROTECTED]] Sent: Monday, March 04, 2002 7:17 PM To: Craig Westerman Cc: php-general-list Subject: Re: [

[PHP] form variables

2002-03-04 Thread Craig Westerman
The above form passes $quote to the page quotestest.php How can I also pass the $quote to the URL so that the page with variable can be bookmarked? Do I have to modify both pages or just the input form? Thanks Craig ><> [EMAIL PROTECTED]

RE: [PHP] Real world regex

2002-03-04 Thread Craig Westerman
-Original Message- From: Bas Jobsen [mailto:[EMAIL PROTECTED]] Sent: Monday, March 04, 2002 8:55 AM To: Craig Westerman; php-general-list Subject: Re: [PHP] Real world regex > For another I need to get the 3rd opening table row tag after the 7th > opening tag. not tested: &quo

[PHP] Real world regex

2002-03-04 Thread Craig Westerman
I'm trying to understand how to write a regex when the only pattern is table tags. For one I need to figure out how to match the opening tag of the 4th html table on a page. For another I need to get the 3rd opening table row tag after the 7th opening tag. Thanks Craig ><> [EMAIL PROTECTE

RE: [PHP] PHP - Tutorial

2002-03-02 Thread Craig Westerman
Here is three excellent tutorials. Follow through each, step by step and you will be in the game. Building a Database-Driven Web Site Using PHP and MySQL http://www.mysql.com/articles/ddws/index.html Introduction to MySQL: A MySQL Tutorial http://www.mysql.com/documentation/mysql/bychapter/manua

[PHP] fopen

2002-03-02 Thread Craig Westerman
How can I use fopen to retrieve just one html table out of a whole web page. I need to extract just this table (shown below) from this web page: http://quotes.nasdaq.com/quote.dll?page=multi&mode=stock&symbol=drooy Thanks Craig ***

[PHP] excluding files

2002-02-28 Thread Craig Westerman
while ($file_name = readdir($dir)) if (($file_name != ".") && ($file_name != "..")) $file_list .= "$file_name"; } This excludes . and .. files. How would I exclude files that contained pv. Thus filenamepv.html would be excluded, but filename.html would not? Thanks Craig ><> [EMAIL PROT

RE: [PHP] mysql php - while loops

2002-02-27 Thread Craig Westerman
M To: 'Craig Westerman'; php-general-list Subject: RE: [PHP] mysql php - while loops with a bit of cheating... use a table... (nb: this code not tested, but logic has) " ?> - - "; $i++; } ?> -Original Message- From: Craig Westerman [mailto:[EMAIL PROTECTE

[PHP] PHP on Pocket PC

2002-02-27 Thread Craig Westerman
Is it possible to run PHP on a Pocket PC? Thanks CW

[PHP] mysql php - while loops

2002-02-26 Thread Craig Westerman
The following lists 12 items from a fruits table. $results = mysql_query("SELECT ID, date, appleprice, orangeprice, pearprice FROM fruits"); while ($data = mysql_fetch_array($results)) { ?> - - - <> [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

RE: [PHP] Re: php - assigning date variables

2002-02-25 Thread Craig Westerman
3. mysql_query("SELECT * FROM table WHERE date < '$mydate'"); # where date is older 4.mysql_query("SELECT * FROM table WHERE date BETWEEN '$myfirstdate' AND '$myseconddate'"); # where date is between 2 dates Hope this helps, Joe :) &quo

[PHP] php - assigning date variables

2002-02-25 Thread Craig Westerman
$query = "" mysql_query("SELECT * FROM table WHERE date LIKE '%". $query ."%'"); // returns all items in database $query = "2001-01-01" mysql_query("SELECT * FROM table WHERE date LIKE '%". $query ."%'"); // returns all rows that have 2001-01-01 as the date What is proper way to define a varia

[PHP] Wide Image Scroller

2001-08-26 Thread Craig Westerman
I have a very wide panoramic image I want to display on a page. I don't want to side scroll the page, only the image. Is there a way to make a image side scrollable using PHP? Thanks Craig ><> [EMAIL PROTECTED]

[PHP] Need Regex Help

2001-08-18 Thread Craig Westerman
I'm reading a book and have a little confusion in my mind. Consider the following table. Assume that I grabbed it from another web site using: http://www.abc123xyz.com'; $lines_array = file($url); $lines_string = implode('', $lines_array); ?> === banana .46

[PHP] Regular Expression ? from newbie

2001-08-16 Thread Craig Westerman
Consider the following table that I grabbed from another web site using: http://www.abc123xyz.com'; $lines_array = file($url); $lines_string = implode('', $lines_array); ?> === banana .46 .55 pear .38 .51 apple .59

RE: [PHP] Uptime script

2001-08-06 Thread Craig Westerman
>I'm wanting to chart the server load average data displayed when you run The correct way to do that would be to read it straight from the source, (eg. /proc/loadav for linux with procfs). That would be much quicker, and it would also save your server a fork for each reading (unless you are runni

RE: [PHP] Uptime script

2001-08-06 Thread Craig Westerman
>>Does anyone here have a script to run uptime every ten minutes or so, log >>output, then display daily output in a nice friendly chart? >Seems a bit daft running it every ten minutes, as a server should be up 24/7, >how do you plan to check it otherwise? I'm wanting to chart the server load a

[PHP] Uptime script

2001-08-06 Thread Craig Westerman
Does anyone here have a script to run uptime every ten minutes or so, log output, then display daily output in a nice friendly chart? Thanks Craig ><> [EMAIL PROTECTED]

[PHP] Parsing question from newbie

2001-08-05 Thread Craig Westerman
I found this little script called grab'n & pars'n on the net. It looks like it could be very useful to learn how it does what it does. While studying it I came up with a question. http://www.php.net'; $lines_array = file($url); $lines_string = implode('', $lines_array); eregi("(.*)", $lines_strin

RE: [PHP] ? about PHP includes

2001-08-03 Thread Craig Westerman
OPen the file and read in the required number of characters (short explanation). Have a look at the file handling functions. -- David Robley Thanks David, I came up with this, but it doesn't work. Does text file need to be in a special format? It is 4 paragraphs of plain text created in notepa