php-windows Digest 19 Jun 2002 00:19:07 -0000 Issue 1199
Topics (messages 14265 through 14283):
Re: Date Comparsion
14265 by: Svensson, B.A.T. (HKG)
14273 by: Lee Doolan
Re: MSIE6.2
14266 by: Eduards Cauna
14268 by: Dean Hayes
freetype.dll
14267 by: Brian McGarvie
Mcrypt Binary dll's
14269 by: Conover, Ryan
GD...
14270 by: Brian McGarvie
Re: LDAP...
14271 by: Eduards Cauna
14272 by: Mikey
getting variables?
14274 by: Renaldo De Silva
14276 by: Rasmus Lerdorf
Not a PHP problem, it's a MySQL problem
14275 by: James Meers
14277 by: Rasmus Lerdorf
14280 by: Scott Hurring
PDF Form download changes in IE broke my app?
14278 by: Asendorf, John
14279 by: Asendorf, John
Re: Script not working correctly
14281 by: Scott Hurring
Running as a Module and as EXE on the same Apache server?
14282 by: Alan Leff
Re: [PHP-INST] Windows Install troubles.
14283 by: MikeParton
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]
----------------------------------------------------------------------
--- Begin Message ---
Check out http://www.php.net/manual/en/ref.datetime.php look in the answer below, I
found a couple of support function that might
help you.
Like this one:
function dayDiff($timestamp1,$timestamp2) {
$dayInYear1 = getDayOfYear($timestamp1);
$dayInYear2 = getDayOfYear($timestamp2);
return ((getYear($dayInYear1)*365 + $dayInYear1) -
(getYear($dayInYear2)*365 + $dayInYear2));
}
> -----Original Message-----
> From: Jack [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, June 18, 2002 11:25 AM
> To: [EMAIL PROTECTED]; [EMAIL PROTECTED];
> [EMAIL PROTECTED]
> Subject: [PHP-WIN] Date Comparsion
>
>
> Dear all
> I had a form which let user to input the leave_from and leave_to date into,
> the format of the date that user input is "yyyy-mm-dd".
> Now i want to compare the leave_from and leave_to date to find out the
> number of days between!
>
> What should i do or any function in php can provide this operation?
>
>
> --
> Thx a lot!
> Jack
> [EMAIL PROTECTED]
>
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
>>>>> "Jack" == Jack <[EMAIL PROTECTED]> writes:
Jack> Dear all I had a form which let user to input the leave_from
Jack> and leave_to date into, the format of the date that user
Jack> input is "yyyy-mm-dd". Now i want to compare the leave_from
Jack> and leave_to date to find out the number of days between!
well, here's one way:
$interval_days= (strtotime($to_date) - strtotime($from_date)) / 3600 * 24
adjust to taste.
--
When the birdcage is open, | donate to causes I care about:
the selfish bird flies away, | http://svcs.affero.net/rm.php?r=leed_25
but the virtuous one stays. |
--- End Message ---
--- Begin Message ---
At 05:35 2002.06.18.l`ku\®, you wrote:
>does any one know a way i can use the command $HTTP_REFERER
>$HTTP_USER_AGENT & $REMOTE_ADDR in internet explorer6.2 as every time i
>try to use the commands it returns a blank page unless i use the if and
>elseif statments. This would be a great help as i need to include this in
>a new counter i am building at the moment
It is IE6.x problem. Workaround -- turn off "friendly HTTP error messages"
in Tools > Internet Options > Advanced > Show friendly HTTP error messages
(turn this off).
Eduards
--- End Message ---
--- Begin Message ---
hey this is the code i can use to display about MSIE6 but even when i turn
off show http friendly error's i still get a blank page unless i use the
folowing code can anyone tell me a way to use this in a mysql way as i need
to add what the browser type is into my mysql database but first i need to
be able to find it out
<?php
$this = "MSIE";
if(strstr($HTTP_USER_AGENT,"MSIE"))
{
print ("<center><b>You are using Internet Explorer</b></center>");
}
else
{
echo ("<center><b>get $this </b></center>");
}
?>
I know i am Insane why do you think my name is The Insane Guy
blah blah blah more bull crap stuff insert it here --> <--
_________________________________________________________________
MSN Photos is the easiest way to share and print your photos:
http://photos.msn.com/support/worldwide.aspx
--- End Message ---
--- Begin Message ---
can anyone send me the above file?
can't find it anywhere!
[ http://www.the-local-guide.com :: http://www.mcgarvie.net ]
--- End Message ---
--- Begin Message ---
Anyone know where I can get the Windows Binary dll's for the Mcrypt Library.
Ryan Conover
[EMAIL PROTECTED]
[EMAIL PROTECTED]
http://www.pitt.edu/~rscst25/
--- End Message ---
--- Begin Message ---
OK...
why would imaged be shown as if they do not exist?
[ http://www.the-local-guide.com :: http://www.mcgarvie.net ]
--- End Message ---
--- Begin Message ---
At 11:45 2002.06.18.l, you wrote:
>I'm just experimenting with LDAP...
>
>[ Windows 2000 Server/IIS/php 4.2.1]
>
>I've uncommented the php_ldap.dll in my .ini... when I execute the
>following simple piece of code it gives me:
>
>Fatal error: Call to undefined function: ldap_connect()
Unfortunately LDAP is NOT enabled. Try to put copy of php_ldap.dll in
\WINNT (or \WINNT\system32) directory. And restart.
Eduards
--- End Message ---
--- Begin Message ---
You don't have to move this dll to your system dir, only to the extensions
dir - have you restarted your web server?
> -----Original Message-----
> From: Eduards Cauna [mailto:[EMAIL PROTECTED]]
> Sent: 18 June 2002 12:17
> To: [EMAIL PROTECTED]>
> Subject: Re: [PHP-WIN] LDAP...
>
>
> At 11:45 2002.06.18.l, you wrote:
> >I'm just experimenting with LDAP...
> >
> >[ Windows 2000 Server/IIS/php 4.2.1]
> >
> >I've uncommented the php_ldap.dll in my .ini... when I execute the
> >following simple piece of code it gives me:
> >
> >Fatal error: Call to undefined function: ldap_connect()
>
> Unfortunately LDAP is NOT enabled. Try to put copy of php_ldap.dll in
> \WINNT (or \WINNT\system32) directory. And restart.
>
> Eduards
>
>
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
--- End Message ---
--- Begin Message ---
how can i get variables posted from a form without calling then distinctly.
i want to get the names of all the variables the form has poster
automatically.
can that be done and if it can how?
Thanks Renaldo
--- End Message ---
--- Begin Message ---
foreach($_POST as $name=>$value) {
echo "$name = $value<br />\n";
}
On Tue, 18 Jun 2002, Renaldo De Silva wrote:
> how can i get variables posted from a form without calling then distinctly.
>
> i want to get the names of all the variables the form has poster
> automatically.
> can that be done and if it can how?
>
> Thanks Renaldo
>
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
Sorry, its not a PHP problem, it's a MySQL problem.....
I am trying to do a MySQL query below:
select top 10 * from table order by record_number desc
However, I am getting the following error:
You have an error in your SQL syntax near '10 * from table order by record_number
desc' at line 1
--- End Message ---
--- Begin Message ---
top 10 *? What is that supposed to be? Please go read the MySQL docs.
-Rasmus
On Tue, 18 Jun 2002, James Meers wrote:
> Sorry, its not a PHP problem, it's a MySQL problem.....
>
> I am trying to do a MySQL query below:
>
> select top 10 * from table order by record_number desc
>
> However, I am getting the following error:
>
> You have an error in your SQL syntax near '10 * from table order by record_number
>desc' at line 1
>
--- End Message ---
--- Begin Message ---
Try putting a "LIMIT 10" after a valid query
--
Scott Hurring
Systems Programmer
EAC Corporation
scott (*) eac.com
--
"Rasmus Lerdorf" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> top 10 *? What is that supposed to be? Please go read the MySQL docs.
>
> -Rasmus
>
> On Tue, 18 Jun 2002, James Meers wrote:
>
> > Sorry, its not a PHP problem, it's a MySQL problem.....
> >
> > I am trying to do a MySQL query below:
> >
> > select top 10 * from table order by record_number desc
> >
> > However, I am getting the following error:
> >
> > You have an error in your SQL syntax near '10 * from table order by
record_number desc' at line 1
> >
>
--- End Message ---
--- Begin Message ---
Has anyone else having trouble with the latest IE and PDF Forms (FDF)?
I had a nice application that used to work and is now broken. I think it
has something to do with the latest "upgrades and cold(I mean hot)fixes" to
IE. I now get a "download file" alert with the "Open" button grayed out.
It used to just rev up Acrobat and shoot out the form.
If you want to see the problem, you can see it at
http://www.lcounty.com/lchd/record_search/
Thanks in advance, the link and the file that used to work are below. Maybe
something to do with the Header content?
-------
LINK:
<form action="print_app.php" method="POST" name="cANTHONYSMITH"><input
type="hidden" name="newark_licking" value="N"><input type="hidden"
name="first_name" value="ANTHONY"><input type="hidden" name="last_name"
value="SMITH"><input type="hidden" name="middle_name" value="CURTIS"><input
type="hidden" name="date_of_birth" value="11-08-2000"><input type="hidden"
name="cert_reg" value="cert_card"><input type="image" src="cardicon.gif"
alt="Make an Application for a Certified Card Sized Copy of this
Certificate"></form>
-----
print_app.php:
<?PHP
$outfdf = fdf_create();
if ( $date_of_death != "" ) {
fdf_set_value($outfdf, "date_of_death", "$date_of_death",
0);
$bd_flag = "b"; //create a flag birth/death for checkbox later
}
elseif ( $date_of_birth != "" ) {
fdf_set_value($outfdf, "date_of_birth", "$date_of_birth",
0);
$bd_flag = "d"; //create a flag birth/death for checkbox later
}
else { die ( "This form cannot be generated" ); }
if ( $bd_flag == "d" ) {
if ( $cert_reg == "regular" ) {
fdf_set_value($outfdf, "reg_birth", "Yes", 0);
}
elseif( $cert_reg == "cert_card" ) {
fdf_set_value($outfdf, "cert_birth_card", "Yes", 0);
}
else { fdf_set_value($outfdf, "cert_birth", "Yes", 0); }
}
else {
if ( $cert_reg == "regular" ) {
fdf_set_value($outfdf, "reg_death", "Yes", 0);
}
else { fdf_set_value($outfdf, "cert_death", "Yes", 0); }
}
fdf_set_value($outfdf, "last_name", "$last_name", 0);
fdf_set_value($outfdf, "first_name", "$first_name", 0);
fdf_set_value($outfdf, "middle_name", "$middle_name", 0);
if ($newark_licking == "L" ) {
fdf_set_file($outfdf,"http://www.lcounty.com/lchd/record_search/VR_app.pdf")
;
}
else {
fdf_set_file($outfdf,"http://www.lcounty.com/lchd/record_search/CityVR_app.p
df");
}
fdf_save($outfdf, "d://InetPub//wwwroot//lchd//record_search//out.fdf");
fdf_close($outfdf);
Header("Content-type: application/vnd.fdf");
$fp = fopen("d://InetPub//wwwroot//lchd//record_search//out.fdf", "r");
fpassthru($fp);
unlink("out.fdf");
?>
Thanks in advance, John
---------------------
John Asendorf - [EMAIL PROTECTED]
Web Applications Developer
http://www.lcounty.com - NEW FEATURES ADDED DAILY!
Licking County, Ohio, USA
740-349-3631
Nullum magnum ingenium sine mixtura dementiae fuit
--- End Message ---
--- Begin Message ---
Never mind... I know what caused it.
I recently set the web server to expire cotent immediately... I'll bet
that's what did it.
---------------------
John Asendorf - [EMAIL PROTECTED]
Web Applications Developer
http://www.lcounty.com - NEW FEATURES ADDED DAILY!
Licking County, Ohio, USA
740-349-3631
Nullum magnum ingenium sine mixtura dementiae fuit
> -----Original Message-----
> From: Asendorf, John [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, June 18, 2002 2:30 PM
> To: Php-Windows (E-mail)
> Subject: [PHP-WIN] PDF Form download changes in IE broke my app?
>
>
> Has anyone else having trouble with the latest IE and PDF Forms (FDF)?
>
> I had a nice application that used to work and is now broken.
> I think it
> has something to do with the latest "upgrades and cold(I mean
> hot)fixes" to
> IE. I now get a "download file" alert with the "Open" button
> grayed out.
> It used to just rev up Acrobat and shoot out the form.
>
> If you want to see the problem, you can see it at
> http://www.lcounty.com/lchd/record_search/
>
> Thanks in advance, the link and the file that used to work
> are below. Maybe
> something to do with the Header content?
>
> -------
> LINK:
>
> <form action="print_app.php" method="POST" name="cANTHONYSMITH"><input
> type="hidden" name="newark_licking" value="N"><input type="hidden"
> name="first_name" value="ANTHONY"><input type="hidden"
> name="last_name"
> value="SMITH"><input type="hidden" name="middle_name"
> value="CURTIS"><input
> type="hidden" name="date_of_birth" value="11-08-2000"><input
> type="hidden"
> name="cert_reg" value="cert_card"><input type="image"
> src="cardicon.gif"
> alt="Make an Application for a Certified Card Sized Copy of this
> Certificate"></form>
>
> -----
>
> print_app.php:
>
> <?PHP
> $outfdf = fdf_create();
> if ( $date_of_death != "" ) {
> fdf_set_value($outfdf, "date_of_death",
> "$date_of_death",
> 0);
> $bd_flag = "b"; //create a flag birth/death for
> checkbox later
> }
> elseif ( $date_of_birth != "" ) {
> fdf_set_value($outfdf, "date_of_birth",
> "$date_of_birth",
> 0);
> $bd_flag = "d"; //create a flag birth/death for
> checkbox later
> }
> else { die ( "This form cannot be generated" ); }
> if ( $bd_flag == "d" ) {
> if ( $cert_reg == "regular" ) {
> fdf_set_value($outfdf, "reg_birth", "Yes", 0);
> }
> elseif( $cert_reg == "cert_card" ) {
> fdf_set_value($outfdf, "cert_birth_card", "Yes", 0);
> }
> else { fdf_set_value($outfdf, "cert_birth", "Yes", 0); }
> }
> else {
> if ( $cert_reg == "regular" ) {
> fdf_set_value($outfdf, "reg_death", "Yes", 0);
> }
> else { fdf_set_value($outfdf, "cert_death", "Yes", 0); }
> }
> fdf_set_value($outfdf, "last_name", "$last_name", 0);
> fdf_set_value($outfdf, "first_name", "$first_name", 0);
> fdf_set_value($outfdf, "middle_name", "$middle_name", 0);
>
> if ($newark_licking == "L" ) {
>
> fdf_set_file($outfdf,"http://www.lcounty.com/lchd/record_searc
> h/VR_app.pdf")
> ;
> }
>
> else {
>
> fdf_set_file($outfdf,"http://www.lcounty.com/lchd/record_searc
> h/CityVR_app.p
> df");
> }
>
> fdf_save($outfdf,
> "d://InetPub//wwwroot//lchd//record_search//out.fdf");
> fdf_close($outfdf);
> Header("Content-type: application/vnd.fdf");
> $fp =
> fopen("d://InetPub//wwwroot//lchd//record_search//out.fdf", "r");
> fpassthru($fp);
> unlink("out.fdf");
> ?>
>
>
>
> Thanks in advance, John
>
>
> ---------------------
> John Asendorf - [EMAIL PROTECTED]
> Web Applications Developer
> http://www.lcounty.com - NEW FEATURES ADDED DAILY!
> Licking County, Ohio, USA
> 740-349-3631
> Nullum magnum ingenium sine mixtura dementiae fuit
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message ---
Adjust the 'max_execution_time' in php.ini or with a call
to ini_set() and it won't timeout.
PHP is a great language, don't let something a silly as
a default timeout value dissuade you from using it to do
"longer running" things.
--
Scott Hurring
Systems Programmer
EAC Corporation
scott (*) eac.com
--
"Tomator" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
> > I created this script to ping a host and if a response is not received
> then
> > insert into a second table and ping it after x amount of minutes. The
> script
> > seems to work fine until it starts to ping the hosts in the second table
> > then it goes to page cant be displayed. I need to script to entire script
> to
> > run constantly but with a delay before it runs. Please help.
>
> Your script IS working correctly but maybe not as you want. PHP is not
> designed to run 'constatnly running" scripts. If you try, you will geat an
> timeout (after 30 seconds).
>
> If you want to repeat pinging any server after x seconds, use REFRESH. In
> that way, your script will generate HTML page (with text "ping problems,
> waiting...") and refresh it running script again (and again and.... until
> you close browser window or go to another page). Try this:
>
> <html>
> <head>
> <meta http-equiv="refresh" content="x;URL=http://want.to.ping.it.again">
> </head>
> ...
> </html>
>
> where "x" in third line is amount of seconds to wait
>
>
>
--- End Message ---
--- Begin Message ---
Can I run php v4 both as a module and as a direct executable on the same
Apache server or using two instances of Apache on the same server?
--- End Message ---
--- Begin Message ---
You might want to look at "echo"ing your HTML inside your php code. Seems
more simple to me.
So, what you have here would look like:
<?php
$dbhost = "127.0.0.1";
> $dbuser = "username";
> $dbpass = "password";
> $db = "databssename";
> $LoginDB=@mysql_connect($dbhost, $dbuser, $dbpass);
or die("Unable to connect to the database server at this time.");
// the die() function provides the functionality to // throw a message
exit;
echo "<html>
<head> <title>Login Page</title></head>
<style type=text/css>body { color: white; background: black; }</style>
<p align="Center"><img src=Banner.png width=666 height=103 alt=D&D
Resource page border=0></p> <br><br><br><br><form name=Login method=Post
action=<?echo $PHP_SELF?>> <p align=Center>Login: <input type=text
name=User Name> Password: <input type=password name=Password><input
type=submit name=Submit value=Submit</p></form><
/html>";
?>
----- Original Message -----
From: "Viraj Kalinga Abayarathna" <[EMAIL PROTECTED]>
To: "Shiloh Madsen" <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Tuesday, June 18, 2002 8:03 PM
Subject: RE: [PHP-INST] Windows Install troubles.
> Hi,
> You have done some errornous escapings from
> php in your script. I did some fewer modifications and
> now script is working. Compare the ?>'s <?'s in my script
> and yours. You will get the point.
> remove my comments and save it as filename.php (not
> html)
>
> regards
> Viraj
> www.CeyNet.net
>
>
> //start escape
> <? //start escape here
> $dbhost = "127.0.0.1";
> $dbuser = "username";
> $dbpass = "password";
> $db = "databssename";
> $LoginDB=@mysql_connect($dbhost, $dbuser, $dbpass);
> if (! $LoginDB) {
> ?>//end escape here for the first if block
> //start the html content
> <p>Unable to connect to the database server at this time.</p>
> //end the html content
> //start escape for the else part of the script
> <?exit();
> } else {?>
> //end escape for the else part
> //start html content for the else part
> <html>
> <head> <title>Login Page</title></head>
> <style type="text/css">body { color: white; background: black; }</style>
> <p align="Center"><img src="Banner.png" width="666" height="103" alt="D&D
> Resource
> page" border="0">"</p> <br><br><br><br><form name="Login" method="Post"
> action="<?echo $PHP_SELF?>"> <p align="Center">Login: <input type="text"
> name="User Name"> Password: <input type="password" name="Password"><input
> type="submit" name="Submit" value="Submit"</p></form><
> /html>
> //end html content for the else part
> //start escape for closing bracket for the else part
> <? } ?>
> //end the script
>
>
> -----Original Message-----
> From: Shiloh Madsen [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, June 18, 2002 3:14 AM
> To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: [PHP-INST] Windows Install troubles.
>
>
> Hi all. Im having difficulty getting PHP up and running with my Windows
> system. I am trying to get PHP, Apache and SQL installed and running. I
> installed apache, installed PHP, copied the required DLLs into the
> apache\modules directory, and added the lines to AddModule and
> LoadModule. After doing this, when I try to view a PHP page in my
> browser, it shows the raw code/html behind the page. Any ideas why? Im
> pasting the page in question below this so you can see it.
>
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
>
> <html>
> <head>
> <title>Login Page</title>
> </head>
> <?php
> $dbhost = "127.0.0.1";
> $dbuser = "root";
> $dbpass = "invictus";
> $db = "LoginInfo";
>
> $LoginDB=@mysql_connect($dbhost, $dbuser, $dbpass);
> if (! $LoginDB) {
> print "<p>Unable to connect to the database server at this time.</p>";
> exit();
> } else {
> ?>
> <style type="text/css">
> body { color: white; background: black; }
> </style>
> <p align="Center"><img src="Banner.png" width="666" height="103" alt="D&D
> Resource Page" border="0">"</p>
> <br><br><br><br>
> <form name="Login" method="Post" action="<?echo $PHP_SELF?>">
> <p align="Center">
> Login: <input type="text" name="User Name">
> Password: <input type="password" name="Password">
> <input type="submit" name="Submit" value="Submit"
> </p>
>
> </form>
>
> <?php
> {
> ?>
>
> </html>
>
>
>
>
> --
> PHP Install Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
>
> --
> PHP Install Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--- End Message ---