php-general Digest 8 Dec 2001 11:52:20 -0000 Issue 1040

Topics (messages 77090 through 77110):

Re: Finding num of days b/t two dates.
        77090 by: Steve Cayford

Re: PHP + MySQL problem (strange behavior)
        77091 by: Javier Muniz

Re: Image problem
        77092 by: Andrew Chase

RegEx gurus help...
        77093 by: Brian V Bonini

phpautodoc
        77094 by: Malcolm Clark
        77105 by: Malcolm Clark

ASP aplication object
        77095 by: Max

Re: Comparison between string failing
        77096 by: Fred

Costum Error Page
        77097 by: Daniel Urstöger
        77098 by: Ashley M. Kirchner
        77108 by: Daniel Urstöger
        77110 by: Daniel Urstöger

Getting started - what do I need?
        77099 by: Indera
        77100 by: Michael Hall
        77101 by: Matthew Moreton

snmpv3 for php4 and later
        77102 by: Yan nick

why didnt you come watch me like you said you would?
        77103 by: Karina69.AgoodfucK.com ()

copy image from database
        77104 by: Jan Grafström

WDDX
        77106 by: con pulpa

Text file busy
        77107 by: Boaz Yahav

fopen to check if file exists
        77109 by: moe

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 ---
Here's one way to do it by converting dates into timestamps.
<?php

$date1 = mktime(0,0,0,10,1,2001); // in the form (hours, minutes, 
seconds, month, day, year)
$date2 = mktime(0,0,0,10,1,2000);
$timedif = $date1 - $date2;

print(strftime("date 1 is %b %d, %Y", $date1) . "<br>\n");
print(strftime("date 2 is %b %d, %Y", $date2) . "<br>\n");
print("the difference in seconds is " . $timedif . "<br>\n");
print("the difference in days is " . ($timedif / (60 * 60  * 24)) . 
"<br>\n");
?>

-Steve

On Friday, December 7, 2001, at 04:48  PM, Alex Fritz wrote:

> If somebody could help me with this, it would save me a lot of 
> heartache.  I
> thought that this would be simple, but I can't seem to find a function
> anywhere in PHP that has this capability and I can't seem to find any
> external libraries for anything actually.  I need to be able to give 
> PHP a
> start date and an end date and have it return the number of days 
> between the
> dates.  If the first date is more recent than the second, I need it to 
> give
> me a negative number.  Can somebody please help?
>
> Alex
>
>
>
> --
> 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]
>

--- End Message ---
--- Begin Message ---
Unfortunately, mysql returns no error string.  MySQL doesn't appear to think
it's
an error, as it does apply changes to the row I'm trying to change, it
simple isn't
applying the CORRECT change to said row :)

-Javier

-----Original Message-----
From: David Robley [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, December 05, 2001 4:59 PM
To: Javier Muniz; '[EMAIL PROTECTED]'
Subject: Re: [PHP] PHP + MySQL problem (strange behavior)


On Thu,  6 Dec 2001 08:32, Javier Muniz wrote:
> Hello,
>
> I'm having trouble determining what's going wrong with a MySQL query
> that I'm doing from PHP.  Now before you go blaming MySQL read on :)
>
> I have a table with the following columns:
> id (int)
> name (varchar 20)
> starttime (int)
> duration (int)
>
> now, i have a row that has a starttime of 60, when i attempt to do the
> following update with PHP, it sets it to 0:
>
> "UPDATE mytable SET starttime=starttime-30 WHERE name = 'myname'"
>
> but when I run it from the MySQL command line, copy/pasted from the
> code, it sets the value of starttime to 30 as expected.
>
> Anyone have any clue why this is?

mysql_error() is a good debugging tool; it will return an error string 
that may be useful.

-- 
David Robley      Techno-JoaT, Web Maintainer, Mail List Admin, etc
CENTRE FOR INJURY STUDIES      Flinders University, SOUTH AUSTRALIA  

   A waist is a terrible thing to mind.
--- End Message ---
--- Begin Message ---
PHP needs to be compiled with libjpeg and libpng in addition to the GD
library to use those formats respectively.   The PHP manual section covering
image functions (including those for manipulating JPEGs and PNGs) is at

http://www.php.net/manual/en/ref.image.php

-Andy


> -----Original Message-----
> From: Peter Lalka [mailto:[EMAIL PROTECTED]]
> Sent: Friday, December 07, 2001 5:50 AM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] Re: Image problem
>
>
>
> Thanks, in phpinfo list really isn't support for GIF:(
> How can I manipulate jpeg images? Which functions are for this
> img. format?
> P.
>
>
> |--------+--------------------------------------------------------->
> |        |          Johan <[EMAIL PROTECTED]>                         |
> |        |          Odoslané kým:                                  |
> |        |          php-general-return-77040-lalkap=emo.seas.sk@lis|
> |        |          ts.php.net                                     |
> |        |                                                         |
> |        |                                                         |
> |        |          07.12.2001 14:30                               |
> |        |                                                         |
> |--------+--------------------------------------------------------->
>
> >-----------------------------------------------------------------
> ------------------------------------------|
>   |
>                                             |
>   | Komu:   [EMAIL PROTECTED]
>                                             |
>   | Kópia:
>                                             |
>   |   Predmet:    [PHP] Re: Image problem
>                                             |
>
> >-----------------------------------------------------------------
> ------------------------------------------|
>
>
>
> > I've instaled and cofigured php4 on WinNT with Apache Web server.
> > I can't use any fuction of Image manipulation, 'cause I get this error
> > message: ImageGif: No GIF support in this PHP build
> > In phpinfo() is listed that: gd lib.> enabled, zlib lib.> enabled.
> > What do I still miss there?
>
> In the newest version of GD library (think it since about 1.3 or
> something)
>
> does support GIF, because GIF is a commerial image format.
>
> Use PNG or JPEG instead. That much better, or find a version with GIF
> support.
>
> You can see what Image formats you GD can use by make a file with follow
> content:
> <?php
> phpinfo();
> ?>
>
> :o)
>
> Regards,
>
> Johan
>
> --
> 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]
>
>
>
>
>
>

--- End Message ---
--- Begin Message ---
I need to replace all relative links in an html
doc with absolute links on the fly weather it
be an image link,
<img src='/_imgs/imgs_nav/transPix.gif' width='10' height='13'>
<img src='../_imgs/imgs_nav/transPix.gif' width='10' height='13'>

a URL,
<a href="/dealers/index.asp">

a link to an external JS file
<script language='JavaScript' src='/_js/scripts.js'
type='text/javascript'></script>

or external css file.
<link rel="stylesheet" href="../_css/style.css" type="text/css">

Anyone done this before and have a prefab regex laying
around they want to share?

-Brian

--- End Message ---
--- Begin Message ---
I'm trying to get this GNU stuff from
http://sourceforge.net/projects/phpautodoc to work. These are the
instructions for use

-----------
[php] phpdoc.php [php interpreter options] <file(s)> [-- -o <output path>]

Scans the specified PHP source files (given directories are searched
recursively - default: .) and writes HTML files to the specified output path
(default: .).

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


Can any body give me an example of this syntax? I'm a completely baffled
intermediate.

TIA

Malcolm, UK

--- End Message ---
--- Begin Message ---
Trying to get phpautodoc to work:

If you saw this line, how would you write it with example values in it for
<file(s)> etc?

[php] phpdoc.php [php interpreter options] <file(s)> [-- -o <output path>]


phpautodoc instructions say the following, but I don't understand:

Scans the specified PHP source files (given directories are searched
recursively - default: .) and writes HTML files to the specified output path
(default: .).


TIA

Malcolm, UK


--- End Message ---
--- Begin Message ---
Hi,

Is exist something similar in PHP?

Regards.
Max.
--- End Message ---
--- Begin Message ---
I would like to start by saying that your code is horribly confusing.  Try
taking all those commented out parts out of the script before you post to
the group.

That said, your problem is that you left out a closing curly brace.  Try
this:

> global $MYFILES;
> $MYFILES['file_recensione']['tmp_name'][1] = 'image/pjpeg';
> if ($MYFILES['file_recensione']['tmp_name'][1] == 'image/pjpeg') {print
"OK
> HERE<HR>";}
> print "VALUE 0:".$MYFILES['file_recensione']['tmp_name'][1].";<HR>";
> if (/*is_uploaded_file($MYFILES['file_recensione']['tmp_name'][1])*/
> //($VAL == 1) && (
> ($MYFILES['file_recensione']['type'][1] == 'image/jpeg') ||
> ($MYFILES['file_recensione']['type'][1] == 'image/pjpeg') ||
> ($MYFILES['file_recensione']['type'][1] == 'image/gif')
> //    )
> ) {
> $EXTGIF = 'jpg';
> if (substr($MYFILES['file_recensione']['type'][1], -3) ==    'peg') {
> $EXTGIF = 'jpg';}
> if (substr($MYFILES['file_recensione']['type'][1], -3) ==    'gif') {
> $EXTGIF = 'gif';}} // ******ADDED CLOSING BRACE*******
> print "ESTENSIONE = $EXTGIF;<BR>";
> } else {print "UPLOAD
> FAILED<BR>".$MYFILES['file_recensione']['type'][1].";<BR>";}
> print "VALUE =1:".$MYFILES['file_recensione']['tmp_name'][1].";<HR>";

Mweb <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
> Hello,
>
> I can't understand why the piece of test code below produces the output :
> OK HERE
> VALUE 0:image/pjpeg;
> UPLOAD FAILED = ;
> VALUE =1:image/pjpeg;
>
> Basically I use or print several times the value
> $MYFILES['file_recensione']['tmp_name'][1]
> and it looks like it changes values from line to line (it's not a scope
> thing, I'm almost sure in this case: what is below is the whole file).
Look
> at the line below with the string "ESTENSIONE", it should be printed
instead
> of UPLOAD FAILED, right?
> Why doesn't it happen?
>
> mweb
>
////////////////////////////////////////////////////////////////////////////
//////////////////////
> global $MYFILES;
> $MYFILES['file_recensione']['tmp_name'][1] = 'image/pjpeg';
> if ($MYFILES['file_recensione']['tmp_name'][1] == 'image/pjpeg') {print
"OK
> HERE<HR>";}
> print "VALUE 0:".$MYFILES['file_recensione']['tmp_name'][1].";<HR>";
> if (/*is_uploaded_file($MYFILES['file_recensione']['tmp_name'][1])*/
> //($VAL == 1) && (
> ($MYFILES['file_recensione']['type'][1] == 'image/jpeg') ||
> ($MYFILES['file_recensione']['type'][1] == 'image/pjpeg') ||
> ($MYFILES['file_recensione']['type'][1] == 'image/gif')
> //    )
> ) {
> $EXTGIF = 'jpg';
> if (substr($MYFILES['file_recensione']['type'][1], -3) ==    'peg') {
> $EXTGIF = 'jpg';}
> if (substr($MYFILES['file_recensione']['type'][1], -3) ==    'gif') {
> $EXTGIF = 'gif';}
> print "ESTENSIONE = $EXTGIF;<BR>";
> } else {print "UPLOAD
> FAILED<BR>".$MYFILES['file_recensione']['type'][1].";<BR>";}
> print "VALUE =1:".$MYFILES['file_recensione']['tmp_name'][1].";<HR>";


--- End Message ---
--- Begin Message ---
Hi !

I hope you can help me with that problem :)
I have created a costum error page, and this one is working really fine,
already.
Was quite easy, but the problem I have now:
Somebody trys to access the file:  iamnothere.html
The requests, doesn´t find the file, so apache redirects the request to my
costum error page.
I can check http referer, and such stuff, BUT:
How could I check, which file apache tried to access, and didn´t found ?
That would be a pretty nice function for my PHP skript ..
Thx for your help !

cya !

Daniel Urstöger
WebMaster @ cdrsoft.info


--- End Message ---
--- Begin Message ---
"Daniel Urstöger" wrote:

> How could I check, which file apache tried to access, and didn´t found ?
> That would be a pretty nice function for my PHP skript ..

    Check your REQUEST_URI variable.

--
H | "Life is the art of drawing without an eraser." - John Gardner
  +--------------------------------------------------------------------
  Ashley M. Kirchner <mailto:[EMAIL PROTECTED]>   .   303.442.6410 x130
  Director of Internet Operations / SysAdmin    .     800.441.3873 x130
  Photo Craft Laboratories, Inc.            .     3550 Arapahoe Ave, #6
  http://www.pcraft.com ..... .  .    .       Boulder, CO 80303, U.S.A.


--- End Message ---
--- Begin Message ---
Thx !
It works, now I can code further !


"Ashley M. Kirchner" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> "Daniel Urstöger" wrote:
>
> > How could I check, which file apache tried to access, and didn´t found ?
> > That would be a pretty nice function for my PHP skript ..
>
>     Check your REQUEST_URI variable.
>
> --
> H | "Life is the art of drawing without an eraser." - John Gardner
>   +--------------------------------------------------------------------
>   Ashley M. Kirchner <mailto:[EMAIL PROTECTED]>   .   303.442.6410 x130
>   Director of Internet Operations / SysAdmin    .     800.441.3873 x130
>   Photo Craft Laboratories, Inc.            .     3550 Arapahoe Ave, #6
>   http://www.pcraft.com ..... .  .    .       Boulder, CO 80303, U.S.A.
>
>


--- End Message ---
--- Begin Message ---
Opps, sorry, I had a bug, now I have this problem:
Browser is showing this URL:
http://yourdomain.com/play/404.php
and so the REQUEST_URI is:
/play/404.php

But I would need the requested file, before apache redirected to
the 404.php
Is this possible as well ?


--- End Message ---
--- Begin Message ---
Hello,

I have never used php or mysql before and want to know what tools I should use so that 
I can start
learning php and mysql. I would like to build basic things like a login page and forms 
that append
the data to a database. I went to the bookstore and think the book PHP fast and easy 
web development
is something that I could handle. I've read through some of the posts on this news 
group and
realized that there are tools that I can use as front ends for these packages. I went 
to mysql.com
and php.net and it seems that i can download both of these packages to my computer for 
free. Any
help would be greatly appreciated.

Thanks
Indera


--- End Message ---
--- Begin Message ---

Yes indeed, PHP and MySQL are free ... welcome to the world of open source
software!

What type of computer operating system are you using? Does it have a web
server? You may want to consider downloading Apache as well (also
free).

There are lots of helpful tutorials on the net that can get you going if
you don't want to buy a book right away.

Mick

On Fri, 7 Dec 2001, Indera wrote:

> Hello,
> 
> I have never used php or mysql before and want to know what tools I should use so 
>that I can start
> learning php and mysql. I would like to build basic things like a login page and 
>forms that append
> the data to a database. I went to the bookstore and think the book PHP fast and easy 
>web development
> is something that I could handle. I've read through some of the posts on this news 
>group and
> realized that there are tools that I can use as front ends for these packages. I 
>went to mysql.com
> and php.net and it seems that i can download both of these packages to my computer 
>for free. Any
> help would be greatly appreciated.
> 
> Thanks
> Indera
> 
> 
> 
> 

-- 
################################
Michael Hall            
[EMAIL PROTECTED]
[EMAIL PROTECTED]
http://openlearningcommunity.org


--- End Message ---
--- Begin Message ---
I would suggest downloading PHPtriad.  It installs Apache, PHP and mySQL all
set up and ready to go.  http://www.phpgeek.com to get it.

The only resources I have used to teach myself php and mysql is the
documentation provided at www.php.net and www.mysql.com respectively.

Good luck

Matt

----- Original Message -----
From: "Indera" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, December 08, 2001 3:44 AM
Subject: [PHP] Getting started - what do I need?


> Hello,
>
> I have never used php or mysql before and want to know what tools I should
use so that I can start
> learning php and mysql. I would like to build basic things like a login
page and forms that append
> the data to a database. I went to the bookstore and think the book PHP
fast and easy web development
> is something that I could handle. I've read through some of the posts on
this news group and
> realized that there are tools that I can use as front ends for these
packages. I went to mysql.com
> and php.net and it seems that i can download both of these packages to my
computer for free. Any
> help would be greatly appreciated.
>
> Thanks
> Indera
>
>
>
> --
> 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]

--- End Message ---
--- Begin Message ---
Hi,
   I need to use snmpv3 function in php4.
One day, someone called Harrie Hazewinkel from Twente University has 
modified ext/snmp to include functions that supported SNMPV3.

But that was for PhP3, what about php4 ?
I found a package for php4 :
http://www.ncinter.net/~bert/php-snmp-v4.tar.gz

It compiles without any errors, but new functions doesnt work, they returns 
nothing.

It would be nice that snmpv3 compatible functions would be included in
next versions of php.



_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp

--- End Message ---
--- Begin Message ---
Diese Daten wurden Ihnen von Ihrem OnlineFormular geschickt.  Es wurde erstellt von
 ([EMAIL PROTECTED]) am 8 Dezember ,Samstag , 2001 um 07:57:27
---------------------------------------------------------------------------

: hey babe, it's karina remember me? if you don't im 5'8" with brown hair and blue 
:eyes with an ass you can bounce a quarter off of :-) Im 21 years old and im in my 
:final year of college at OSU in OREGON! i just got my first webcam and i love meeting 
:new people on it and just showing my body off. i want you to come watch me do a 
:striptease! my website is located at: http://www.karinaswebcam.com and i have a 
:backup the url is 
:http://info.netscape.com/fwd/hophb5/http://srd.yahoo.com/srst/56353520/as/4/25452/*http:[EMAIL PROTECTED]/xpdro?http://members.aol.com/katrinarockz/katrina.html
: if that doesnt work try http://hometown.aol.com/vajerr/ ~ LOVE ALWAYS! -Karina 
:XOXOXO<33

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

--- End Message ---
--- Begin Message ---
Hi!
I have images in my DB and want to write them to disk. I tried to copy but
nothing happend,
the image only pops up in my browser with "echo". I want it saved in a
directory on my server.
-----
$query = "select bin_data,filetype from $table where id=$id";
$result = @MYSQL_QUERY($query);
$image = @MYSQL_RESULT($result,0,"bin_data");
echo $image;
$destfile="image.jpg";
copy($image,$destfile)
-----
Thanks for any help
Regards,
Jan
--
Jan Grafström
Lillemans Hus AB
Sweden
46 (0)611-60920
46 (0)70-6409073

--- End Message ---
--- Begin Message ---
Hi EVERYONE!

I'm running RH7.1 with PHP version 4.04pl1 and
Apache1.3.19-5. A simple php script <?php phpinfo(); ?>
tells me that the library is configured with the
'--enable-wddx' and '--with-xml' options.

I'm using netscape4.76 and konqueror(kde 2.1.1) browser.

Now running a slightly more complicated script from one of
the online tutorials

<?php
$one_var = "I was serialized on 2001-12-08";
print wddx_serialize_value($one_var);
?>

I find that it produces no output at all!
There are no errors reported in the log files...

Then, if I put an echo statement before the print:
<?php
echo "==>WDDX Test";
$one_var = "I was serialized on 2001-12-08";
print wddx_serialize_value($one_var);
?>

I get the following output.
==>WDDX Test I was serialized on 2001-12-08

I'm not too concerned about this wierd behaviour;
However, I was expecting this code to produce something
dressed in XML:

<wddxPacket version='0.9'>
<data>
<string>I was serialized on 2001-12-08</string>
</data>
</wddxPacket>

Can anyone help me?

Thanks, Conpulpa






_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp

--- End Message ---
--- Begin Message ---
HI

I'm trying to run a php file in CGI mode and I get : Text file busy
I'm running many other files like that for years and this is the 1st
time I see such a message.

php.net seems to be down for me, any idea?

berber



--- End Message ---
--- Begin Message ---
I am using this function:

function isAfile($url){
    $fp = @fopen("$url","r");
    if ($fp)
      { //print "The file exists!";
      return 1; }
    else
      { //print "The file does not exist";
    return 0; }
 }

to check if a remote file exists... now the problem is that the URL's i am
trying to check are in this way:
http://waptopic.supereva.it/loghiesuonerie.it/LogoGen.php?id=1100
The problem is that LogoGen.php exists but depending on the ID the image may
exists or not.
How can i actually check if the image exists?
Thanks anyone!



--- End Message ---

Reply via email to