php-general Digest 27 May 2002 21:01:57 -0000 Issue 1370

Topics (messages 99345 through 99398):

Re: Ora_Fetch_Into function problem
        99345 by: Michael P. Carel
        99347 by: Michael Virnstein

Re: Program execution stops at exec()
        99346 by: Tom Mikulecky
        99356 by: David Freeman
        99359 by: Tom Mikulecky

user password
        99348 by: Wayne
        99368 by: John Holmes

Re: Simulating a FORM POST thing (HELP!)
        99349 by: Peter

simple array question
        99350 by: Jose Jeria
        99351 by: Billy S Halsey

get the filename of an include'd/require'd file?
        99352 by: John Ericson

problems with storing image data to the db
        99353 by: andy

Re: gmtime?
        99354 by: Ford, Mike               [LSS]
        99357 by: Jens Lehmann
        99358 by: Matt Friedman
        99361 by: Ford, Mike               [LSS]
        99367 by: Jens Lehmann

Re: ini_set('register_globals',0) doesn't work
        99355 by: Jens Lehmann

random HTML pages from PHP calls
        99360 by: r
        99363 by: Justin French

time
        99362 by: Chris Grigor
        99364 by: Jason Wong
        99366 by: Roman Duriancik

Re: Parse Error(Newbie)
        99365 by: John Holmes

fread and session vars
        99369 by: Zac Hillier
        99374 by: John Holmes
        99375 by: Zac Hillier
        99387 by: John Holmes

Re: Need some advice concerning forms (multi select pulldown) and arrays
        99370 by: John Holmes

pdf_get_info
        99371 by: Dietmar Thamm
        99372 by: Henrik Hansen
        99376 by: Dietmar Thamm
        99378 by: Henrik Hansen

Xdebug 0.8.0 announcement
        99373 by: Derick Rethans

Thread safe
        99377 by: r
        99385 by: J Smith

Function registration failed - duplicate name - mysql_connect in Unknown on line 0
        99379 by: Ben Kennish

request object
        99380 by: Jose Jeria
        99382 by: Jose Jeria
        99388 by: John Holmes

Session's is slowing the page ??
        99381 by: Dima Dubin
        99384 by: J Smith

Is there a function getSize() of ming or libswf?
        99383 by: Augusto Cesar Castoldi

PHP script and external C program
        99386 by: ing.Martin Prá¹ek
        99389 by: John Holmes

Entering password on a command line
        99390 by: Darren Gamble

PhP, mysql and pictures
        99391 by: Ragnar
        99392 by: John S. Huggins

PHP 4.1.2 ignores ini-set on max_upload_filesize
        99393 by: DevilKin
        99398 by: Rasmus Lerdorf

mail() function
        99394 by: Jochem Kempe
        99395 by: Pushkar Pradhan
        99396 by: Pushkar Pradhan

IMAP quota support
        99397 by: Luiz Lima

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








oooppssss...sorry just found out why. I just need to have Ora_Commit()
function after all the queries to totally set the data to the database.
Im querying a data which is not commited yet to the oracle database.
Sorry for that I'm just a newbie in oracle.

Thanks  to all..

mike




> I've recently found out that the Ora_Fetch_Into function  cannot get a
small
> value of the tables data. We've tried to fetch other tables which have a
> large amount data ,and it succeeds. The queried values echoed
successfully.
> Is there any idea why? im using PHP4.2.1 oracle7.3.3
>
>
> Regards,
> Mike
>
>
>
>
>
> > thanks miguel but i've already checked it, i've included return values
> > checking where it stop. Here's my full source test script.
> > There where no Ora_Error_Code returned.
> >
> > <?
> > PutEnv("ORACLE_SID=PROD");
> > PutEnv("ORACLE_HOME=/u01/app/oracle/product/7.3.3_prod");
> > $connection = Ora_Logon("apps","apps");
> > if($connection==false){
> >         echo Ora_ErrorCode($connection).":".
> Ora_Error($connection)."<BR>";
> > exit;
> > }
> > $cursor= Ora_Open($connection);
> > if($cursor==false){
> >         echo Ora_ErrorCode($connection).":".
> Ora_Error($connection)."<BR>";
> > exit;
> > }
> > $query = "select * from mikecarel";
> > //$query = "select table_name from all_tables";
> > $result = Ora_Parse($cursor,$query);
> > if($result==false){
> >         echo Ora_ErrorCode($connection).":".
> Ora_Error($connection)."<BR>";
> > exit;
> > }
> > $result=Ora_Exec($cursor);
> > if($result==false){
> >         echo Ora_ErrorCode($connection).":".
> Ora_Error($connection)."<BR>";
> > exit;
> > }
> > echo"<table border=1>";
> > echo"<tr><td><b>Full Name</b></td><td><b>Email Address</b></td></tr>";
> > //$values=array(mike, tess);
> > while(Ora_Fetch_Into($cursor,$values)){
> >         $name = $values[0];
> >         $email = $values[1];
> > echo "<tr><td>$name</td><td>$email</td></tr>";
> > echo "$email";
> > print($name);
> > $result =1;
> > }
> > if(!$result==1) print("no result");
> > echo"</table>";
> >
> > ora_close($cursor);
> > ora_logoff($connection);
> > ?>
> >
> >
> > mike
> >
> >
> >
> > > Check the return values from your ora_logon, ora_open, ora_parse, and
> > > ora_exec calls to see whether they worked. That way you can know at
> > > which stage it stopped working.
> > >
> > > miguel
> > >
> > > On Mon, 27 May 2002, Michael P. Carel wrote:
> > > > Finally i've set-up my AIX server with PHP and oracle support.
Thanks
> > for
> > > > all who helps me for the configure setup.
> > > > Now I have a problem in oracle function regarding the retrieval of
> > entries
> > > > in the oracle table. The Ora_Fetch_Into function doesnt work
properly
> to
> > me
> > > > or i have  an error in which i dont know. I've written below the
code
> > that i
> > > > used to test, it doesnt echo the value of $name and $email. My query
> > works
> > > > if i've enter it manually with my Oracle server. I really dont know
> why
> > im
> > > > just a newbie with this database(oracle) statement.
> > > >
> > > > Please help us here. Thanks in advance.
> > > >
> > > > <?PutEnv("ORACLE_SID=PROD");
> > > > PutEnv("ORACLE_HOME=/u01/app/oracle/product/7.3.3_prod");
> > > > $connection = Ora_Logon("apps","apps");
> > > > $cursor= Ora_Open($connection);
> > > >
> > > > $query = "select * from mikecarel";
> > > > $result = Ora_Parse($cursor,$query);
> > > > $result=Ora_Exec($cursor);
> > > > echo"<table border=1>";
> > > > echo"<tr><td><b>Full Name</b></td><td><b>Email
Address</b></td></tr>";
> > > > while(Ora_Fetch_Into($cursor,$values)){
> > > >         $name = $values[0];
> > > >         $email = $values[1];
> > > > echo "<tr><td>$name</td><td>$email</td></tr>";
> > > > }
> > > > ora_close($cursor);
> > > > ora_logoff($connection); ?>
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > > Regards,
> > > > mike
> > > >
> > > >
> > > >
> >
> >
> > --
> > 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

--- End Message ---
--- Begin Message ---
if you are a newbie to oracle, don't forget to use bind variables in your
queries, if this is possible in your Oracle Version. bindvars are
placeholders
for values in an oracle query, to which you bind your value on runtime.
the advantage in using bind variables is, that oracle doesn't have to
compile your query every time, but can reuse the compiled version
of your query, simply bind the values and execute it. this is a main factor
in
writing highly scalable application with an oracle database backend,
at least with Oracle8i. You can read more about that at
http://asktom.oracle.com
I'd provide a direct link, but i can't access the page at the moment...
seems to be down.

Michael

"Michael P. Carel" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
006a01c2055b$fbfcb280$[EMAIL PROTECTED]">news:006a01c2055b$fbfcb280$[EMAIL PROTECTED]...
>
>
>
>
>
>
>
>
> oooppssss...sorry just found out why. I just need to have Ora_Commit()
> function after all the queries to totally set the data to the database.
> Im querying a data which is not commited yet to the oracle database.
> Sorry for that I'm just a newbie in oracle.
>
> Thanks  to all..
>
> mike
>
>
>
>
> > I've recently found out that the Ora_Fetch_Into function  cannot get a
> small
> > value of the tables data. We've tried to fetch other tables which have a
> > large amount data ,and it succeeds. The queried values echoed
> successfully.
> > Is there any idea why? im using PHP4.2.1 oracle7.3.3
> >
> >
> > Regards,
> > Mike
> >
> >
> >
> >
> >
> > > thanks miguel but i've already checked it, i've included return values
> > > checking where it stop. Here's my full source test script.
> > > There where no Ora_Error_Code returned.
> > >
> > > <?
> > > PutEnv("ORACLE_SID=PROD");
> > > PutEnv("ORACLE_HOME=/u01/app/oracle/product/7.3.3_prod");
> > > $connection = Ora_Logon("apps","apps");
> > > if($connection==false){
> > >         echo Ora_ErrorCode($connection).":".
> > Ora_Error($connection)."<BR>";
> > > exit;
> > > }
> > > $cursor= Ora_Open($connection);
> > > if($cursor==false){
> > >         echo Ora_ErrorCode($connection).":".
> > Ora_Error($connection)."<BR>";
> > > exit;
> > > }
> > > $query = "select * from mikecarel";
> > > //$query = "select table_name from all_tables";
> > > $result = Ora_Parse($cursor,$query);
> > > if($result==false){
> > >         echo Ora_ErrorCode($connection).":".
> > Ora_Error($connection)."<BR>";
> > > exit;
> > > }
> > > $result=Ora_Exec($cursor);
> > > if($result==false){
> > >         echo Ora_ErrorCode($connection).":".
> > Ora_Error($connection)."<BR>";
> > > exit;
> > > }
> > > echo"<table border=1>";
> > > echo"<tr><td><b>Full Name</b></td><td><b>Email Address</b></td></tr>";
> > > //$values=array(mike, tess);
> > > while(Ora_Fetch_Into($cursor,$values)){
> > >         $name = $values[0];
> > >         $email = $values[1];
> > > echo "<tr><td>$name</td><td>$email</td></tr>";
> > > echo "$email";
> > > print($name);
> > > $result =1;
> > > }
> > > if(!$result==1) print("no result");
> > > echo"</table>";
> > >
> > > ora_close($cursor);
> > > ora_logoff($connection);
> > > ?>
> > >
> > >
> > > mike
> > >
> > >
> > >
> > > > Check the return values from your ora_logon, ora_open, ora_parse,
and
> > > > ora_exec calls to see whether they worked. That way you can know at
> > > > which stage it stopped working.
> > > >
> > > > miguel
> > > >
> > > > On Mon, 27 May 2002, Michael P. Carel wrote:
> > > > > Finally i've set-up my AIX server with PHP and oracle support.
> Thanks
> > > for
> > > > > all who helps me for the configure setup.
> > > > > Now I have a problem in oracle function regarding the retrieval of
> > > entries
> > > > > in the oracle table. The Ora_Fetch_Into function doesnt work
> properly
> > to
> > > me
> > > > > or i have  an error in which i dont know. I've written below the
> code
> > > that i
> > > > > used to test, it doesnt echo the value of $name and $email. My
query
> > > works
> > > > > if i've enter it manually with my Oracle server. I really dont
know
> > why
> > > im
> > > > > just a newbie with this database(oracle) statement.
> > > > >
> > > > > Please help us here. Thanks in advance.
> > > > >
> > > > > <?PutEnv("ORACLE_SID=PROD");
> > > > > PutEnv("ORACLE_HOME=/u01/app/oracle/product/7.3.3_prod");
> > > > > $connection = Ora_Logon("apps","apps");
> > > > > $cursor= Ora_Open($connection);
> > > > >
> > > > > $query = "select * from mikecarel";
> > > > > $result = Ora_Parse($cursor,$query);
> > > > > $result=Ora_Exec($cursor);
> > > > > echo"<table border=1>";
> > > > > echo"<tr><td><b>Full Name</b></td><td><b>Email
> Address</b></td></tr>";
> > > > > while(Ora_Fetch_Into($cursor,$values)){
> > > > >         $name = $values[0];
> > > > >         $email = $values[1];
> > > > > echo "<tr><td>$name</td><td>$email</td></tr>";
> > > > > }
> > > > > ora_close($cursor);
> > > > > ora_logoff($connection); ?>
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > Regards,
> > > > > mike
> > > > >
> > > > >
> > > > >
> > >
> > >
> > > --
> > > 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
>


--- End Message ---
--- Begin Message ---
I read in php manual that set_time_limit() affects in fact max_execution_time.
You can see in my example code
I wrote in my initial post that I set it to 100k secs. Php don't run in safe
mode so it should go fine.

What I don't understand is why my php script dies while executing the shell
script. Set_limit_time should make it
wait. The build.sh script completes well.

Tom

Michael Virnstein wrote:

> note:
> i think the exec in your php waits for the shell to return, but before the
> shell can answer, php terminates the script, because of the max_exection.
>
> Michael
>
> "Michael Virnstein" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > check your max_execution_time settings in php.ini
> >
> > Michael
> >
> > "Tom Mikulecky" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
> > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > > Hello
> > >
> > > In one script I use exec() to execute a shell script which takes 2-3
> > > hours to run. I disabled user abort and set time limit to more than one
> > > day. The shell script finishes well but no instruction after exec() is
> > > run. The script finishes with no error nor warnings.
> > > Some of you know hwat happens?
> > > Thanx in advance.
> > >
> > > Tom
> > >
> > > Code snaps:
> > >
> > >
> > > ignore_user_abort(1);
> > >
> > > set_time_limit(100000);
> > >
> > > (...)
> > >
> > > exec('/home/tom/build.sh  >ouput 2>errlog');    //takes 3 hours to
> > complete
> > >
> > > //  *** Nothing from here gets executed, 'build.sh' script completed
> with
> > succes ***
> > >
> > > (...)
> > >
> > > I'm using php 4.0.4pl1(can't upgrade) with Apache 1.3.19 on Mandrake
> > >
> >
> >

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

 > What I don't understand is why my php script dies while 
 > executing the shell script. Set_limit_time should make it 
 > wait. The build.sh script completes well.

Not the exact solution here but perhaps a work-around.  How dynamic is
the data you're generating with your shell script?  Perhaps you could
get away with doing a cron on your shell script (once every hour or
whatever) and outputing it to a text file that you then parse in php to
deal with results.

CYA, Dave


--- End Message ---
--- Begin Message ---
David Freeman wrote:

>  > What I don't understand is why my php script dies while
>  > executing the shell script. Set_limit_time should make it
>  > wait. The build.sh script completes well.
>
> Not the exact solution here but perhaps a work-around.  How dynamic is
> the data you're generating with your shell script?  Perhaps you could
> get away with doing a cron on your shell script (once every hour or
> whatever) and outputing it to a text file that you then parse in php to
> deal with results.
>
> CYA, Dave

It is generated rarely. I wanted to do a sort of interface to start
generation of some files at distance. It would be cool to have it done
just by pushing single button. My work-around is that now I have to push
another button after 3 hours ;) No big deal, it is generated once or twice
a year.

Thanks to everyone who tried to help me

Tom

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

Does anybody know how I can set a users password with php?
I tried using a system call with sudo but I get the error cannot lock
password file. I need to use php to change a users account password. 
Any ideas?

Thanks,
 Wayne


--- End Message ---
--- Begin Message ---
When you get this working, can you post the IP address or web address of
your server? Thanks...

---John Holmes...

> -----Original Message-----
> From: Wayne [mailto:[EMAIL PROTECTED]]
> Sent: Monday, May 27, 2002 5:55 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] user password
> 
> Hi Guys,
> 
> Does anybody know how I can set a users password with php?
> I tried using a system call with sudo but I get the error cannot lock
> password file. I need to use php to change a users account password.
> Any ideas?
> 
> Thanks,
>  Wayne
> 
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php


--- End Message ---
--- Begin Message ---
Have a look in the manual. It's something like createfrombmp(). Might be
imagecreatefrombmp(). It's in the images section of functions. You might
need to have the gd library installed for it to work.

You could always use fopen() and fread() to open and read the file. Use it
in binary mode for images and stuff.


"Georgie Casey" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> that function doest exist!
>
> "Peter" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > Windows Bitmap = BMP file
> > a WBMP is a wireless bitmap image and is designed for display on mobile
> > phones. A lot of software doesn't understand the format.
> >
> > You need to use createfrombmp() not createfromwbmp()
> >
> >
> > "Georgie Casey" <[EMAIL PROTECTED]> wrote in message
> > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > > i'm getting an error message saying my BMP file i'm trying to convert
> isnt
> > a
> > > valid WBMP file? is dere a difference between BMP and WBMP? I just
> opened
> > my
> > > GIF file into PSP7 and and saved as a windows bmp.
> > >
> > > why isnt it working?
> > > "Peter" <[EMAIL PROTECTED]> wrote in message
> > > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > > > <?PHP
> > > > $im = createfrombmp("image");
> > > > print "<FORM METHOD=\"post\" ACTION=\"actionpage.php\">";
> > > > print "<INPUT TYPE=\"hidden\" NAME=\"image\" VALUE=\"$im\">";
> > > > ?>
> > > > you get the idea
> > > >
> > > > I think PHP does have other funtions for file uplading though.
> > > >
> > > > "Georgie Casey" <[EMAIL PROTECTED]> wrote in message
> > > > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > > > > Rite, when you see a web form, you know you can simulate the
submit
> by
> > > > > filling in the values in the address field, just like a GET
method,
> > and
> > > it
> > > > > usually works the exact same. But how do you do it when one of the
> > > fields
> > > > in
> > > > > the form is a file upload?!?!?!
> > > > >
> > > > > For the record, its a GIF file you've to upload. Is there any way
to
> > do
> > > > this
> > > > > in PHP??
> > > > >
> > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>


--- End Message ---
--- Begin Message ---
in javascript i can build an array doing like this:

for(i=0; i < whatEver.length; i++){
    myArray[myArray.length] = //....
}

What is the equivalent to this in PHP?
Is this the only way:
$myArray[count($myArray)] = //..

/J



--- End Message ---
--- Begin Message ---
Jose,

Try this:

for ($i = 0; $i < $whatever; $i++) {
    $myArray[] = // ...
}

/bsh/

Jose Jeria wrote:
> in javascript i can build an array doing like this:
> 
> for(i=0; i < whatEver.length; i++){
>     myArray[myArray.length] = //....
> }
> 
> What is the equivalent to this in PHP?
> Is this the only way:
> $myArray[count($myArray)] = //..
> 
> /J
> 
> 
> 
> 



--- End Message ---
--- Begin Message ---
Anyone knows how I can get the name of an include'd/require'd file and not
getting the name of the main file.

My scenario is like this:

a.php:
require "b.php";

b.php:
echo $_SERVER['PHP_SELF'];
echo $_SERVER['SCRIPT_NAME'];

I get a.php when I want to have b.php.


(Please CC me since Im not a member of the list)

-- 
* John Ericson [EMAIL PROTECTED]
* ICQ: 7325429 JID: [EMAIL PROTECTED]
* web: http://john.pp.se
--- End Message ---
--- Begin Message ---
Hi there,

I would like to save images into a blob column. Works good if I use the tmp
file php has created after submitting the form.

But if I do some gd stuff like changing some colors with inside the image
and then save this immage, it does not work.

I used to save the image to a file with:   imagejpeg($picture, $name); //
this works
and now I try to save it to the db with:

   $picture = ImageCreateTrueColor($maxX, $dstY);
    //... some funky stuff like using the uuploaded file and mixing it with
a water mark
  $data = addslashes($picture);

  $stmt ="
       INSERT INTO test.picture_test
        (file_name, file_type, picture)
        VALUES
        ('$name', '$picture_location_type', '$data')
  ";

Like I said if I replace the $picture with the variable of the tmp field it
works fine.

I tryed also to do an imagejpeg before saving to the db, but it did not
change anything.

Thank you so much for any hint,

Andy





--- End Message ---
--- Begin Message ---
> -----Original Message-----
> From: Jens Lehmann [mailto:[EMAIL PROTECTED]]
> Sent: 24 May 2002 20:31
> 
> time() returns the number of seconds since the Unix Epoch to 
> the current
> local time
> 
> gmtime() should return the number of seconds since the Unix 
> Epoch to the
> current GM-time
> 
> Do you understand now?

Uh, no, actually now I'm more confused!

As I understand it, a Unix timestamp is *always* the number of seconds since 
1-Jan-1970 GMT ("the Unix epoch"), and so is always a GMT time.  Any function that 
converts between local time and a Unix timestamp therefore has to take the current 
timezone (and any daylight-savings rules) into account.  This is why there are two 
versions of mktime() and date(), but only one time().

Cheers!

Mike

---------------------------------------------------------------------
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730      Fax:  +44 113 283 3211 
--- End Message ---
--- Begin Message ---
> > -----Original Message-----
> > From: Jens Lehmann [mailto:[EMAIL PROTECTED]]
> > Sent: 24 May 2002 20:31
> >
> > time() returns the number of seconds since the Unix Epoch to
> > the current
> > local time
> >
> > gmtime() should return the number of seconds since the Unix
> > Epoch to the
> > current GM-time
> >
> > Do you understand now?

> Uh, no, actually now I'm more confused!

I can understand that you're confused. :-) Or am I?

> As I understand it, a Unix timestamp is *always* the number
> of seconds since 1-Jan-1970 GMT ("the Unix epoch"), and
> so is always a GMT time.

Imho no, because 1-Jan-1970 GMT is just the "starting point",
the result depends on which timezone your server is located in.
Please correct me if I'm wrong here!

> Any function that converts between local time and a Unix
> timestamp therefore has to take the current timezone (and
> any daylight-savings rules) into account.  This is why there
> are two versions of mktime() and date(), but only one time().
>
> Cheers!
>
> Mike
>

Jens







--- End Message ---
--- Begin Message ---
Unix epoch is the number of secs since the start date in GMT regardless
of where your server is. The timestamp is a GMT value.

Matt Friedman
Web Applications Developer
www.SpryNewMedia.com
 

-----Original Message-----
From: Jens Lehmann [mailto:[EMAIL PROTECTED]] 
Sent: Monday May 27, 2002 7:48 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] gmtime?

> > -----Original Message-----
> > From: Jens Lehmann [mailto:[EMAIL PROTECTED]]
> > Sent: 24 May 2002 20:31
> >
> > time() returns the number of seconds since the Unix Epoch to
> > the current
> > local time
> >
> > gmtime() should return the number of seconds since the Unix
> > Epoch to the
> > current GM-time
> >
> > Do you understand now?

> Uh, no, actually now I'm more confused!

I can understand that you're confused. :-) Or am I?

> As I understand it, a Unix timestamp is *always* the number
> of seconds since 1-Jan-1970 GMT ("the Unix epoch"), and
> so is always a GMT time.

Imho no, because 1-Jan-1970 GMT is just the "starting point",
the result depends on which timezone your server is located in.
Please correct me if I'm wrong here!

> Any function that converts between local time and a Unix
> timestamp therefore has to take the current timezone (and
> any daylight-savings rules) into account.  This is why there
> are two versions of mktime() and date(), but only one time().
>
> Cheers!
>
> Mike
>

Jens








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


--- End Message ---
--- Begin Message ---
> -----Original Message-----
> From: Jens Lehmann [mailto:[EMAIL PROTECTED]]
> Sent: 27 May 2002 12:48
> 
> > > -----Original Message-----
> > > From: Jens Lehmann [mailto:[EMAIL PROTECTED]]
> > > Sent: 24 May 2002 20:31
> > >
> > > time() returns the number of seconds since the Unix Epoch to
> > > the current
> > > local time
> > >
> > > gmtime() should return the number of seconds since the Unix
> > > Epoch to the
> > > current GM-time
> > >
> > > Do you understand now?
> 
> > Uh, no, actually now I'm more confused!
> 
> I can understand that you're confused. :-) Or am I?
> 
> > As I understand it, a Unix timestamp is *always* the number
> > of seconds since 1-Jan-1970 GMT ("the Unix epoch"), and
> > so is always a GMT time.
> 
> Imho no, because 1-Jan-1970 GMT is just the "starting point",
> the result depends on which timezone your server is located in.
> Please correct me if I'm wrong here!

Well, I'm not sure, because I think we're talking at cross purposes.  I'm *still* not 
sure what you want gmtime() to achieve that's different from time(), because, as far 
as I can see, the two scenarios you describe above actually return the same value.  
Or, to put it another way, because a timestamp is *always in GMT*, it returns the time 
since 1-Jan-1970 00:00:00, full stop, period, end of story.  In other words, 
timestamps operate in a single timezone, and it's up to anything else that works with 
a timestamp to do the timezone (and daylight-savings) corrections.  (This is also why 
you get the anomaly of 23- and 25-hour days in areas which have daylight-savings 
timeshifts.)

Let's take some detailed examples, and maybe you can explain what you're trying to get 
with your gmtime() (and why!):

In a purely GMT zone, with local time 27-May-2002 12:00:00, the UNIX timestamp is 
1022500800.

In a nominally GMT zone, but with daylight-savings in effect (such as British Summer 
Time!), with local time 27-May-2002 13:00:00, the UNIX time stamp for this is also 
1022500800.

Likewise, in a GMT+0200 zone, a local time of 27-May-2002 14:00:00 also gives a 
timestamp of 1022500800.

In fact, this same timestamp of 1022500800 also represents all of these local times:

    27-May-2002 04:00 -0800
    27-May-2002 07:00 -0500
    27-May-2002 17:00 +0500
    27-May-2002 23:00 +1100

and even such oddities as:

    27-May-2002 21:30 (Western Australia / Northern Territory)

Thus, given the timestamp of 1022500800, it's the job of date() to determine the 
correct timezone and daylight-savings offset and apply them before formatting the 
output; gmdate() just formats it without applying any offsets.  Likewise, mkdate() and 
gmmkdate() translate the other way respectively with and without timezone correction.

Forgive me if I've gone on at what seems like excessive length, but I just wanted to 
make sure we both know exactly what it is we're talking about!

Cheers!

Mike

---------------------------------------------------------------------
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730      Fax:  +44 113 283 3211 
--- End Message ---
--- Begin Message ---

> > -----Original Message-----
> > From: Jens Lehmann [mailto:[EMAIL PROTECTED]]
> > Sent: 27 May 2002 12:48
> >
> > > > -----Original Message-----
> > > > From: Jens Lehmann [mailto:[EMAIL PROTECTED]]
> > > > Sent: 24 May 2002 20:31
> > > >
> > > > time() returns the number of seconds since the Unix Epoch to
> > > > the current
> > > > local time
> > > >
> > > > gmtime() should return the number of seconds since the Unix
> > > > Epoch to the
> > > > current GM-time
> > > >
> > > > Do you understand now?
> >
> > > Uh, no, actually now I'm more confused!
> >
> > I can understand that you're confused. :-) Or am I?
> >
> > > As I understand it, a Unix timestamp is *always* the number
> > > of seconds since 1-Jan-1970 GMT ("the Unix epoch"), and
> > > so is always a GMT time.
> >
> > Imho no, because 1-Jan-1970 GMT is just the "starting point",
> > the result depends on which timezone your server is located in.
> > Please correct me if I'm wrong here!
>
> Well, I'm not sure, because I think we're talking at cross purposes.  I'm
*still* not sure what you want gmtime() to achieve that's different from
time(), because, as far as I can see, the two scenarios you describe above
actually return the same value.  Or, to put it another way, because a
timestamp is *always in GMT*, it returns the time since 1-Jan-1970 00:00:00,
full stop, period, end of story.  In other words, timestamps operate in a
single timezone, and it's up to anything else that works with a timestamp to
do the timezone (and daylight-savings) corrections.  (This is also why you
get the anomaly of 23- and 25-hour days in areas which have daylight-savings
timeshifts.)
>
> Let's take some detailed examples, and maybe you can explain what you're
trying to get with your gmtime() (and why!):
>
> In a purely GMT zone, with local time 27-May-2002 12:00:00, the UNIX
timestamp is 1022500800.
>
> In a nominally GMT zone, but with daylight-savings in effect (such as
British Summer Time!), with local time 27-May-2002 13:00:00, the UNIX time
stamp for this is also 1022500800.
>
> Likewise, in a GMT+0200 zone, a local time of 27-May-2002 14:00:00 also
gives a timestamp of 1022500800.
>
> In fact, this same timestamp of 1022500800 also represents all of these
local times:
>
>     27-May-2002 04:00 -0800
>     27-May-2002 07:00 -0500
>     27-May-2002 17:00 +0500
>     27-May-2002 23:00 +1100
>
> and even such oddities as:
>
>     27-May-2002 21:30 (Western Australia / Northern Territory)
>
> Thus, given the timestamp of 1022500800, it's the job of date() to
determine the correct timezone and daylight-savings offset and apply them
before formatting the output; gmdate() just formats it without applying any
offsets.  Likewise, mkdate() and gmmkdate() translate the other way
respectively with and without timezone correction.
>
> Forgive me if I've gone on at what seems like excessive length, but I just
wanted to make sure we both know exactly what it is we're talking about!
>
> Cheers!
>
> Mike
>

@matt&mike:

Thank you for your explanations. I'm a bit sorry for having
asked such a question. The deeper I thought about it the
more confused I was. I see now that there's no sense in a
function like gmtime(). Sorry.

Jens






--- End Message ---
--- Begin Message ---
Thank you for answer. I didn't expect ini_set('register_globals','Off') to
work, that's why I had a look at the documentation. There should be
PHP_INI_PERDIR, PHP_INI_SYSTEM but not PHP_INI_ALL
in the table (so it's a mistake in the documentation).

Anyway it may be possible to use this, if the variables are unset. This
is overload of course, because the variables are first set (because of
register_globals="On" in php.ini) and are unset if I call
ini_set('register_globals','Off'), but this could be a nice "feature",
making it easier to work with register_globals="Off" while other
old projects still work. Do you consider this a good idea? Does
anything except performance speak against doing this manually?

Jens


> register_globals affects things that happen before PHP parsing begins, so
> by the time you get to your ini_set() it is too late.  So no, that won't
> work.  You need to set it in your php.ini, httpd.conf or .htaccess.
>
> -Rasmus
>
> On Sun, 26 May 2002, Jens Lehmann wrote:
>
> > I tested ini_set('register_globals',0) and
ini_set('register_globals','Off')
> > for turning register_globals off. It doesn't work and it doesn't produce
any
> > notice, warning or error.
> >
> > Here's a quick example:
> >
> > <?php
> >
> > ini_set('register_globals',0);
> >
> > if(isset($test))
> >   echo "<h2>$test</h2>";
> >
> > ?>
> > <form action="ini_set.php" method="get">
> >  <input type="text" name="test" />
> >  <input type="submit" />
> > </form>
> >
> > This prints out $test, what it shouldn't do with register_globals turned
> > off.
> > I tested this with PHP 4.1.2 and 4.2.1. Even if I start to doubt it is
> > supposed to work according to the documentation. Can anyone tell
> > me what I've done wrong?
> >
> > For some strange reason if I do
> >
> > echo ini_set('register_globals',0);
> >
> > it will print "10". For
> >
> > echo ini_set('register_globals','Off');
> >
> > it will print "1Off".
> >
> > Jens
> >
> > PS: ini_set works fine with include_path and error_reporting
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>


--- End Message ---
--- Begin Message ---
Hey all,

I'm calling a PHP "GimmeRandom.php?id=35557" and what this page does is take
the "id"  and update the number in the database by +1 (till here no problem)
then what its supposed to do is give me ANY ONE of 10 prewritten html pages
in a random order.

I know this is pretty easy but my brain just aint working today....

Cheers,
-Ryan.

--- End Message ---
--- Begin Message ---
What's the connection between the id and the random pages?

if you had 10 "html page" file names in a MySQL table, or an array, you'd be
able to pick one of them at random and include it.

eg SELECT file_name FROM files ORDER BY RAND() LIMIT 1

never had to do it with an array, but i'm guessing array_rand() is what you
wanna look at

http://www.php.net/manual/en/function.array-rand.php


justin french


on 28/05/02 11:19 AM, r ([EMAIL PROTECTED]) wrote:

> Hey all,
> 
> I'm calling a PHP "GimmeRandom.php?id=35557" and what this page does is take
> the "id"  and update the number in the database by +1 (till here no problem)
> then what its supposed to do is give me ANY ONE of 10 prewritten html pages
> in a random order.
> 
> I know this is pretty easy but my brain just aint working today....
> 
> Cheers,
> -Ryan.
> 

--- End Message ---
--- Begin Message ---
howdi all 

anyone know how to get a simple time print ? all the functions I have 
looked at gmtime() time() dont give the right thing ... all I want
is a simple time print e.g 17:51

I know that there is an easy way, Im just missing it somewhere ...

Chris
--- End Message ---
--- Begin Message ---
On Monday 27 May 2002 20:42, Chris Grigor wrote:
> howdi all
>
> anyone know how to get a simple time print ? all the functions I have
> looked at gmtime() time() dont give the right thing ... all I want
> is a simple time print e.g 17:51
>
> I know that there is an easy way, Im just missing it somewhere ...

date() ?

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
Every time I look at you I am more convinced of Darwin's theory.
*/

--- End Message ---
--- Begin Message ---
try echo Date("H:i:s");

roman


-----Original Message-----
From: Chris Grigor [mailto:[EMAIL PROTECTED]]
Sent: Monday, May 27, 2002 2:43 PM
To: [EMAIL PROTECTED]
Subject: [PHP] time 


howdi all 

anyone know how to get a simple time print ? all the functions I have 
looked at gmtime() time() dont give the right thing ... all I want
is a simple time print e.g 17:51

I know that there is an easy way, Im just missing it somewhere ...

Chris

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


--- End Message ---
--- Begin Message ---
Also note that variables are case sensitive in PHP. So $_get and $_GET
are not the same. If you're using the new "super-global" variables on
PHP, then you need to use $_GET['id']...

---John Holmes...

> -----Original Message-----
> From: Miguel Cruz [mailto:[EMAIL PROTECTED]]
> Sent: Monday, May 27, 2002 2:18 AM
> To: [EMAIL PROTECTED]
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] Parse Error(Newbie)
> 
> On Mon, 27 May 2002 [EMAIL PROTECTED] wrote:
> > I know it is probably something obvious but the following gives me a
> > parse error and as a newbie I am having trouble locating it.
> >
> > $query = "select * from news WHERE id = "$_get['id']"";
> 
> A lot of people have answered this already, but just for a little more
> clarification, consider this:
> 
> The reason the computer requires you to surround a string with quotes
is
> so that it knows where the string begins and ends.
> 
> If you put quotes in the middle of the string, it thinks those mark
the
> end; why would it think otherwise, since that's what quotes are for.
> 
> So people have provided you with various solutions for this. Each of
them
> involve in some way indicating more specifically what's going on.
Either
> you use a different kind of quotes (if you started the string with
single
> quotes, it will let you put double quotes inside it without getting
> confused, and vice versa), or you use the backslash character before
> internal quotes. Backslash is the "escape" character which in this
case
> tells the parser to ignore the special meaning of the quote that
follows.
> So your line could have been written in any of the following ways:
> 
>   $query = "select * from news WHERE id = '{$_get['id']}'";
>   $query = "select * from news WHERE id = \"{$_get['id']}\"";
>   $query = 'select * from news WHERE id = "' . $_get['id'] . '"';
> 
> miguel
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php


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

I'm using the fread function to read one of my php scripts and then produce a static 
page, within this script I'm using session variables.

If I browse to the script normally then all appears to work correctly, however when I 
use the fread function the session variables are not being translated. I've tried 
adding & SID to the end of the URL but to no avail. Can anyone suggest a course of 
action. I'm reluctant to produce GET variables as there are many variables and this 
script will need to be used by multiple domains.

Thanks,

Zac
--- End Message ---
--- Begin Message ---
Post some code. I don't understand completely what you're trying to do
or how you're trying to do it.

---John Holmes...

> -----Original Message-----
> From: Zac Hillier [mailto:[EMAIL PROTECTED]]
> Sent: Monday, May 27, 2002 9:20 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] fread and session vars
> 
> Hi all,
> 
> I'm using the fread function to read one of my php scripts and then
> produce a static page, within this script I'm using session variables.
> 
> If I browse to the script normally then all appears to work correctly,
> however when I use the fread function the session variables are not
being
> translated. I've tried adding & SID to the end of the URL but to no
avail.
> Can anyone suggest a course of action. I'm reluctant to produce GET
> variables as there are many variables and this script will need to be
used
> by multiple domains.
> 
> Thanks,
> 
> Zac

--- End Message ---
--- Begin Message ---
Code:

generate page script:

$pge = create-page.php
$pd = $HTTP_GET_VARS['pd'];

# Set the files
$crtPge = "/". $pge ."?pd=". $pd; # the url of the dynamic page to write the
output page
$targetfilename = $SITE_ DOCUMENT_ROOT . $outPge; # the output page

# delete previous version of temp file if it exists
@unlink('temp.html');

# open the dynamic page into dynpage
$dynpage = fopen($crtPge, 'r');

# Check for errors
if (!$dynpage) {
 echo("<p>Unable to load " . $crtPge . ". Static page update aborted!</p>");
 exit();
}

# function read the data
$htmldata = fread($dynpage, 1024*1024);

# close the dynamic page
fclose($dynpage);

# connect to temp file ready to write
$tempfile = fopen('temp.html', 'w');

# Check for errors
if (!$tempfile) {
 echo("<p>Unable to open temporary file " . ('temp.html') . " for writing.
Static page update aborted!</p>");
 exit();
}

#write to temp file
fwrite($tempfile, $htmldata);

# close the temp file
fclose($tempfile);

etc...
================================
===============================
create-page.php:

<?
session_start();

$SITE_ DOCUMENT_ROOT = '/usr/local/htdocs/' . $HTTP_SESSION_VARS['site_Loc']
. '/';

The line above fails when being read by fread in the generate script code
above, but works when I browse to it.

Hope this makes more sense.

Zac


----- Original Message -----
From: "John Holmes" <[EMAIL PROTECTED]>
To: "'Zac Hillier'" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Monday, May 27, 2002 3:28 PM
Subject: RE: [PHP] fread and session vars


> Post some code. I don't understand completely what you're trying to do
> or how you're trying to do it.
>
> ---John Holmes...
>
> > -----Original Message-----
> > From: Zac Hillier [mailto:[EMAIL PROTECTED]]
> > Sent: Monday, May 27, 2002 9:20 AM
> > To: [EMAIL PROTECTED]
> > Subject: [PHP] fread and session vars
> >
> > Hi all,
> >
> > I'm using the fread function to read one of my php scripts and then
> > produce a static page, within this script I'm using session variables.
> >
> > If I browse to the script normally then all appears to work correctly,
> > however when I use the fread function the session variables are not
> being
> > translated. I've tried adding & SID to the end of the URL but to no
> avail.
> > Can anyone suggest a course of action. I'm reluctant to produce GET
> > variables as there are many variables and this script will need to be
> used
> > by multiple domains.
> >
> > Thanks,
> >
> > Zac
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>

--- End Message ---
--- Begin Message ---
Hi.
 
> Code:
> 
> generate page script:
> 
> $pge = create-page.php
> $pd = $HTTP_GET_VARS['pd'];
> 
> # Set the files
> $crtPge = "/". $pge ."?pd=". $pd; # the url of the dynamic page to
write
> the
> output page
> $targetfilename = $SITE_ DOCUMENT_ROOT . $outPge; # the output page
> 
> # delete previous version of temp file if it exists
> @unlink('temp.html');
> 
> # open the dynamic page into dynpage
> $dynpage = fopen($crtPge, 'r');

Here it looks like $crtPge is going to be equal to something like
"/create-page.php?pd=xx". If you want to open it via a URL, you need to
add the HTTP:// and server name to it.

$crtPge = http:// . $HTTP_SERVER_VARS['SERVER_NAME'] . "/" . $pge .
"?pd=" . $pd;

Something like that...then fopen() will work. 

---John Holmes...

--- End Message ---
--- Begin Message ---
Shouldn't it be

count($_REQUEST['animals'])

and

count($_REQUEST['animals'][2]), etc...

??

---John Holmes...

> -----Original Message-----
> From: Victor Spång Arthursson [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, May 26, 2002 1:29 PM
> To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: Re: [PHP] Need some advice concerning forms (multi select
> pulldown) and arrays
> 
> Ok, I can't get this right...
> 
> Have the following code:
> 
>    <?
> 
>    $choices = array(1 => 'dog', 2 => 'cat', 3 => 'mouse', 4 =>
'frog');
> 
>       if (is_array($_REQUEST['animals']))
>       {
>               // get the number of selectcases
>               echo "get the number of selectcases: " . count($animals)
.
> "<br>";
> 
>               // get the number of provided selects from select with
name
> "2"
>               echo "get the number of provided selects from select
with name
> \"2\": " . count($animals[2]) . "<br>";
> 
>               // test to print some data
>               echo $animals[2][0]. "<br>";
>               echo $animals[2][1]. "<br>";
>               echo $animals[2][2]. "<br>";
>               echo $animals[2][3]. "<br>";
>       }
>    ?>
> <form method="post" action="<?= $_SERVER['PHP_SELF'] ?>">
>       <select multiple name="animals[2]">
>               <option value='1'>dog</option>
>       <option value='2'>cat</option>
>       <option value='3'>mouse</option>
>       <option value='4'>frog</option>
>       </select>
> 
>      <select multiple name="animals[4]">
>               <option value='1'>dog</option>
>               <option value='2'>cat</option>
>               <option value='3'>mouse</option>
>               <option value='4'>frog</option>
>      </select>
> <input type="submit"></form>
> 
> Why does it not work?
> 
>               // get the number of selectcases
>               echo "get the number of selectcases: " . count($animals)
.
> "<br>";
> 
> This works great
> 
>               // get the number of provided selects from select with
name
> "2"
>               echo "get the number of provided selects from select
with name
> \"2\": " . count($animals[2]) . "<br>";
> 
> But this doesn't...
> 
> Thankful for any help,
> 
> /Victor
> 
> On Sunday, May 26, 2002, at 05:35 PM, John Holmes wrote:
> 
> > You can supply an "whateverID" for the select if you want to.
> >
> > <select name="select[]">
> > <option ...
> > </select>
> >
> > <select name="select[]">
> > <option ...
> > </select>
> >
> > etc...
> >
> > That will give you an array $select[] on the processing page. If the
> > selects are multi-selects, you'll have a multidimensional array. The
> > first chosen element in the first select box can be referenced like
this
> >
> > $select[0][0]
> >
> > You can get a count of how many select boxes there are by doing
> >
> > count($select);
> >
> > You can get a count of how many elements were selected within a
select
> > you can do this:
> >
> > count($select[x]);
> >
> > Where x is the number of the select box you want to know about.
> >
> > Confusing, eh?
> >
> > ---John Holmes...
> >
> >> -----Original Message-----
> >> From: Victor Spång Arthursson [mailto:[EMAIL PROTECTED]]
> >> Sent: Sunday, May 26, 2002 7:44 AM
> >> To: [EMAIL PROTECTED]
> >> Subject: Re: [PHP] Need some advice concerning forms (multi select
> >> pulldown) and arrays
> >>
> >>
> >> On Sunday, May 26, 2002, at 01:14 PM, John Holmes wrote:
> >>
> >>> Just give each select its own name.
> >>
> >> Can't do that, don't know from time to time how many there'll
be....
> > And
> >> I've to have some case which iterates on the following page...
> >>
> >>> Or name them all the same followed
> >>> by an [] and you'll end up with a multi-dimensional array if
things
> > go
> >>> right...
> >>
> >> Sounds better - but I've a lot of items and I'ld like to know which
of
> >> the arrays that go to which item... Can I just write
> >> …name=array[whateverid] and then in some way reveal the
whateverid's?
> >>
> >> Sincerely
> >>
> >> Victor
> >
> >


--- End Message ---
--- Begin Message ---
hi,

is there still an equivalent function to pdf_set_info() -> pdf_get_info(); 
or another possibility to get the title, subject and author information out
of an exsiting .pdf-file? 

thanx


--- End Message ---
--- Begin Message ---
[EMAIL PROTECTED] (Dietmar Thamm) wrote:

 > hi,
>
 > is there still an equivalent function to pdf_set_info() -> pdf_get_info(); 
 > or another possibility to get the title, subject and author information out
 > of an exsiting .pdf-file? 

pdflib dont support getting information AFAIK.

-- 
Henrik Hansen
--- End Message ---
--- Begin Message ---
hmmhh,

in the PDFlib feature-list there is written
...process existing PDF documents with the PDF import library PDI...
any ideas what this "pdi" thing is about??

thanx


"Henrik Hansen" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
news:<[EMAIL PROTECTED]>...
> [EMAIL PROTECTED] (Dietmar Thamm) wrote:
> 
>  > hi,
> >
>  > is there still an equivalent function to pdf_set_info() -> pdf_get_info(); 
>  > or another possibility to get the title, subject and author information out
>  > of an exsiting .pdf-file? 
> 
> pdflib dont support getting information AFAIK.
> 
> -- 
> Henrik Hansen
-------
jads edv dienstleistungen - dietmar thamm
immenhoferstrasse 23
70180 stuttgart
phone: +49 (0)711 9641527
mobil: +49 (0)175 4118884
e-mail: [EMAIL PROTECTED]
http://www.jads.net

--- End Message ---
--- Begin Message ---
Dietmar Thamm <[EMAIL PROTECTED]> wrote:

 > hmmhh,
>
 > in the PDFlib feature-list there is written
 > ...process existing PDF documents with the PDF import library PDI...
 > any ideas what this "pdi" thing is about??

yeah it's not about getting pdf information :(

-- 
Henrik Hansen

--- End Message ---
--- Begin Message ---
Hello!

I'm happy to announce the latest version of the Xdebug extension for PHP 
4.2.1 and 4.3.0-dev. This new version has a lot of new and improved 
functionality. This includes:

- improved support for arguments to user defined functions
- trace functions to trace function calls during the whole script
  (including included files)
- PHP 4.2.1 compability
- support for Windows
- support for include, require and eval
- new functions for enabling and disabling xdebug from php.ini and the 
  script
- new function to return the amount of used memory during script execution

There are still a few points left on the road to Xdebug 1.0.0. These will 
be implemented in the near future:

- Support for variable function names
- Support for class names
- Tracing variables in functions
- Profiling


You can find the source and binaries of the Xdebug extension at the 
project site at http://www.jdimedia.nl/xdebug.php.

Derick

---------------------------------------------------------------------------
 Derick Rethans                             http://www.jdimedia.nl/derick/ 
 JDI Media Solutions                               http://www.jdimedia.nl/
---------------------------------------------------------------------------


--- End Message ---
--- Begin Message ---
Hi,
In java servlets I used to use a "synchronised" block of code to make sure
it was thread safe...how do i do this in PHP?

Heres what should be thread safe

{
$r=select max(cno)+1 from MyTable;
(then i insert into the table the new cno plus my name)
insert into mytable ($r,'myname');
}
How to do this and make sure its thread safe?

Any help appreciated,
-Ryan

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

You could use a transaction block if your database supports it, or just use 
some sort of auto-numbering field, such as SERIAL in Postgres, 
auto_increment in MySQL, etc. Then you wouldn't have to worry about 
retrieving the next cno before inserting a new row.

J


R wrote:

> Hi,
> In java servlets I used to use  a "synchronised" block of code to make 
sure
> it was thread safe...how do i do this in PHP?
> 
> Heres what should be thread safe
> 
> {
> $r=select max(cno)+1 from MyTable;
> (then i insert into the table the new cno plus my name)
> insert into mytable ($r,'myname');
> }
> How to do this and make sure its thread safe?
> 
> Any help appreciated,
> -Ryan

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

I cannot seem to compile PHP properly as a standalone binary.

Whether I use
"./configure --with-mysql"
OR
"./configure --with-mysql=/usr"

...whenever I run the compiled binary I get...

"PHP Warning:  Function registration failed - duplicate name -
mysql_connect in Unknown on line 0"

...and the same again for all the mysql_*() functions.

A google search returns nothing of use.  I have got this error with
both 4.1.2 and 4.2.1 of PHP.  I am using MySQL 3.23.37 on Linux.

Thanks in advance,

Ben Kennish
[EMAIL PROTECTED]

--- End Message ---
--- Begin Message ---
I have a page that creates form elements dynamically. Every time the amount
of form elements is different.

So to the page that I submit to I need to see how the whole request object.
Is that possible?

/Jose




--- End Message ---
--- Begin Message ---
if I am not mistaken the equivalent in asp is
Request.Form();

/j

"Jose Jeria" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I have a page that creates form elements dynamically. Every time the
amount
> of form elements is different.
>
> So to the page that I submit to I need to see how the whole request
object.
> Is that possible?
>
> /Jose
>
>
>
>


--- End Message ---
--- Begin Message ---
It's called $HTTP_POST_VARS or $HTTP_GET_VARS, depending on the method
of your form. It's an array that holds all of the data that was send
through the form. In PHP 4.1+ you can use $_POST and $_GET. 

Use print_r($HTTP_POST_VARS) to see the contents of it in one of your
scripts.

---John Holmes...

> -----Original Message-----
> From: Jose Jeria [mailto:[EMAIL PROTECTED]]
> Sent: Monday, May 27, 2002 12:23 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] request object
> 
> I have a page that creates form elements dynamically. Every time the
> amount
> of form elements is different.
> 
> So to the page that I submit to I need to see how the whole request
> object.
> Is that possible?
> 
> /Jose
> 
> 
> 
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php


--- End Message ---
--- Begin Message ---
Hello,
I have very wierd problem :
I use session to manage users and I have this structure of the page :
-----
include("db.php");
include("header.php");
bla bla
include("footer.php");
-----

in the db.php I have :

----
session_start();
#some mysql connect stuff
----

I use session with the $_SESSION array (cheking if registered[isset($_S...)]
and registering...)
and all work fine....
but sometimes the page loading is very very very slow (and its a really
really fast host) and when I removing session_start(); from the top of the
page, the page load normaly.

the PHP version is 4.1.1, someone have an idea ?
thanks in advance,
Dima.




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

It might have something to do with the way the session extension in PHP 
performs garbage collection. There's a setting in php.ini that basically 
controls how often garbage collection is performed. The value is a 
percentage, and determines how often the GC should be done over a random 
number of session_start() requests. 

If GC is invoked, the garbage collector will start to delete all of the 
expired session files in your session directory. If there's a lot of them, 
it might take longer to load the page that the garbage collection was 
started on. Since the garbage collector is called at random based on the 
aforementioned setting, not every page will be affected.

The problem could probably be cut down by increasing the value of the GC 
setting, as fewer files would need to be deleted with each GC sweep, as 
more GC sweeps will be called overall.

That's just a guess, though. 

J


Dima Dubin wrote:

> Hello,
> I have very wierd problem :
> I use session to manage users and I have this structure of the page :
> -----
> include("db.php");
> include("header.php");
> bla bla
> include("footer.php");
> -----
> 
> in the db.php I have :
> 
> ----
> session_start();
> #some mysql connect stuff
> ----
> 
> I use session with the $_SESSION array (cheking if
> registered[isset($_S...)] and registering...)
> and all work fine....
> but sometimes the page loading is very very very slow (and its a really
> really fast host) and when I removing session_start(); from the top of the
> page, the page load normaly.
> 
> the PHP version is 4.1.1, someone have an idea ?
> thanks in advance,
> Dima.

--- End Message ---
--- Begin Message ---
Hi...

Is there a function getSize() of ming or libswf?

I want to send Flash imagens to server to put them
into HTML, but I need the width and height of the
image, and I don`t want to ask this for the user!!

thanks,

Augusto

_______________________________________________________________________
Yahoo! Encontros
O lugar certo para você encontrar aquela pessoa que falta na sua vida. Cadastre-se 
hoje mesmo!
http://br.encontros.yahoo.com/
--- End Message ---
--- Begin Message ---
Problem. I have a php 4.0.6. on linux as Apache module.  I need to do folowing:

I have in my script some value, for example "$value"
and  
in /bin on my linux box c language program called "something". (I need speed) . 

I need to parse $value thru stdin /bin/something program to get from its stdout a 
$parsed_value.

How to  run external program (for example  /bin/something ), write to its  STDIN  
$value and  then read from its STDOUT to  variable  $parsed_value ?


Example code needed.
 

thanx
--- End Message ---
--- Begin Message ---
I don't have example code, but what you want is the exec() function. Be
careful passing user variables to a command line program. 

www.php.net/exec

---John Holmes...

> -----Original Message-----
> From: ing.Martin Prášek [mailto:[EMAIL PROTECTED]]
> Sent: Monday, May 27, 2002 1:21 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] PHP script and external C program
> 
> Problem. I have a php 4.0.6. on linux as Apache module.  I need to do
> folowing:
> 
> I have in my script some value, for example "$value"
> and
> in /bin on my linux box c language program called "something". (I need
> speed) .
> 
> I need to parse $value thru stdin /bin/something program to get from
its
> stdout a $parsed_value.
> 
> How to  run external program (for example  /bin/something ), write to
its
> STDIN  $value and  then read from its STDOUT to  variable
$parsed_value ?
> 
> 
> Example code needed.
> 
> 
> thanx

--- End Message ---
--- Begin Message ---
Good day,

I have a command-line PHP script that connects to an LDAP database and does
some queries.

To increase security, I would like to not put the bind password into the
program, and instead have the user type it in.  But, I'd like to have this
done so that the password is not echo'd to the screen.

Lots of searching has shown that people have done something similar in C and
Perl by closing the stdout channel.  But, I haven't found anything similar
in PHP (and I would need to reopen the channel again somehow afterwards
anyway).

Does anyone have a suggestion on how this might be accomplished?

In the meantime I'll just put the password in the program, but, I'd like to
learn how this could be done.

Thanks in advance,

============================
Darren Gamble
Planner, Regional Services
Shaw Cablesystems GP
630 - 3rd Avenue SW
Calgary, Alberta, Canada
T2P 4L4
(403) 781-4948

--- End Message ---
--- Begin Message ---
Is it possible to display images in a browser that are stored as a blob
column in a mysql table? Or is it better to store images in a direcotory and
display them "from" there?

-Ragnar


--- End Message ---
--- Begin Message ---
On Mon, 27 May 2002, Ragnar wrote:

>-Is it possible to display images in a browser that are stored as a blob
>-column in a mysql table? Or is it better to store images in a direcotory and
>-display them "from" there?

IMHO it is better to let a file system store the image files and let MySQL
reference the file names and do overall organization.

However, it is possible to store the image in MySQL and have it displayed
in a browser. 


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

**************************************

John Huggins
VANet

[EMAIL PROTECTED]
http://www.va.net/

**************************************

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

As stated in the topic: PHP 4.1.2 balantly ignores max_upload_filesize 
paramter. I've been trying - without solution - to get php 4.1.2 (compiled as 
module for apache 1.3.xx) to accept a file upload (via post) of more than 2 
mb. Files <= 2mb work great, but when I go above this php returns 
is_uploaded_file() with false, even tho the file is correct. It also doesn't 
seem to be saved correctly.

I am not using ANY ini-file, but I've been able to reproduce this behaviour 
with an ini file (on a different system, same php/apache versions)

Is there something I'm missing here?

Thanks!

DK
--- End Message ---
--- Begin Message ---
You cannot change the upload limit in your script because the file upload
happens before your script is executed.  You need to set it in your
php.ini, httpd.conf or .htaccess

-Rasmus

On Mon, 27 May 2002, DevilKin wrote:

> Hello,
>
> As stated in the topic: PHP 4.1.2 balantly ignores max_upload_filesize
> paramter. I've been trying - without solution - to get php 4.1.2 (compiled as
> module for apache 1.3.xx) to accept a file upload (via post) of more than 2
> mb. Files <= 2mb work great, but when I go above this php returns
> is_uploaded_file() with false, even tho the file is correct. It also doesn't
> seem to be saved correctly.
>
> I am not using ANY ini-file, but I've been able to reproduce this behaviour
> with an ini file (on a different system, same php/apache versions)
>
> Is there something I'm missing here?
>
> Thanks!
>
> DK
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

--- End Message ---
--- Begin Message ---
Dear fellars at php.net

It appears to me that there is something wrong with the mail() function,

I've got an Apache 2.0.36 webserver in an Windows XP environment,
now everythin seems to work just fine until I try to execute this:

mail("[EMAIL PROTECTED]", "My Subject", "Line 1\r\nLine 2\r\nLine3");

it's almost the same code as on your web site but I changed the 
[EMAIL PROTECTED] to my own e-mail adress so I would be able to see if 
I've got the mail. I tried severeal ways (somethin with IMAP or such?) but 
since I'm a php newbie it is quite hard to find understandable 
documentation.

I hope you are well informed by now and you can come up with some sort of an 
answer.

Greetings,

Jochem Kempe




_________________________________________________________________
Send and receive Hotmail on your mobile device: http://mobile.msn.com

--- End Message ---
--- Begin Message ---
There is also a user note at the bottom of the documentation:
I tried to put "\r\n" at the end of each header line and Netscape
4.7 didn't work properly. I changed to "\n" and it worked well.
So, I tried it on Outlook Express 5.5 and Eudora 5.1 and it worked too
with "\n" only.

I hope it helps...

If this doesn't help, then maybe this is due to apache 2.0 since many php
scripts are not working on apache 2.0
> Dear fellars at php.net
>
> It appears to me that there is something wrong with the mail() function,
>
> I've got an Apache 2.0.36 webserver in an Windows XP environment,
> now everythin seems to work just fine until I try to execute this:
>
> mail("[EMAIL PROTECTED]", "My Subject", "Line 1\r\nLine 2\r\nLine3");
>
> it's almost the same code as on your web site but I changed the
> [EMAIL PROTECTED] to my own e-mail adress so I would be able to see if
> I've got the mail. I tried severeal ways (somethin with IMAP or such?) but
> since I'm a php newbie it is quite hard to find understandable
> documentation.
>
> I hope you are well informed by now and you can come up with some sort of an
> answer.
>
> Greetings,
>
> Jochem Kempe
>
>
>
>
> _________________________________________________________________
> Send and receive Hotmail on your mobile device: http://mobile.msn.com
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

-Pushkar S. Pradhan

--- End Message ---
--- Begin Message ---
I think you meant changing \r\n doesn't work?
Did you make necessary changes to the php.ini file:
[mail function]
; For Win32 only.
SMTP = localhost

; For Win32 only.
sendmail_from = [EMAIL PROTECTED]

; For Unix only.  You may supply arguments as well (default: 'sendmail -t
-i').
;sendmail_path =
Give the path of your sendmail, finally if nothing works it means apache
2.0 is the problem, it means many things in php won't work with it.
> Alright, so it doesn't work with my version of php. How can I make it work?
>
> Jochem
>
>
> From: Pushkar Pradhan <[EMAIL PROTECTED]>
> To: Jochem Kempe <[EMAIL PROTECTED]>
> CC: [EMAIL PROTECTED]
> Subject: Re: [PHP] mail() function
> Date: Mon, 27 May 2002 14:58:37 -0500 (CDT)
>
> There is also a user note at the bottom of the documentation:
> I tried to put "\r\n" at the end of each header line and Netscape
> 4.7 didn't work properly. I changed to "\n" and it worked well.
> So, I tried it on Outlook Express 5.5 and Eudora 5.1 and it worked too
> with "\n" only.
>
> I hope it helps...
>
> If this doesn't help, then maybe this is due to apache 2.0 since many php
> scripts are not working on apache 2.0
>  > Dear fellars at php.net
>  >
>  > It appears to me that there is something wrong with the mail() function,
>  >
>  > I've got an Apache 2.0.36 webserver in an Windows XP environment,
>  > now everythin seems to work just fine until I try to execute this:
>  >
>  > mail("[EMAIL PROTECTED]", "My Subject", "Line 1\r\nLine 2\r\nLine3");
>  >
>  > it's almost the same code as on your web site but I changed the
>  > [EMAIL PROTECTED] to my own e-mail adress so I would be able to see if
>  > I've got the mail. I tried severeal ways (somethin with IMAP or such?)
> but
>  > since I'm a php newbie it is quite hard to find understandable
>  > documentation.
>  >
>  > I hope you are well informed by now and you can come up with some sort of
> an
>  > answer.
>  >
>  > Greetings,
>  >
>  > Jochem Kempe
>  >
>  >
>  >
>  >
>  > _________________________________________________________________
>  > Send and receive Hotmail on your mobile device: http://mobile.msn.com
>  >
>  >
>  > --
>  > PHP General Mailing List (http://www.php.net/)
>  > To unsubscribe, visit: http://www.php.net/unsub.php
>  >
>
> -Pushkar S. Pradhan
>
>
>
>
>
> _________________________________________________________________
> Send and receive Hotmail on your mobile device: http://mobile.msn.com
>

-Pushkar S. Pradhan

--- End Message ---
--- Begin Message ---
I managed to be somewhat succesfull while trying to get PHP4 and IMP to get
quota information from my IMAP server (Vircom's VOPMail for Windows
NT/2000 - available from www.vircom.com).

I changed the script a little bit to talk right to Vircom's IMAP server but
its response differs a little from what RFC 2087 says. While Vircom replies
with (STORAGE 10 20480 TRIGGER 0 17408), PHP4's get_imap_quota expects
(STORAGE 10 20480), without the TRIGGER. The result is that PHP4 is
considering the usage to be 0 and the quota 17408. Looks like it gets the
last two numbers it finds and uses it, but I'm not sure...

I'm no C programmer and couldn't actually find the way that PHP4 and/or WU
IMAP c-client tries to understand the output from the server. So, could
anyone point to me the way to change this behavior and understand my
server's information?

--
Luiz Lima
Image Link Internet
http://www.imagelink.com.br


--- End Message ---

Reply via email to