RE: [PHP] file_exists

2002-05-06 Thread Craig Westerman

I found my problem.

>From manual:
"file_exists() will not work on remote files; the file to be examined must
be accessible via the server's filesystem. "

File is on another server. Is there a way to check if file exists on another
server?

Craig ><>
[EMAIL PROTECTED]


-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]


";
else
echo "";
}
?>


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[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
number 30. Is $file somehow retaining value of 30 and not getting new value
of 45 when script runs second time? What is it called when this happens?



Thanks

Craig ><>
[EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[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/02
[14] => 25/Mar/02
[15] =>)

Thanks

Craig ><>
[EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




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 the substr() function like Rasmus mentioned.

Tyler Longren
Captain Jack Communications
www.captainjack.com
[EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[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 to correct a poor count.

Thanks

Craig ><>
[EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[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 counter script will be reading this file, but
NOT writing to it. Will the file need to be locked while adding $newnumber
to it?

Thanks

Craig ><>
[EMAIL PROTECTED]



[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:  159291:
11/Mar/02: 1163018:  185106:

Dates removed

18/Apr/02: 1197460:  190362:
19/Apr/02: 1175128:  181756: <<< Need to grab this number daily
20/Apr/02: 188: 142:

Busiest day: 5/Feb/02 (130,779 requests for pages).

---

I need to grab the 19/Apr/02 count of 181756. But the date will change
daily. So it would need to always grab last number from second to last line.

Any suggestions?

Thanks

Craig ><>
[EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[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

Craig ><>
[EMAIL PROTECTED]



[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 traffic with little
added server load? Would using MySQL to store count be of any benifit?

Thanks

Craig ><>
[EMAIL PROTECTED]



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 CHMOD 777

Enter to your site via FTP and CHMOD your folder to 777 or rwxrwxrwx

Regards! Julian

- Original Message - 

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 to copy the file www.html

It appears to be a permission problem. How do I set permissions to allow me
to do this?

Thanks

Craig ><>
[EMAIL PROTECTED]





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[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 to copy the file www.html

It appears to be a permission problem. How do I set permissions to allow me
to do this?

Thanks

Craig ><>
[EMAIL PROTECTED]





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




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 remote website through PHP and only disp
lay one section of it?

Someone said something about curl. 
What is it, where could I get it?


Thanks for your help,
Liam



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[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 commas get turned into pluses. The multiple ticker URL for above tickers
is thus:
http://finance.yahoo.com/d/quotes.csv?s=msft+rhat+^dji&f=sl1d1t1c1ohgv&e=.cs
v

If I change $symbol = msft+rhat+^dji
How could I save all to a multi-dimensional array?

Thanks

Craig ><>
[EMAIL PROTECTED]



http://finance.yahoo.com/d/quotes.csv?s=$symbol&f=sl1d1t1c1ohgv&e=.csv";;
$fp = fopen($url , "r");
if (!fp)
{
echo "could not connect to the site";
}
else
{
$data = fgetcsv($fp,1000,",");
fclose($fp);

print_r($data);

?>




descriptionlatest figure
Market
last price
date
time
change
open
high
low





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] image creation to file

2002-03-06 Thread Craig Westerman

Hi Tom,

At first it didn't work. I had to create a blank png image in Photoshop and
uploaded it. I then changed file permissions and then the image creation
worked. Is there a way to write to test.png when it doesn't already exist
and file permissions are set?

Thanks for your help.

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 = ImageColorAllocate($im, 255, 0, 0);
>ImageFill($im, 100, 100, $red);
>ImagePNG($im);
>?>
>
>
>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, visit: http://www.php.net/unsub.php




[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, visit: http://www.php.net/unsub.php




RE: [PHP] data from service into array

2002-03-06 Thread Craig Westerman

Thanks Jim. Works like a charm. Real sweet.

Would you explain what this line does?

   $out[$m[1]] = $m[2];

Learning is a real blast. Wish I would have jumped in a couple of years ago.
Thanks again.

Craig ><>
[EMAIL PROTECTED]


-Original Message-
From: Jim Winstead [mailto:[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 reference books yet. I did create a PHP script that is
> usable (see below), but there has to be a more efficient way to do it with
> PHP. I'll hunt up your post on XML in the archives after I get a XML book.

the example you provided isn't xml. (it has some resemblance, but it isn't
xml.) here's a code snippet that will turn that format into an array:

$fp = fopen($url,"r");
if (!$fp) die("could not open URL");
$out = array();
while (!feof($fp)) {
  $line = fgets($fp,512);
  if (preg_match('!<(\w+?)>(.*?)!', $line, $m)) {
$out[$m[1]] = $m[2];
  }
}
fclose($fp);

print_r($out);

jim

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] data from service into array

2002-03-06 Thread Craig Westerman

>Is anything hindering you from using XML expat? You can use that to do it.
>I already post a mail on this, search in the archive for xml related
>posts.

***

This is 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

I'm just now trying to learn PHP. I don't know ANYTHING about XML. I don't
even have any XML reference books yet. I did create a PHP script that is
usable (see below), but there has to be a more efficient way to do it with
PHP. I'll hunt up your post on XML in the archives after I get a XML book.

Thanks

Craig ><>
[EMAIL PROTECTED]


http://www.PAIDDATAPROVIDER.com/services/quote.cgi?quote=".$symbol;
  if (!($fp = fopen($url, "r")))
  {
echo "Could not open URL";
exit;
  }
  $rawdata = fread($fp, 1);
  fclose($fp);

$pricepattern = "((.*))";
  if (eregi($pricepattern, $rawdata, $price))

$datepattern = "((.*))";
  if (eregi($datepattern, $rawdata, $date))

$timepattern = "((.*))";
  if (eregi($timepattern, $rawdata, $time))

$changepattern = "((.*))";
  if (eregi($changepattern, $rawdata, $change))

$openpattern = "((.*))";
  if (eregi($openpattern, $rawdata, $open))

$highpattern = "((.*))";
  if (eregi($highpattern, $rawdata, $high))

$lowpattern = "((.*))";
  if (eregi($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 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/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

<[EMAIL PROTECTED]>
---
We must use time wisely and forever realize that the time is
always ripe to do right."

-- Nelson Mandela
---


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[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/)
To unsubscribe, visit: http://www.php.net/unsub.php




[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

OK, changing from post to get gets me what I'm after. Thanks guys. Something
odd though.

If I type in RHAT and hit enter, I get this URL which is what I want.
quotestest.php?quote=RHAT

If I type in RHAT and click submit button, I get this URL which I don't
like.
quotestest.php?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 8:07 PM
To: Craig Westerman; php-general-list
Subject: Re: [PHP] form variables


hi
Use 
This will work as long as the form is not too big
Tom



  




  


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




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


On Mon, 4 Mar 2002, Craig Westerman wrote:

>  
>
>
>
>
>  
>
>
>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?




--
---
Greg Donald - http://destiney.com/
http://phprated.com/ | http://phplinks.org/ | http://phptopsites.com/
---



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[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:
"(]+>.*){6}(]+>)([ ]*)(]*>)(.*){2}(]*>)(.*)"

-


Bas,

Thanks for the reply. I can easily grab this test page
http://www.gold-forum.com/table.html using this script. (shown below)
http://www.gold-forum.com/grab2.php

When I try replacing $GrabStart = ""; with your $GrabStart =
"(]+>.*){6}(]+>)([ ]*)(]*>)(.*){2}(]*>)(.*)";
I get errors.

If you have time, can you show me what I need for:

$GrabStart = "???"; //3rd opening table row  tag after the 7th opening
 tag
$GrabEnd = "???"; //3rd closing table row  tag after the 7th closing
 tag

Thanks

Craig ><>
[EMAIL PROTECTED]


code start-


Grab 2 Example




http://www.gold-forum.com/table.html";;
$GrabStart = ""; //need 3rd opening table row  tag after the 7th
opening  tag
$GrabEnd = ""; //need 3rd closing table row  tag after the 7th
closing  tag

$file = fopen("$GrabURL", "r");
$rf = fread($file, 20);
$grab = eregi("$GrabStart(.*)$GrabEnd", $rf, $printing);
fclose($file);
echo $printing[1];
?>





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[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 PROTECTED]



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/manual_Tutorial.html#Tuto
rial

PHP 101 (Part 1 - 5)
http://www.devshed.com/Server_Side/PHP/PHP101/PHP101_1/print
http://www.devshed.com/Server_Side/PHP/PHP101/PHP101_2/print
http://www.devshed.com/Server_Side/PHP/PHP101/PHP101_3/print
http://www.devshed.com/Server_Side/PHP/PHP101/PHP101_4/print
http://www.devshed.com/Server_Side/PHP/PHP101/PHP101_5/print

Best regards,

Craig ><>
[EMAIL PROTECTED]

-Original Message-
From: Josiah Wallingford [mailto:[EMAIL PROTECTED]]
Sent: Saturday, March 02, 2002 7:16 PM
To: [EMAIL PROTECTED]
Subject: [PHP] PHP - Tutorial


Hello all,
I am a beginner of php/mysql and am looking for good books for beginners
and mostly good online php tutorials. Anybody have any suggestions?





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[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
***



 
 
  
  
   http://a676.g.akamaitech.net/f/676/838/1h/nasdaq.com/logos/DROO.GIF";
border="0" align="absmiddle" height="40"> 
  
  Durban
Roodeport Deep, Ltd. DROOY
  
  
  Mar. 1, 2002 Market Closed
  




 
 
  
  Last Sale:
  $ 2.76
   
  Net Change:
   0.02http://a676.g.akamaitech.net/7/676/838/b801fe1d2351e8/nasdaq.com/images
/nc_down.gif" border="0" width="11"
height="10">  0.72% 
   
  
   
  http://www.nasdaq.com/asp/offsite_quotes.asp?symbol=DROOY%60&selected=
DROOY%60&content=http://www.drd.co.za";>http://a676.g.akamaitech.net/f/676/838/1d/nasdaq.com/images/new_weblink
s.gif" border="0">  http://www.nasdaq.com/asp/offsite_quotes.asp?symbol=DROOY%60&selected=
DROOY%60&content=http://www.drd.co.za"; class="clsA">Web Site
   
  
  
  
  Today's High:
  $ 2.80
   
  Today's Low:
  $ 2.64
  
  
  Best Bid:
  $ 2.75
   
  Best Ask:
  $ 2.76
  
  
  Volume:
  1,551,300
   
  Previous Close:
  $ 2.78
  
  
  Market:
  Nasdaq-SCM
   
  American Depositary Shares
  
 





[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 PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] mysql php - while loops

2002-02-27 Thread Craig Westerman

Thanks for the reply. This is what I came up with and it appears to work.
Thoughts?

Craig ><>
[EMAIL PROTECTED]


$count = 1;
while ($data = mysql_fetch_array($results))
{

?>
 -  -
 - 
mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 26, 2002 6:51 PM
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 PROTECTED]]
Sent: Wednesday, February 27, 2002 11:43 AM
To: php-general-list
Subject: [PHP] mysql php - while loops


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: http://www.php.net/unsub.php




[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: http://www.php.net/unsub.php




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

2002-02-25 Thread Craig Westerman

Joe,

I don't want to change the query itself like you show. I want to use this
query

$query = ""
mysql_query("SELECT * FROM table WHERE date LIKE '%". $query ."%'");

and change only the variable $query = ""

I use $query throughout script for other things.

Thanks

Craig ><>
[EMAIL PROTECTED]


Hi there :)

1. mysql_query("SELECT * FROM table WHERE date ='$mydate'");   # where date
is same
2. mysql_query("SELECT * FROM table WHERE date > '$mydate'");  # where date
is newer
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 :)



"Craig Westerman" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> $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 variable to include all dates newer than
> 1995-01-01?
> $query = "???"
>
> What is proper way to define a variable to include all dates older than
> 1995-01-01?
> $query = "???"
>
> What is proper way to define a variable to include all  dates between
> 1995-01-01 and 1998-12-31?
> $query = "???"
>
>
> Everything I tried gives me a error. This has to be simple, but I must be
> overlooking something. Where would I find the answer?
>
> Thanks
>
> Craig ><>
> [EMAIL PROTECTED]
>



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[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 variable to include all dates newer than
1995-01-01?
$query = "???"

What is proper way to define a variable to include all dates older than
1995-01-01?
$query = "???"

What is proper way to define a variable to include all  dates between
1995-01-01 and 1998-12-31?
$query = "???"


Everything I tried gives me a error. This has to be simple, but I must be
overlooking something. Where would I find the answer?

Thanks

Craig ><>
[EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[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
.55


pear
.38
.51


apple
.59
.33




===

The fruit lables don't change, but prices change daily.
How would I parse JUST the two prices to the right of the word pear into a
new html table?

How would I parse the word pear AND the two prices to the right into a new
html table?
I think the answers will help me understand better.
Thanks
Craig ><>
[EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[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
.33



===

The fruit lables don't change, but prices change daily.
How would I parse JUST the two prices to the right of the word pear into a
new html table?

How would I parse the word pear AND the two prices to the right into a new
html table?

I think the answers will help me understand better.

Thanks

Craig ><>
[EMAIL PROTECTED]



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 running php as a cgi ;-)

nice uptime btw...
-- 
Andreas D Landmark / noXtension


I'm running FreeBSD. I'll see if if I can find source as you suggest. 

Thanks

Craig ><>
[EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




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 average data displayed when you run
uptime not how many days it has been running.

%uptime
 6:10PM  up 321 days,  6:59, 3 user, load averages: 0.20, 0.16, 0.15
%uptime
 6:19PM  up 321 days,  7:08, 3 user, load averages: 0.15, 0.16, 0.16
%uptime
10:15PM  up 321 days, 11:04, 3 user, load averages: 0.19, 0.24, 0.22

Craig ><>
[EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[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_string, $head);
echo $head[0];
?>

It prints out:
PHP: Hypertext Preprocessor

How do I modify this to get what is between the TITLE tags and not include
the TITLE tags?

Thanks

Craig ><>
[EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




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 notepad.



Include Abbreviated File












Thanks

Craig ><>
[EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]