php-windows Digest 13 Jan 2001 11:53:40 -0000 Issue 394

Topics (messages 4959 through 4965):

Re: problem with checkdate ()
        4959 by: Asendorf, John
        4960 by: Cynic

Re: Simple question that I can't find the answer to
        4961 by: Daniel Beulshausen

gd under win98
        4962 by: guy roggemans

DOM
        4963 by: James Duncan
        4964 by: Alain Samoun

PHP Editor
        4965 by: James Brash

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------


sorry folks, fixed it already...  thanks anyway

---------------------
John Asendorf - [EMAIL PROTECTED]
Web Applications Developer
http://www.lcounty.com - NEW FEATURES ADDED DAILY!
Licking County, Ohio, USA
740-349-3631

The benefit to the government of replacing all $1 Federal Reserve notes with
$1 coins would be $522.2 million per year, according to estimates of the
General Accouting Office released on April 7, 2000.


> -----Original Message-----
> From: Asendorf, John [mailto:[EMAIL PROTECTED]]
> Sent: Friday, January 12, 2001 4:22 PM
> To: Php-Windows (E-mail)
> Subject: [PHP-WIN] problem with checkdate ()
> 
> 
> I'm trying to check a date... the date is saved as dd-Mon-YY
> 
> the following code: 
> 
> $frmdatecheck = date ("j, n, Y", strtotime ( $FROMdate ) );
> 
> if ( !checkdate ( $frmdatecheck ) ) {  }
> 
> gives me the following error
> 
> Warning: Wrong parameter count for checkdate() in
> D:\root\cc\resolutions\res_search.php on line 621
> 
> checkdate is defined as
> int checkdate (int month, int day, int year)
> 
> any suggestions?
> 
> Thanks in advace,   John
> 
> 
> ---------------------
> John Asendorf - [EMAIL PROTECTED]
> Web Applications Developer
> http://www.lcounty.com - NEW FEATURES ADDED DAILY!
> Licking County, Ohio, USA
> 740-349-3631
> 
> The benefit to the government of replacing all $1 Federal 
> Reserve notes with
> $1 coins would be $522.2 million per year, according to 
> estimates of the
> General Accouting Office released on April 7, 2000.
> 
> 
> -- 
> PHP Windows 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]
> 




what about this:

$frmdatecheck = date ("j/n/Y", strtotime ( $FROMdate ) );

if( ! checkdate( list( $j , $n , $y ) = explode( '/' , $frmdatecheck ) ) )

or rather:

if( ! call_user_func_array( 'checkdate' , explode( '/' , $frmdatecheck ) ) )

At 22:21 12.1. 2001, Asendorf, John wrote the following:
-------------------------------------------------------------- 
>I'm trying to check a date... the date is saved as dd-Mon-YY
>
>the following code: 
>
>$frmdatecheck = date ("j, n, Y", strtotime ( $FROMdate ) );
>
>if ( !checkdate ( $frmdatecheck ) ) {  }
>
>gives me the following error
>
>Warning: Wrong parameter count for checkdate() in
>D:\root\cc\resolutions\res_search.php on line 621
>
>checkdate is defined as
>int checkdate (int month, int day, int year)
>
>any suggestions?
>
>Thanks in advace,   John
>
>
>---------------------
>John Asendorf - [EMAIL PROTECTED]
>Web Applications Developer
>http://www.lcounty.com - NEW FEATURES ADDED DAILY!
>Licking County, Ohio, USA
>740-349-3631
>
>The benefit to the government of replacing all $1 Federal Reserve notes with
>$1 coins would be $522.2 million per year, according to estimates of the
>General Accouting Office released on April 7, 2000.
>
>
>-- 
>PHP Windows 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]
------end of quote------ 



____________________________________________________________
Cynic:

A member of a group of ancient Greek philosophers who taught
that virtue constitutes happiness and that self control is
the essential part of virtue.

[EMAIL PROTECTED]






At 15:26 12.01.2001 -0500, Asendorf, John wrote:
>I have a set of date selectors which then people can use to search between
>two dates.  Even though they say FROM and TO, people will undoubtedly put
>the dates in the wrong order on occassion.  If this happens (I've already
>got the IF statement), I want to be able to switch the two dates before the
>SQL is written instead of having it

hmm, not sure, maybe a temp variable is the best, but you could also do the 
following:

<?php
  $from = 14;
  $to = 12;

  /* 1 */
  $array = array("from" => (($from > $to) ? $to : $from), "to" => (($to < 
$from) ? $from : $to));
  echo $array["from"], " - ", $array["to"], "<br />";

  /* 2 - maybe you're even getting an array as input
   <form method=post><input type="text" name="date[0]">
   <input type="text" name="date[1]"><input type=submit></form>
   */
  $array = array(0 => 14, 1 => 12);
  if($array[0] > $array[1]) $array = array_reverse($array);
  echo $array[0], " - ", $array[1], "<br />";
?>

>die ("Hey idiot, go back and switch the dates you've entered");
>
>:)

would be nice anyway :)

daniel

/*--
daniel beulshausen - [EMAIL PROTECTED]
using php on windows? http://www.php4win.de





Hello PHP-gents,

"X-Powered-By: PHP/4.0.0 Content-type: text/html Bonjour Web !PHP Fatal
error: Unable to load dynamic library 'php_gd.dll'
Un périphérique attaché au système ne fonctionne pas correctement. in
Unknown on line 0 "

That's the message I get when running with extensions dll, on
another side, everything seems to work fine out !

I tried every pathname in the init file, nothing doesn't work.
Even with the manually changes made to the WindowRegfile !
This is the message I get with WPS (Win 98 2nd) on a Pentium1 233 mmx.
I joint the file(s), it maybe helps.

Other questions : I didn't find the "php_iis_reg.inf"
you talk about in the list of config options Updates ?
Where can I get it ?
I just couln't get explenations on "browscap.ini"
under mirror site-link !

Thanx for all.
guy






Hi folks,

I'm still new to HTML, Javascript and PHP but learning (fast hopefully).
I've just started accessing DOM elements. I have worked out how to update
the contents of table cells directly using this method, etc. In Javascript I
would use code like:

  alert("Value is: " +
tablejames.firstChild.childNodes[1].childNodes[4].firstChild.firstChild.node
Name);
  alert("Value is: " +
tablejames.firstChild.childNodes[1].childNodes[5].firstChild.firstChild.node
Value);

This Javascript shows the name and value of the child element.

Now I want to use PHP to extract data (values) from HTML pages like I do
with the above Javascript. Is this possible? Obviously with the Javascript
the HTML page has already been rendered in the browser (i.e. all tree
elements have been created). This makes extracting data a simple case of
finding the "#text" elements and reading in the values. Can I do the same
thing with PHP and an HTML file I've downloaded from the Internet? Obviously
this file is sitting on my server and hasn't been rendered in a browser...

The whole point of this exercise is so that I can extract values from an
HTML table and populate them into a database. Maybe it's easier to process
the HTML file line by line and strip the unwanted HTML tags? However, with
this approach I've got to hardcode each webpage...

If this is a silly question then sorry but you only learn if you ask ;)

Thanks

James






To extract data from a file, look for fread() in the manual to write the
complete file in a variable, then edit the text in the variable with some of
the string commands found, for example, at php.net/manual/en/ref.strings.php
Then choose one of the numerous databases supported by php and save whatever
you need.
You undertand that you will do all that on the server side...

Alain
On Sat, Jan 13, 2001 at 12:30:03AM -0000, James Duncan wrote:
> Hi folks,
> 
> I'm still new to HTML, Javascript and PHP but learning (fast hopefully).
> I've just started accessing DOM elements. I have worked out how to update
> the contents of table cells directly using this method, etc. In Javascript I
> would use code like:
> 
>   alert("Value is: " +
> tablejames.firstChild.childNodes[1].childNodes[4].firstChild.firstChild.node
> Name);
>   alert("Value is: " +
> tablejames.firstChild.childNodes[1].childNodes[5].firstChild.firstChild.node
> Value);
> 
> This Javascript shows the name and value of the child element.
> 
> Now I want to use PHP to extract data (values) from HTML pages like I do
> with the above Javascript. Is this possible? Obviously with the Javascript
> the HTML page has already been rendered in the browser (i.e. all tree
> elements have been created). This makes extracting data a simple case of
> finding the "#text" elements and reading in the values. Can I do the same
> thing with PHP and an HTML file I've downloaded from the Internet? Obviously
> this file is sitting on my server and hasn't been rendered in a browser...
> 
> The whole point of this exercise is so that I can extract values from an
> HTML table and populate them into a database. Maybe it's easier to process
> the HTML file line by line and strip the unwanted HTML tags? However, with
> this approach I've got to hardcode each webpage...
> 
> If this is a silly question then sorry but you only learn if you ask ;)
> 
> Thanks
> 
> James
> 
> 
> 
> -- 
> PHP Windows 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]




Someone recently suggested a good PHP editor - similar to notepad. After
reformatting, I lost the program and the url... anyone remember it ? Thanks
if you can help



Reply via email to