OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
From: php-general-digest-helplists.php.net
Date: Thu Aug 09 2001 - 03:20:56 CDT

  • Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

    php-general Digest 9 Aug 2001 08:20:56 -0000 Issue 805

    Topics (messages 61904 through 61956):

    Re: 3rd include
            61904 by: Drew P. Vogel

    Re: RANDOM
            61905 by: Greg Donald

    regexps
            61906 by: Kurth Bemis
            61911 by: scott [gts]
            61912 by: CC Zona
            61923 by: Daniel James

    last modification time
            61907 by: BRACK
            61914 by: Matt Kaufman
            61916 by: Bjorn Van Simaeys
            61926 by: Bjorn Van Simaeys

    Emulating a POST
            61908 by: Brandon Orther
            61910 by: Jack Dempsey
            61928 by: Tyrone Mills

    PHP_SELF and mod_rewrite
            61909 by: Geoff Caplan

    register_shutdown_function and a MySQL query keeping connection with browser.
            61913 by: Jeff Bearer

    [PHP-WIN] Binary GD Library for W2K
            61915 by: ignacio.estrada.cfe.gob.mx
            61947 by: SED

    Re: PHP in corporate settings?
            61917 by: Inércia Sensorial
            61918 by: Bjorn Van Simaeys

    exec a perl script
            61919 by: Alien8 Recordings

    Bad SetCookie code or Bad Internet Explorer 4.0??
            61920 by: Jeff Gannaway

    Re: Bug?
            61921 by: \[osd.dk\] Tais M. Hansen

    Re: Alternate way of calling php scripts
            61922 by: Daniel James
            61931 by: Evan Nemerson

    Cannot Set ExpireTime in a cookie
            61924 by: Jeff Gannaway

    htaccess & php
            61925 by: Chris Kay
            61927 by: Daniel James
            61929 by: Chris Kay
            61933 by: Inércia Sensorial

    PHP Configuration issues in IIS 5.0 in win2k
            61930 by: Mikey

    Re: Session problem
            61932 by: Yasuo Ohgaki

    Re: weird behavior with a form
            61934 by: Richard Lynch

    Re: persistence variable value - help
            61935 by: Richard Lynch

    Re: How to destroy a $variable
            61936 by: Richard Lynch

    Re: Reading with C 'struct' data
            61937 by: Richard Lynch

    Re: Postgresql + Sessions + Large objects.
            61938 by: Richard Lynch

    Re: Converting HTTP_POST_VARS to HTTP_SESSION_VARS !
            61939 by: Richard Lynch

    Re: chmod
            61940 by: Richard Lynch

    Re: most recent 5 rows
            61941 by: Richard Lynch

    Re: Cookies and servers problems
            61942 by: Richard Lynch

    Re: Update a SESSION_VAR on form submit
            61943 by: Richard Lynch

    Re: PHP & JAVA: Odd Behavior
            61944 by: Richard Lynch

    Re: include path syntax for php.ini under windows
            61945 by: Richard Lynch

    Re: file downloads
            61946 by: Richard Lynch

    Resize Picture
            61948 by: Mark Lo
            61949 by: Daniel James

    CGI error
            61950 by: karthik
            61956 by: Phil Driscoll

    Paypal & instant payment notification
            61951 by: Erica Douglass
            61953 by: Jason Murray

    Re: code to see files in directories
            61952 by: Karl Phillipson

    I need everyones opinon!
            61954 by: Scott Mebberson

    Re: checking for null form fields fails
            61955 by: Renze Munnik

    Administrivia:

    To subscribe to the digest, e-mail:
            php-general-digest-subscribelists.php.net

    To unsubscribe from the digest, e-mail:
            php-general-digest-unsubscribelists.php.net

    To post to the list, e-mail:
            php-generallists.php.net

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

    attached mail follows:


    Ok. That is it. Sorry for the confusion and thank you for the help.

    --Drew Vogel

    On Wed, 8 Aug 2001, Mark Roedel wrote:

    >> -----Original Message-----
    >> From: Drew P. Vogel [mailto:dvogelintercarve.net]
    >> Sent: Wednesday, August 08, 2001 3:14 PM
    >> To: Mark Roedel
    >> Cc: php-generallists.php.net
    >> Subject: RE: [PHP] 3rd include
    >>
    >>
    >> If a file is included from within a function, this would limit the
    >> variable cope of this file, correct?
    >
    >Yes it would. (Specifically, it would mean that everything in that file
    >operates at the same scope as the function in which it's included.
    >That, in turn, means that $HTTP_POST_VARS is likely only available if
    >it's been declared as global within that function.
    >
    >
    >---
    >Mark Roedel (roedelmletu.edu) || "There cannot be a crisis next week.
    >Systems Programmer / WebMaster || My schedule is already full."
    > LeTourneau University || -- Henry Kissinger
    >
    >
    >
    >> On Wed, 8 Aug 2001, Mark Roedel wrote:
    >>
    >> >> -----Original Message-----
    >> >> From: Drew P. Vogel [mailto:dvogelintercarve.net]
    >> >> Sent: Wednesday, August 08, 2001 2:19 PM
    >> >> To: Mark Roedel
    >> >> Cc: php-generallists.php.net
    >> >> Subject: RE: [PHP] 3rd include
    >> >>
    >> >>
    >> >> You're right. It is not discuessed there. My memory served me
    >> >> incorrectly.
    >> >>
    >> >> In index.php (the file loaded by php),
    >> >> echo( $HTTP_POST_VARS["last_name"] );
    >> >> will print the variable contents, but in save_script.php
    >> >> (the 3rd file included) the same function call will print
    >> >> nothing.
    >> >
    >> >Are you quite sure there's not something else going on here?
    >> (An issue
    >> >of the $HTTP_POST_VARS array being out-of-scope inside a
    >> function, for
    >> >example?) I'm sure I would have run into this behavior by now if it
    >> >were a system bug.
    >> >
    >> >For whatever it's worth, I just did a test, with includes nested ten
    >> >deep, and $HTTP_POST_VARS kept its value at every level. (PHP 4.0.6,
    >> >Apache 1.3.20, FreeBSD 4-Stable)
    >> >
    >> >
    >> >---
    >> >Mark Roedel (roedelmletu.edu) || "There cannot be a
    >> crisis next week.
    >> >Systems Programmer / WebMaster || My schedule is already full."
    >> > LeTourneau University || --
    >> Henry Kissinger
    >> >
    >> >
    >>
    >>
    >>
    >>
    >

    attached mail follows:


    On Wed, 8 Aug 2001, Kyle Smith wrote:

    > Could somebody please show me, send me an example or redirect me to a page which shows how to show a random FLASH movie from a text file which contains different names of different movies so that when i go on the page it shows lets say, 1 of the 5 movies in the text document.
    >
    > Finally and almost hard question (probably not for you but for me.... AGGH)

    Something like this oughta do:

    <?
    mt_srand ((double) microtime() * 1000000);
    $randval = mt_rand(1,5);
    ?>

    <param name="movie" value="movie.<?=$randval?>.swf">

    -- 
    -----------------------------------------------------------------------
    destiney - (des-ti-ny) - n. 1. deity of all things "html", 2. common
    internet addict, 3. lover of late 80's heavy metal music, 4. Activist
    for the terminally un-elite; see also - cool guy, des, mr. php...
    

    It's 4:00am, your web site is still up, why are you? http://phplinks.org/ http://phptopsites.com/ http://destiney.com/ -----------------------------------------------------------------------

    attached mail follows:


    i need to find out if a string (user imputed) conatins numbers. I want only a-zA-Z to be in a field. (their name for example....and city)...i have the following however my regexps are VERY weak as i am a beginner.

    function validatetext($text){ if (is_string($text)== 1){ return "good"; }else{ return "bad"; } }

    ~kurth

    attached mail follows:


    here are two regexps that might do what you want

    "\w" matches alphanum (1-9a-zA-z)

    IMO, the best way to check for non-alphanum chars is to check for "\W" (upper case is negation of alphanum, which will match only non-alphanum).

    if (preg_match('/^\w+$/', $data)) { print "entirely alphanum } if (preg_match('/\W+/', $data)) { print "Contains non-alphanum!!"; }

    > -----Original Message----- > From: Kurth Bemis [mailto:kurthusaexpress.net] > Sent: Wednesday, August 08, 2001 4:43 PM > To: php-generallists.php.net > Subject: [PHP] regexps > > > i need to find out if a string (user imputed) conatins numbers. I want > only a-zA-Z to be in a field. (their name for example....and city)...i > have the following however my regexps are VERY weak as i am a beginner. > > function validatetext($text){ > if (is_string($text)== 1){ > return "good"; > }else{ > return "bad"; > } > } > > ~kurth > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > For additional commands, e-mail: php-general-helplists.php.net > To contact the list administrators, e-mail: php-list-adminlists.php.net >

    attached mail follows:


    In article <KFEKLFMNHDILCMFAEKJCAEFIDAAA.scottgraphictype.com>, scottgraphictype.com (Scott) wrote:

    > here are two regexps that might do what you want > > "\w" matches alphanum (1-9a-zA-z)

    (0-9a-zA-Z_) actually. Don't forget that zero and underscore!

    > IMO, the best way to check for non-alphanum chars is > to check for "\W" (upper case is negation of alphanum, > which will match only non-alphanum).

    Yep, works nicely as long as including the underscore as one of the alphanumeric character is acceptable for your purposes.

    -- 
    CC
    

    attached mail follows:


    if (preg_match("/\d/", $data) { print 'The $data contained a number'; }

    On 2001.08.09 07:05 scott [gts] wrote: > here are two regexps that might do what you want > > "\w" matches alphanum (1-9a-zA-z) > > IMO, the best way to check for non-alphanum chars is > to check for "\W" (upper case is negation of alphanum, > which will match only non-alphanum). > > > > if (preg_match('/^\w+$/', $data)) { > print "entirely alphanum > } > if (preg_match('/\W+/', $data)) { > print "Contains non-alphanum!!"; > } > > > > -----Original Message----- > > From: Kurth Bemis [mailto:kurthusaexpress.net] > > Sent: Wednesday, August 08, 2001 4:43 PM > > To: php-generallists.php.net > > Subject: [PHP] regexps > > > > > > i need to find out if a string (user imputed) conatins numbers. I want > > > only a-zA-Z to be in a field. (their name for example....and city)...i > > > have the following however my regexps are VERY weak as i am a beginner. > > > > function validatetext($text){ > > if (is_string($text)== 1){ > > return "good"; > > }else{ > > return "bad"; > > } > > } > > > > ~kurth > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > > For additional commands, e-mail: php-general-helplists.php.net > > To contact the list administrators, e-mail: > php-list-adminlists.php.net > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > For additional commands, e-mail: php-general-helplists.php.net > To contact the list administrators, e-mail: php-list-adminlists.php.net >

    attached mail follows:


    Is there any function that can fetch a time of last modification of the remote document.

    For example I have a links based on the MySQL database, and I want to know what linked site was most resently renewed.

    Thank you

    Youri

    attached mail follows:


    What I do is put a timestamp in the database, using the time(); function, select it and format it.

    Matt Kaufman ----- Original Message ----- From: "BRACK" <braknettaxi.com> To: <php-generallists.php.net> Sent: Wednesday, August 08, 2001 1:40 PM Subject: [PHP] last modification time

    > Is there any function that can fetch a time of last modification of the > remote document. > > For example I have a links based on the MySQL database, and I > want to know what linked site was most resently renewed. > > Thank you > > Youri > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > For additional commands, e-mail: php-general-helplists.php.net > To contact the list administrators, e-mail: php-list-adminlists.php.net > > >

    attached mail follows:


    Hey,

    This is not what BRACK a.k.a. Youri meant (it seems that Youri is being misunderstood daily...)

    He meant that if you can see when the remote server pages have been updated by their respective webmaster. I personally don't think that there is a way you can get this information from *ANOTHER SERVER*. But I hope I have clarified Youri's question once again.

    Greetz, Bjorn Van Simaeys www.bvsenterprises.com *** Efficient Communication starts by LISTENING! ***

    --- Matt Kaufman <phpnettechboost.com> wrote: > What I do is put a timestamp in the database, using > the time(); function, > select it and format it. > > Matt Kaufman > ----- Original Message ----- > From: "BRACK" <braknettaxi.com> > To: <php-generallists.php.net> > Sent: Wednesday, August 08, 2001 1:40 PM > Subject: [PHP] last modification time > > > > Is there any function that can fetch a time of > last modification of the > > remote document. > > > > For example I have a links based on the MySQL > database, and I > > want to know what linked site was most resently > renewed. > > > > Thank you > > > > Youri > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: > php-general-unsubscribelists.php.net > > For additional commands, e-mail: > php-general-helplists.php.net > > To contact the list administrators, e-mail: > php-list-adminlists.php.net > > > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: > php-general-unsubscribelists.php.net > For additional commands, e-mail: > php-general-helplists.php.net > To contact the list administrators, e-mail: > php-list-adminlists.php.net >

    __________________________________________________ Do You Yahoo!? Make international calls for as low as $.04/minute with Yahoo! Messenger http://phonecard.yahoo.com/

    attached mail follows:


    For your information... -------

    The http header contains the modification date: Last-Modified: Tue, 26 Jun 2001 03:46:20 GMT

    do this, telnet www.somehost.com 80 wait till it does this: Trying 203.52.23.1... Connected to www.somehost.com. then type this: HEAD /path/to/file/or/directory/ HTTP/1.0

    (hit enter twice)

    enjoy

    Twigman...

    On 2001.08.09 08:01 Bjorn Van Simaeys wrote: > Hey, > > This is not what BRACK a.k.a. Youri meant (it seems > that Youri is being misunderstood daily...) > > He meant that if you can see when the remote server > pages have been updated by their respective webmaster. > I personally don't think that there is a way you can > get this information from *ANOTHER SERVER*. But I hope > I have clarified Youri's question once again. > > > Greetz, > Bjorn Van Simaeys > www.bvsenterprises.com > *** Efficient Communication starts by LISTENING! *** > > > --- Matt Kaufman <phpnettechboost.com> wrote: > > What I do is put a timestamp in the database, using > > the time(); function, > > select it and format it. > > > > Matt Kaufman > > ----- Original Message ----- > > From: "BRACK" <braknettaxi.com> > > To: <php-generallists.php.net> > > Sent: Wednesday, August 08, 2001 1:40 PM > > Subject: [PHP] last modification time > > > > > > > Is there any function that can fetch a time of > > last modification of the > > > remote document. > > > > > > For example I have a links based on the MySQL > > database, and I > > > want to know what linked site was most resently > > renewed. > > > > > > Thank you > > > > > > Youri

    __________________________________________________ Do You Yahoo!? Make international calls for as low as $.04/minute with Yahoo! Messenger http://phonecard.yahoo.com/

    attached mail follows:


    Hello, I have used perl to emulate a post with LWP:UserAgent I am looking for the same effect in php. Does anyone know how I can do this? Thank you Brandon

    attached mail follows:


    www.php.net/curl

    jack

    -----Original Message----- From: Brandon Orther [mailto:ortherwebintellects.com] Sent: Wednesday, August 08, 2001 4:51 PM To: PHP User Group Subject: [PHP] Emulating a POST

    Hello, I have used perl to emulate a post with LWP:UserAgent I am looking for the same effect in php. Does anyone know how I can do this? Thank you Brandon

    attached mail follows:


    I use CURL... Works beautifully...

    -----Original Message----- From: Brandon Orther [mailto:ortherwebintellects.com] Sent: Wednesday, August 08, 2001 1:51 PM To: PHP User Group Subject: [PHP] Emulating a POST

    Hello, I have used perl to emulate a post with LWP:UserAgent I am looking for the same effect in php. Does anyone know how I can do this? Thank you Brandon

    attached mail follows:


    Hi folks

    Strange goings on with PHP_SELF and mod_rewrite

    On my development server, PHP_SELF gives me the original request url, before it is rewritten.

    I have moved the app onto a shared production server, and now PHP_SELF is givimg me the path AFTER it is rewritten.

    Which is the "correct" behaviour, and what is causing the "wrong" behaviour?

    Any advice much appreciated

    Geoff Caplan

    attached mail follows:


    I've been working with register_shutdown_function() to have the browser kick of a long running script and move on to other tasks. I was having problems where the browser would sit and spin untill the function was done running, then would display the page. I tinkered with flush and fflush (i'm writing to a file also) but that didn't work either. Flush showed me the screen, but the browser still keeps the connection open untill the function was done running. It seems to be caused by the mysql query or result and the loop of the result set. Below is some of the test script I put together. I'm using the PEAR DB_mysql class. I'm using the sleep where the part of the real script takes some time to run.

    Has anyone dealt with this before, does anyone have any ideas? The only idea I've thougt of so far is to load the record set into a 2D array and then flush the result set. That might allow the browser to disconnect before the time comsuming job starts.

    Any suggestions will be appriciated.

    <?php include "DB/mysql.php"; $db=new DB_mysql; $db->connect($dsn);

    echo "hello"; register_shutdown_function("tester"); exit;

    function tester(){ global $db; $sql="SELECT * FROM table"; $result = $db->query($sql); while($row = $result->fetchRow(2)){ sleep(5); } } ?>

    -- 
    Jeff Bearer, RHCE
    Webmaster
    PittsburghLIVE.com
    

    attached mail follows:


    Hi All, some partner in the world has the GD binaries ?, please don't doubth in tell me, I neeed it.

    Or let me know som shortcut way to get it.

    Thanks in advance !!

    Atte. Ignacio Estrada F. Centro Nacional de Control de Energia Area de Control Occidental 025+6463, 025+6464, 025+6469

    attached mail follows:


    Check this out -> http://php4win.de/

    SED

    -----Original Message----- From: ignacio.estradacfe.gob.mx [mailto:ignacio.estradacfe.gob.mx] Sent: 8. ágúst 2001 21:46 To: php-generallists.php.net Subject: [PHP] [PHP-WIN] Binary GD Library for W2K

    Hi All, some partner in the world has the GD binaries ?, please don't doubth in tell me, I neeed it.

    Or let me know som shortcut way to get it.

    Thanks in advance !!

    Atte. Ignacio Estrada F. Centro Nacional de Control de Energia Area de Control Occidental 025+6463, 025+6464, 025+6469

    -- 
    PHP General Mailing List (http://www.php.net/)
    To unsubscribe, e-mail: php-general-unsubscribelists.php.net
    For additional commands, e-mail: php-general-helplists.php.net To
    contact the list administrators, e-mail: php-list-adminlists.php.net
    

    attached mail follows:


    I don't think the problem is the open source nature. Corporate people usually do not see flaws on it. But they do not see the advantages too because there is little advertising.

    --
    

    Julio Nobrega.

    2B||!BB - That's the question.

    "Jeff Lewis" <jeffhyrum.net> wrote in message news:00dd01c1203b$60d62210$76a1a8c0LEWISJCIT... I still rarely ever see PHP mentioned in job listings and the like. Especially here in Canada I find it very hard to find any kinds of contacts for companies using PHP. My previous employer that I was with for 3+ years insisted on Micro$oft products and wanted to go with ASP.

    My current employer, a HUGE media/newspaper in Ontario goes with strictly Java.

    Is it that people still are hesitant to go wth open source based technology?

    Jeff Lewis

    attached mail follows:


    That's right. I have been working for a large computer company (2800 people), and my project manager had never even heard about PHP and such.

    Bjorn Van Simaeys

    --- Inércia Sensorial <inertehotmail.com> wrote: > I don't think the problem is the open source > nature. Corporate people > usually do not see flaws on it. But they do not see > the advantages too > because there is little advertising. > > -- > > > Julio Nobrega. > > 2B||!BB - That's the question. > > "Jeff Lewis" <jeffhyrum.net> wrote in message > news:00dd01c1203b$60d62210$76a1a8c0LEWISJCIT... > I still rarely ever see PHP mentioned in job > listings and the like. > Especially here in Canada I find it very hard to > find any kinds of contacts > for companies using PHP. My previous employer that > I was with for 3+ years > insisted on Micro$oft products and wanted to go with > ASP. > > My current employer, a HUGE media/newspaper in > Ontario goes with strictly > Java. > > Is it that people still are hesitant to go wth open > source based technology? > > Jeff Lewis > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: > php-general-unsubscribelists.php.net > For additional commands, e-mail: > php-general-helplists.php.net > To contact the list administrators, e-mail: > php-list-adminlists.php.net >

    __________________________________________________ Do You Yahoo!? Make international calls for as low as $.04/minute with Yahoo! Messenger http://phonecard.yahoo.com/

    attached mail follows:


    Hi,

    I am another person having trouble with the exec command. It has worked for me in the past, but not with the perl script I'm trying to exec today.

    Here is my code:

    $command ="/home/kyelateas/cgi-bin/test.pl"; exec($command, $return, $status); if ($return) { $return = implode("\n", $return); print "<pre>Data = $return\n\nStatus = $status</pre>"; } else echo "No data returned";

    I have two perl scripts. One of them simply prints "hello world" 4 times with a newline after each time. This works fine and the php page prints out the "hello world" statement 4 times.

    The problem is that I have another perl script which is a test script for an interface to an ecommerce server. It returns several lines of info describing the transaction. It works perfectly from the command line, but I can't get php to return any data when I use the above exec code on it. It's strange to me because from the shell they are pretty much the same. Type the path and name of the file to execute it and it returns a few lines of output. Why would this be any different for php? I know the script that connects with the ecommerce server takes a bit longer. Could that be the problem?

    Thanks in advance.

    Sean

    attached mail follows:


    Here's the deal: I swear this code worked to set a Cookie on IE 4.0 for weeks. Now when I went back to the site, it isn't setting the cookie. I isolated the script into its own file with nothing else before or after and am still having no luck.

    <? if (! $ArtPrintSession && $CheckingOut != "1") { $temp1=date("U"); $temp2=getmypid(); $SessionID="s".strval($temp1).strval($temp2).strval(Rand()%1000); SetCookie("ArtPrintSession",$SessionID,time()+60*60*24,"/"); } print "$SessionID"; ?>

    Here's what I've tried: * Clearing the cache and erasing all other cookies. * Setting the Cookie rules to "Prompt" and then "Accept All" * Uploading this program to another website of mine which does successfully send cookies to IE 4.0. However, this script doesn't work. * Uplading the script to the server in both ASCII mode and BINARY mode. * Closing and restarting IE. Shutting down and rebooting the PC. * This script DOES work with NETSCAPE.

    Even when sent to "Prompt before accepting cookies", I don't get a reaction on IE. This same copy of IE is accepting cookies form other sites.

    I know it's going throught the IF statement because a $SessionID is generated and printed out.

    Is there a bug in the script, or is this an IE problem?

    Thanks, Jeff Gannaway ___________________________________________________________

    Find the right art print for your home. * Search by artist, color, art style and subject. * Preview the art prints against your wall color. * Specializing in contemporary, abstract and African   American art. * Every day discounts on thousands of fine art prints.

    PopStreet.com is your avenue to art.

    http://www.popstreet.com ___________________________________________________________

    attached mail follows:


    Hi again,

    I can't really see much difference in the example you gave?

    But if it may have something to do with the "casting of an unknown fraction to int", I'll use floor() instead of casting. Same result:

    floor((8.85-8)*100) = 84

    I find that quite odd. I tried a few variations:

    floor((8.85-8.0)*100.0) = 84 floor((8.84-8)*100) = 83 floor((8.83-8)*100) = 83 floor((8.82-8)*100) = 82 floor((8.85*100)-(8*100)) = 85

    For more explicit examples/tests, you can take a look here: http://www.osd.dk/test/test-weirdint.php

    -Tais

    "Bjorn Van Simaeys" <cyberplasmayahoo.com> wrote in message news:20010808161136.72646.qmailweb13407.mail.yahoo.com... > Hello, > I remember there was a warning in the PHP Manual about > this. This is it: > ** Never cast an unknown fraction to integer, as this > can sometimes lead to unexpected results. > ** echo (int) ( (0.1+0.7) * 10 ); // echoes 7! > So do your calculations first, and then echo the > results. This way you get good habits in programming. > And your code will be easier to read as well! > > --- "[Intent A/S] Tais M. Hansen" <tmhintent.dk> > wrote: > > Hi! > > I just came across this weird thing. Bug? You tell > > me! > > print (int)((8.85-8)*100); > > I would think the line above would print "85". But > > for some reason, it > > prints "84"?? Can anyone tell me why that is?

    attached mail follows:


    I play with this lots, good fun..

    <html> <head> <title>Path: <?=$PATH_INFO?></title> </head> </html>

    the title of the page will contain the path you typed..

    Twigman...

    On 2001.08.08 23:13 Evan Nemerson wrote: > I seem to recall that you can call a PHP script with a slash after it > then > variables. For instance http://localhost/script.php/your=mom. I can't > find it > in the manual, and was wondering if anyone knows how it works. > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > For additional commands, e-mail: php-general-helplists.php.net > To contact the list administrators, e-mail: php-list-adminlists.php.net >

    attached mail follows:


    Thanks Tim and Daniel.

    $PATH_INFO works perfectly. The really nice thing is I can have a form post to it... Also good call with the base href. I would probably have forgotten it and just used absolute links.

    -Evan Nemerson

    attached mail follows:


    This is a follow-up to my previous cookie post.

    I discovered that the bit that Internet Explorer 4.0 didn't recognize a cookie as valid when I included an expiration time.

    This Works: setcookie ("ArtPrintSession",$SessionID);

    This Doesn't Work: setcookie ("ArtPrintSession",$SessionID,time()+3600);

    I also tried setting the expiration time earlier in a script and assigning it to a variable: $ExpTime = time()+3600 setcookie ("ArtPrintSession",$SessionID,$ExpTime);

    That also didn't work.

    The $ExpTime values look like: 997317780

    What's the bug???

    Thanks, Jeff Gannaway

    attached mail follows:


    Hi

    My question is that i am about to start a database and i have been asked to make the login/password like htaccess, now they also want to be able to modify passwords ect.... so i was going to do it with mysql.

    I have seen or been told that there is something where you can use sql/php and make it use something that look like htaccess but is not.

    is this true?

    if so where would i start looking for something along these lines..

    Answers/Comments welcome

    ------------------------------------------------------------------------ Chris Kay - Tech Support - IDEAL Internet email: chriskayideal.net.au phone: +61 2 4628 8888 fax: +61 2 4628 8890 ------------------------------------------------------------------------

    attached mail follows:


    You are looking for HTTP Authentication... http://www.php.net/manual/en/features.http-auth.php

    Twigman...

    On 2001.08.09 09:49 Chris Kay wrote: > > Hi > > My question is that i am about to start a database and i have been asked > to > make the login/password like htaccess, now they also want to be able to > modify passwords ect.... so i was going to do it with mysql. > > I have seen or been told that there is something where you can use > sql/php > and make it use something that look like htaccess but is not. > > is this true? > > if so where would i start looking for something along these lines.. > > Answers/Comments welcome > > > > ------------------------------------------------------------------------ > Chris Kay - Tech Support - IDEAL Internet > email: chriskayideal.net.au phone: +61 2 4628 8888 fax: +61 2 4628 8890 > ------------------------------------------------------------------------ > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > For additional commands, e-mail: php-general-helplists.php.net > To contact the list administrators, e-mail: php-list-adminlists.php.net >

    attached mail follows:


    ok.... Thanks dude i'll start there....

    At 10:01 AM 8/9/01 +1000, Daniel James wrote: >You are looking for HTTP Authentication... >http://www.php.net/manual/en/features.http-auth.php > >Twigman... > >On 2001.08.09 09:49 Chris Kay wrote: > > > > Hi > > > > My question is that i am about to start a database and i have been asked > > to > > make the login/password like htaccess, now they also want to be able to > > modify passwords ect.... so i was going to do it with mysql. > > > > I have seen or been told that there is something where you can use > > sql/php > > and make it use something that look like htaccess but is not. > > > > is this true? > > > > if so where would i start looking for something along these lines.. > > > > Answers/Comments welcome > > > > > > > > ------------------------------------------------------------------------ > > Chris Kay - Tech Support - IDEAL Internet > > email: chriskayideal.net.au phone: +61 2 4628 8888 fax: +61 2 4628 8890 > > ------------------------------------------------------------------------ > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, e-mail: php-general-unsubscribelists.php.net > > For additional commands, e-mail: php-general-helplists.php.net > > To contact the list administrators, e-mail: php-list-adminlists.php.net > > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: php-general-unsubscribelists.php.net >For additional commands, e-mail: php-general-helplists.php.net >To contact the list administrators, e-mail: php-list-adminlists.php.net

    ------------------------------------------------------------------------ Chris Kay - Tech Support - IDEAL Internet email: chriskayideal.net.au phone: +61 2 4628 8888 fax: +61 2 4628 8890 ------------------------------------------------------------------------

    attached mail follows:


    Here:

    http://hotwired.lycos.com/webmonkey/00/05/index2a.html?tw=programming

    --
    

    Julio Nobrega.

    2B||!BB - That's the question.

    "Chris Kay" <chriskayideal.net.au> wrote in message news:5.1.0.14.2.20010809094623.01d56440mail.ideal.net.au... > > Hi > > My question is that i am about to start a database and i have been asked to > make the login/password like htaccess, now they also want to be able to > modify passwords ect.... so i was going to do it with mysql. > > I have seen or been told that there is something where you can use sql/php > and make it use something that look like htaccess but is not. > > is this true? > > if so where would i start looking for something along these lines.. > > Answers/Comments welcome > > > > ------------------------------------------------------------------------ > Chris Kay - Tech Support - IDEAL Internet > email: chriskayideal.net.au phone: +61 2 4628 8888 fax: +61 2 4628 8890 > ------------------------------------------------------------------------ >

    attached mail follows:


    I can't seem to get my win2000 box to recognize the .php files. It's coming up with an error, and just reading them as test.php.txt files in explorer. How do i get this to work. I believe I've set everything up right. Could someone please email me with answers. Thanks

    Mike

    attached mail follows:


    "Hassan El Forkani" <webmasterwarmafrica.com> wrote in message news:5.1.0.14.2.20010807152322.00a35800pop.runbox.com... > > indeed it's not working properly, > first of all please make sur the pages are not cashed send a header > (Cache-control: NO cache) i'm not sure about the syntax so check the manual > then try to modify your code like this and tell us what happens: > > <?php > if (!HTTP_SESSION_VARS['count']) > { > global $count; > $count = 0; > session_register ("count");

    You don't need session_register() with $HTTP_SESSION_VARS. Just assign vlaue. If you want to unregister, just use unset().

    Using session_(un)register() with $HTTP_SESSION_VARS is tricky. So don't use. (You can save lines, too)

    --
    Yasuo Ohgaki
    

    attached mail follows:


    If they didn't click on the submit button, then they didn't click on the submit button, and it's not "set" by the browser.

    Check if the variable you care about inserting is set instead.

    --
    WARNING richardzend.com address is an endangered species -- Use
    ceol-i-e.com
    Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
    Volunteer a little time: http://chatmusic.com/volunteer.htm
    ----- Original Message -----
    From: Ben Bleything <bleythibucs.orst.edu>
    Newsgroups: php.general
    To: 'Richard Baskett' <rickbasketthome.com>; <php-generallists.php.net>
    Sent: Friday, August 03, 2001 7:25 PM
    Subject: RE: [PHP] weird behavior with a form
    

    > Perhaps a little clarification... I'm very sorry I wasn't clear in the > first place! => > > The page works fine if I click on submit with the mouse. I'm curious > why it doesn't when the user presses their 'Enter' key while the text > field is focused. > > They will be entering piles of info, just trying to make it more > convenient => > > Thanks again, > Ben > > -----Original Message----- > From: Richard Baskett [mailto:rickbasketthome.com] > Sent: Friday, August 03, 2001 5:31 PM > To: Benjamin Bleything; php-generallists.php.net > Subject: Re: [PHP] weird behavior with a form > > Try using this INSERT statement: > > $query = "INSERT INTO genres (name) VALUES ('$name')"; > > I subtracted one of the ";", I dont think you need it when running a > query > from php. Let's see.. what else.. hmm.. > > actually that's all I can see. Hopefully that does it. If not I hope > someone else answers :) > > Rick > > > Okay... so this is sorta off topic... but the form is generated by a > > script => > > > > Anyway, for some reason, when I fill in a form on my site and press > enter, > > it doesn't actually submit the form and do the processing like it is > > supposed to... it should be throwing some information into the > database. > > Instead, it seems to just be reloading the page. > > > > Source is below... if anybody has any idea, I would appreciate... I > > imagine I'm just doing something stupid wrong. > > > > Thanks, > > Ben > > > > --- SOURCE --- > > <?php > > > > include_once("../include/definitions.inc"); > > include_once("../include/functions.inc"); > > > > // Check to make sure they're allowed to be here > > session_start(); > > check_access($session_data); > > > > // They haven't clicked anything, so show the form > > if(!$submit) > > { ?> > > <html> > > <head> > > <title>Add Genre</title> > > <link rel="stylesheet" href="<?php echo $STYLESHEET; ?>" > type="text/css"> > > <script language="javascript"> > > > > function verify() > > { > > if(document.forms[0].name.value=="") > > { > > alert("The name field cannot be blank!"); > > return false; > > } > > > > return true; // fallthrough > > } > > </script> > > </head> > > <body> > > <center> > > <h1>Add Genre</h1> > > <hr> > > <form method="post" action="addgenre.php" onSubmit="return verify()"> > > > > <table> > > > > <tr> > > <td>Name: </td> > > <td><input type="text" name="name" size="20" maxlength="50"></td> > > </tr> > > > > <tr> > > <td><input type="submit" name="submit" value="Add Genre"></td> > > <td><input type="reset"></td> > > </tr> > > > > </table> > > > > </form> > > <?php include "../include/footer.php"; ?> > > </body> > > </html> > > > > <?php } else { > > > > setup_db_connection('w') or die("Could not connect to database!"); > > > > file://Stick it in > > $query = "INSERT INTO genres (name) VALUES ('$name');"; > > mysql_query($query); > > header("Location: genres.php"); > > } > > ?> >

    attached mail follows:


    <A HREF=nextpage.php?x=<?php echo urlencode($x);?>&y=<?php echo urlencode($y);?>>

    --
    WARNING richardzend.com address is an endangered species -- Use
    ceol-i-e.com
    Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
    Volunteer a little time: http://chatmusic.com/volunteer.htm
    ----- Original Message -----
    From: Ardani Sarjito <sarjitoiprimus.com.au>
    Newsgroups: php.general
    To: php_list <php-generallists.php.net>
    Sent: Friday, February 04, 2000 12:00 PM
    Subject: persistence variable value - help
    

    > -- I'm new to PHP -- > > hi! > > I'm trying to make a link which can function like a button (submit) and I > can still move my variable from one page to another without losing my > variable value stored by user on the previous page? > > Thank you! > > ardani >

    attached mail follows:


    Don't set them to empty at the bottom of the file. Do it right after the INSERT to the database, and put the FORM below that.

    An unfair restaurant-recommendation script:

    <?php $message = ''; # Horribly insecure code for illustrative purposes only: if (isset($name) && trim($name) && $name != "McDonalds"){ mysql_query("insert into restaurants(name) values('$name')") or die(mysql_error()); Blank out name for a new entry if they succeeded: if (!mysql_errno()){ $name = ''; } } elseif ($name == "McDonalds"){ $message .= "We don't allow McDonalds to be recommened.<BR>\n"; } else{ $name = ''; } ?> <FORM> <INPUT NAME=name VALUE='<?php echo $name;?>'> </FORM>

    --
    WARNING richardzend.com address is an endangered species -- Use
    ceol-i-e.com
    Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
    Volunteer a little time: http://chatmusic.com/volunteer.htm
    ----- Original Message -----
    From: Gerard Samuel <trini0optonline.net>
    Newsgroups: php.general
    To: PHP <php-generallists.php.net>
    Sent: Saturday, August 04, 2001 12:34 AM
    Subject: How to destroy a $variable
    

    > Ok I have a form with a $PHP_SELF target, and I enter parts of the form > when they enter information if something is wrong with their input. Now > what I would like to do is destroy all the variables when the form is > correct and posted, so that when the page comes back up again, I post a > thank you message, and the form is blank. Just a thought. > I tried setting strings to empty after data is submitted to the database > like so $Age = ""; etc.... at the bottom of the file. > > Bounce some ideas of me. Thanks >

    attached mail follows:


    > struct BACACHE >

    > char author[300][100]; > int top; > time_t uptime; > time_t touchtime; > int busystate; > }; > > is there any way to get these data into PHP with certain variable type ? > > I've tried to use " unpack() " function, but I found that unpack() can't > unpack a char array ( I mean string) , it breaks string into characters.... > please help me...

    Almost for sure you're going to have to read it byte-by-byte and parse it...

    Here's a start: <?php $path = '/path/to/bacache.xxx'; # 'b' is only needed on Windoze, but shouldn't hurt Un*x $file = fopen($path, 'rb') or die("Could not open $path"); while (!feof($path)){ $author = fread($file, 300*100); # You may or may not need to convert each byte somehow... # Is a C int 2 or 4 bytes this week? Sigh. $top = fread($file, 4); # Now, *THAT* almost for sure needs converting... # Maybe you'll be lucky and hexdec will do it... $uptime = fread($file, 4); $touchtime = fread($file, 4); $busystate = fread($file, 4); } ?>

    You'd probably want all sorts of error-checking in there...

    --
    WARNING richardzend.com address is an endangered species -- Use
    ceol-i-e.com
    Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
    Volunteer a little time: http://chatmusic.com/volunteer.htm
    

    attached mail follows:


    > I am having trouble with the following function working _with_ > sessions. If I turn off my session checking function it enables you to > download the file flawlessly, if sessions are turned on then Internet > Explorer displays an error:

    Not sure what is going on, but try viewing the output of your server via a text-based telnet (IE Un*x).

    telnet yourserver.com 80 GET /index.php HTTP/1.0

    Hit return twice after that GET line.

    And be ready for the data to come spewing out. (IE, pipe it to head, or re-direct to a file or...)

    > header("Content-type: application/download");

    Maybe make that application/octet-stream

    --
    WARNING richardzend.com address is an endangered species -- Use
    ceol-i-e.com
    Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
    Volunteer a little time: http://chatmusic.com/volunteer.htm
    

    attached mail follows:


    > session_start(); > while ( list($name,$value) = each($HTTP_POST_VARS)) { > if (is_array($value)) { > for($x=0;$x<count($value);$x++) { > session_register('$name');

    No. This will register a variable whose name is literally '$name' over and over, which (A) is not what you want and (B) $name isn't a valid varible name anyway.

    Lose the ''s

    Also, you only need to session_register $name once, outside the loop, not umpteen times.

    > $$name = $value[$x];

    I think you need $$name[$x] here... You're blowing away all your arrays with scalars, otherwise...

    > } > } else { > session_register('$name');

    Same thing about '$name' here.

    > $$name = $value; > } > }

    > Can anyone help me on this ?

    This sounds like a pretty weird thing to do... Do you *REALLY* have that many POST variables and you want them *ALL* registered?

    > Also what is register_globals ?? Should I have this on or off ?

    If it's off, you are stuck with using $HTTP_POST_VARS and $HTTP_SESSION_VARS and $HTTP_GET_VARS all the time -- $name will not exist unless you explicitly set it.

    The alleged "increase" in security from turning this off is quite debatable since the real issue is about not using variables you haven't initialized (turn on E_ALL) and never trusting user input.

    The speed-up is probably not measurable unless you have an insanely high number of variables you are POST/GET/COOKIE-ing back and forth, which is wrong anyway.

    See PHP-DEV archives for details, since somebody erased my user-contributed notes to the web page. :-^

    --
    WARNING richardzend.com address is an endangered species -- Use
    ceol-i-e.com
    Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
    Volunteer a little time: http://chatmusic.com/volunteer.htm
    

    attached mail follows:


    > We have do the following : > % vadduser > > user Configuration > ------------------ > Username: test > Password: test > Fullname: test > UID: 35647 > Groups: test > Home Dir: /ftp/test > > % dir > drwxrwxr-x c myname vkernel 512 AUG 5 11:27 test > > I want give read,write,exectute access for this directory to the group test > how can i do this? > chmod ....

    I believe you want chown, not chmod, in order to set the file's group to set:

    chown [user]:[group] filename In this case:

    chown :test test

    You can do this for test and *ALL* subdirectories/files using -R

    chown -R :test test

    If you want the *USER* test to own the file as well:

    chown test:test test

    man chown

    maybe be useful.

    --
    WARNING richardzend.com address is an endangered species -- Use
    ceol-i-e.com
    Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
    Volunteer a little time: http://chatmusic.com/volunteer.htm
    

    attached mail follows:


    > Or, you could do two steps > > 1) retrieve the last inserted ID, with mysql_last_inserted_ID (or > something like that). > > 2) then, all records with id(s) greater then the_last_id_number minus > five. > > something like > > $most_recent = select mysql_last_id(); > > select * from TABLE where id > '$most_recent - 5'; > > ...or something to that effect. There's probably a more efficient way to > do it, but this guarantees the most recent five.

    A) This would only work immediately after an INSERT, which may or may not be useful

    B) Technically, this might not be the most recent 5 if *OTHER* inserts have happened in between your call to mysql_insert_id() and the query for the last 5 in a non-transaction situation. If you have transactions going on, this can get a bit confusing, depending on what kind of transactions etc...

    A final note: While I can't imaginge how/why/when it would change, I'm not at all certain that an auto_increment ID field is really the best way to get the most recent inserts from a dba point of view. I generally use a time-stamp for that purpose, to be more explicit that I'm getting records created most recently, rather than the coincidence of having the highest IDs.

    Actually, I guess if the project is small enough or if you're really anticipating millions of records and don't need creation date for other purposes, I'd go with the ID field after all.

    --
    WARNING richardzend.com address is an endangered species -- Use
    ceol-i-e.com
    Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
    Volunteer a little time: http://chatmusic.com/volunteer.htm
    

    attached mail follows:


    Check that you still have register_globals on/off in php.ini as before, and that your GPC ordering is the same.

    --
    WARNING richardzend.com address is an endangered species -- Use
    ceol-i-e.com
    Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
    Volunteer a little time: http://chatmusic.com/volunteer.htm
    ----- Original Message -----
    From: InéRcia Sensorial <inertehotmail.com>
    Newsgroups: php.general
    To: <php-generallists.php.net>
    Sent: Saturday, August 04, 2001 1:01 PM
    Subject: Cookies and servers problems
    

    > Hi All, > > I used to run a customized version of Php-Nuke (www.phpnuke.org) on a > server that had PHP 4.05, Linux and Apache. Used to run fine. > > Now I am trying to run the same, just downloaded and uploaded to the new > server, but it is a Windows, IIS, with PHP 4.0.3pl1. The phpinfo(); of the > new server can be seen here: > > http://www.arubaito.com.br/info.php > > Okay, now with the problem. I customized Nuke to allow users to be > attached to 'companies', and the articles be displayed only for certain > companies. So, only an user from a specific company can have access to the > article. > > But now, it is not working. The sql query is feed by a "WHERE > company='$user_company'" part, where the $user_company comes from another > sql query, based on the login name from a cookie. > > If I change $user_company to 1, it grabs the articles. > > So, the problem is with the cookies. The new server is not sending it > right. I tested on 2 or 3 machines, all with different Operating Systems and > browsers (win98, win2k, IE, Netscape, Opera). > > Anyone have an idea if the new server I am on and its configuration has > some kind of trouble to manage cookies properly? > > Thanks in advance, > > Julio Nobrega. > >

    attached mail follows:


    If I hit reload and re-post the same data, you'll need to detect that somehow...

    Put a unique HIDDEN variable in your FORM, log it to the database when you see it, and if you see it a second time, don't increment $Stage.

    The other possiblity is to use:

    <INPUT TYPE=HIDDEN NAME=Stage VALUE=<?php echo $Stage + 1;?>>

    Any reload will simply pass back the same old Stage the browser got in the first place.

    --
    WARNING richardzend.com address is an endangered species -- Use
    ceol-i-e.com
    Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
    Volunteer a little time: http://chatmusic.com/volunteer.htm
    ----- Original Message -----
    From: Peter Dowie <petesmackedout.com>
    Newsgroups: php.general
    To: <php-generallists.php.net>
    Sent: Saturday, August 04, 2001 4:05 PM
    Subject: Update a SESSION_VAR on form submit
    

    > hello, > > I have a Session variable $Stage which I want to update (increment by 1)when > my form submit button is pressed. > <FORM Method=\"post\" Action=\"$PHP_SELF\"> > how can I update this session variable ? > I dont want to update it at the start of the script, because if the Reload > button is pressed, it will keep updating it and it will mess up the script > Please can someone help me out. > > > Thanks > Pete >

    attached mail follows:


    Since nobody has responded, I'd suggest http://bugs.php.net is your next step.

    --
    WARNING richardzend.com address is an endangered species -- Use
    ceol-i-e.com
    Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
    Volunteer a little time: http://chatmusic.com/volunteer.htm
    ----- Original Message -----
    From: Marcos <dvddshop.com>
    Newsgroups: php.general
    To: <php-generallists.php.net>
    Sent: Thursday, August 02, 2001 5:42 PM
    Subject: PHP & JAVA: Odd Behavior
    

    > Hi, > > I got something very odd while trying to run php with java. First, my > system specs: > > My System: > Windows NT4.0 SP6 (same happens on Windows XP) > Apache 1.3.20 > PHP 4.0.6 > Sun Microsystems JDK 1.3.1 > > Java settings from php.ini: > [Java] > java.class.path="D:\php406\java\php_java.jar;D:\jdk\lib" > java.home=D:\jdk > java.library=D:\jdk\bin\hotspot\jvm.dll > java.library.path=D:\php406\extensions\ > > Program I am running: > <?php > $system = new Java("java.lang.System"); > print "Java version=".$system->getProperty("java.version")." <br>"; > print "Java vendor=" .$system->getProperty("java.vendor")." <br>"; > print "OS=".$system->getProperty("os.name")." ". > $system->getProperty("os.version")." on ". > $system->getProperty("os.arch")." <br>"; > $formatter = new Java("java.text.SimpleDateFormat", > "EEEE, MMMM dd, yyyy 'at' h:mm:ss a zzzz"); > print $formatter->format(new Java("java.util.Date")); > ?> > > When I start the apache server service, the program runs ok (several > reloads on the browser). But, if I close the browser and open it again, > the program no longer runs and give me a "Fatal error: Unable to create > Java Virtual Machine in d:\http\info.php3 on line 9". After several > reloads, sometimes I get it to run again (just one time). > > If I restart the apache server service, the program works again, but > with the same behavior: if I close the browser window and open it again, > > it does not work. > > While all the above is happening, if a go to the command prompt and > type: "d:\php406\php d:\http\myprogram.php3", it works fine, every time. > > I ran out of options and, if anyone could help, I'll appreciate. > > Tks, > Marcos > >

    attached mail follows:


    Use / instead of \, or try \\ or... Also show us the full line for your include_path, not just the value.

    --
    WARNING richardzend.com address is an endangered species -- Use
    ceol-i-e.com
    Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
    Volunteer a little time: http://chatmusic.com/volunteer.htm
    ----- Original Message -----
    From: Mark Lo <mark3dsources.com>
    Newsgroups: php.general
    To: php general <php-generallists.php.net>
    Sent: Saturday, August 04, 2001 10:47 AM
    Subject: include path syntax for php.ini under windows
    

    > Hi, > > I would like to know the correct syntax of include_path for php.ini > under windows. I have tried to set the include path as > "C:\home\main\require" but it doesn't work. > > Thanks in advance > > Mark >

    attached mail follows:


    View your Apache logs after doing these mods, just in case the database has died after your testing that worked:

    It's also good to have these lines stay in there so you can debug later...

    > <?php > mysql_connect("localhost","user","pass");

    ... or error_log(0, "Could not connect to database in " . __FILE__ . ":" . __LINE__);

    > mysql_select_db("db");

    ... or error_log(0, "Could not select db in " . __FILE__ . ":" . __LINE__);

    > $query = "SELECT file_path from photos where photos_id=$photos_id"; > $result = mysql_query($query);

    ... or error_log(0, "Could not exec $query in " . __FILE__ . ":" . __LINE__);

    > $row = mysql_fetch_row($result); > $path = $row[0]; > $file_name = basename($path); > file://print "<img src=\"$path\">"; > file://print "<div align=\"center\">$file_name</div>"; > > header("Content-Type: application/download\n");

    Why are you adding a \n there? That pretty much pukes the rest of the headers, since it's a newline you've forced in, and now the other stuff is part of the data, not the headers...

    Also, use application/octet-stream for download, I think.

    > header("Content-Disposition: attachment; filename=$file_name"); > header("Content-Transfer-Encoding: binary");

    Is this the full path or a relative path? I never trust relative paths when it comes to file-system operations. But I have a low trust-value in computers, software, and life in general. :-)

    > readfile($path); > > ?> > > This should work shouldn't it?

    If you did it right, it would work. :-)

    attached mail follows:


    Hi,

    I would like to know ..is it possible to let my client resize the picture from the browser instead of having a default height and width. If yes, can you give me some idea of how to do it.

    Thanks

    Mark

    attached mail follows:


    try this...

    <? if (!isset($width)) { $width=100; $height=100; } ?> <html> <body> <img src="/path/to/image.ext" width="<?=$width?>" height="<?=$height?>"> <form><p> Image width: <input type="text" name="width" size="4"><br \> Image height: <input type="text" name="height" size="4"><br \> <input type="submit" value="Resize!"> </p></form> </body> </html>

    hope that's what you meant.

    Twigman...

    On Thu, 9 Aug 2001, Mark Lo wrote:

    > Hi, > > I would like to know ..is it possible to let my client resize the > picture from the browser instead of having a default height and width. If > yes, can you give me some idea of how to do it. > > Thanks > > Mark > > >

    -- 
    

    attached mail follows:


    Hi,

    I am running PHP 4.06 on Windows 2000 with IIS 5. I am running PHP in CGI mode.

    I seem to be getting "CGI Error The specified CGI application misbehaved by not returning a complete set of HTTP headers. The headers it did return are: "

    Why is this error happening ? Please dont ask me to shift to DLL mode of running PHP as it gives worse problems like access violations etc.

    It would be really helpful if someone could tell me as to how correct the same.

    Thanks, Karthik.

    attached mail follows:


    On Thursday 09 August 2001 07:47, karthik wrote: > Hi, > > I am running PHP 4.06 on Windows 2000 with IIS 5. I am running PHP in CGI > mode. > > I seem to be getting "CGI Error > The specified CGI application misbehaved by not returning a complete set of > HTTP headers. The headers it did return are: " > > > Why is this error happening ?

    Read, and follow the instructions on this matter as documented towards the end of the install.txt file which came with your distribution.

    Cheers

    -- 
    Phil Driscoll
    

    attached mail follows:


    Hello,

    I have a customer who wants to implement Paypal instant payment notification on his website. Basically, he wants a script that emails a custom message once a customer purchases an item. Instant Payment Notification has the ability to do this.

    However, I have a couple of questions:

    -- Is this really the best method? We're going to implement a shopping cart on the site, too, so Paypal might not be the best solution. -- Does anyone have sample code for Instant Payment Notification?

    If you'd like more information about Instant Payment Notification, you can go here: https://www.paypal.com/cgi-bin/webscr?cmd=p/acc/ipn-info Note that this requires you to login with a Paypal account.

    Here's a brief synopsis taken from the above page:

    How It Works When a customer makes a payment to you, PayPal will post a notification to your server at a URL you specify. Included in this notification will be all of your customer's payment information (e.g. customer name, amount) as well as a piece of encrypted code. When your server receives a notification, it will then post the information, including the encrypted code, back to a secure PayPal URL. PayPal will authenticate the transaction and send confirmation of its validity back to your server.

    After you have activated Instant Payment Notification, your server will be sent a notification every time you receive a payment, this notification will be sent as a hidden "FORM POST" to the URL you specified, and will include all of the payment information. The FORM variables for the notification are listed below:

    To me, this seems kind of like a hack -- i.e. there should be a better way to do this, perhaps as part of a (free or low-cost) shopping cart and payment prcoessing system. Also, there seems to be no way to test this without sending the Paypal user money. (I am going to contact Paypal about that one.)

    Any experiences, good or bad, and advice would be appreciated.

    Thanks!

    Erica

    Remove SPAMFREE- to email me.

    attached mail follows:


    > To me, this seems kind of like a hack -- i.e. there should be a better > way to do this, perhaps as part of a (free or low-cost) shopping cart > and payment prcoessing system. Also, there seems to be no way to test > this without sending the Paypal user money. (I am going to contact > Paypal about that one.)

    Actually it doesn't seem like too much of a hack, except that it seems to be not a realtime operation (otherwise why would they need to contact your script?).

    Good points:

    1. PayPal contacts your script to tell it about the transaction, this script could be anywhere.

    2. Requires verification from PayPal.

    3. Encrypted transaction identifier from PayPal means you don't have to protect your receiving script with SSL.

    Bad point:

    1. Sounds like it's not realtime.

    Jason

    -- 
    Jason Murray
    jasonmmelbourneit.com.au
    Web Developer, Melbourne IT
    "Work now, freak later!"
    

    attached mail follows:


    p.s this script came from:

    // PHP Spider Trapper // Copyright 2000 MassTraffic.com // Unlimted Usage Granted By _Owner_ // You May Use the Program For Free // Under the CAREWARE liceanse. // Which states that you may use // the product for free as long // as you are happy and take care // of each other && This Script!!

    ========================== Karl Phillipson PHP SQL Programmer

    Saffron Hill Ventures 67 Clerkenwell Road London EC1R 5BL

    Saffron Hill: 0207 693 8300 Direct Line: 0207 693 8318

    -----Original Message----- From: Karl Phillipson [mailto:KarlSaffronHill.com] Sent: 08 August 2001 15:30 To: 'Eduardo Kokubo'; php-generallists.php.net Subject: RE: [PHP] code to see files in directories

    Try this

    <?php

    $level1 = 0; $baseurl = "http://$HTTP_HOST"; $base = './'; $basedir = opendir("$base");

    while ($file = readdir($basedir)){ if ($file != '.' && $file != '..' && eregi(".htm","$file")) { print("<a href=$baseurl/$file>$baseurl/$file</a><BR>\n"); flush(); } if ($file != '.' && $file != '..' && is_dir("$base/$file") && $file != "_data") { $level1 = "$base/$file"; print("<a href=$baseurl/$file>$baseurl/$file</a><BR>\n"); flush();

    $seconddir = opendir("$level1"); while ($folder = readdir($seconddir)) { if ($folder != '.' && $folder != '..' && eregi(".htm","$folder")){ print("<a href=$baseurl/$file/$folder>$baseurl/$file/$folder</a><BR>\n"); flush(); } if ($folder != '.' && $folder != '..' && is_dir("$base/$file/$folder") && $folder != "_data") { $level2 = "$level1/$folder"; print("<a href=$baseurl/$file/$folder>$baseurl/$file/$folder</a><BR>\n"); flush(); $thirddir = opendir("$level2"); while ($this = readdir($thirddir)){ if ($this != '.' && $this != '..' && eregi(".htm","$this")) { print("<a href=$baseurl/$file/$folder/$thibaseurl/$file/$folder/$this>$baseurl/$file/$ folder/$this</a><BR>\n"); flush(); } if ($this != '.' && $this != '..' && is_dir("$base/$file/$folder/$this") && $this != "_data") { $level3 = "$level2/$this"; print("<a href=$baseurl/$file/$folder/$this>$baseurl/$file/$folder/$this</a><BR>\n"); flush(); $forthdir = opendir("$level3"); while ($that = readdir($forthdir)) { if ($that != '.' && $that != '..' && eregi(".htm","$that")) { print("<a href=$baseurl/$file/$folder/$this/$that>$baseurl/$file/$folder/$this/$that</ a><BR>\n"); flush(); } if ($that != '.' && $that != '..' && is_dir("$base/$file/$folder/$this/$that") && $that != "_data") { $level4 = "$level3/$that"; print("<a href=$baseurl/$file/$folder/$this/$that>$baseurl/$file/$folder/$this/$that</ a><BR>\n"); flush();

    $fithdir = opendir("$level4"); while ($some = readdir($fithdir)){ if ($some != '.' && $some != '..' && eregi(".htm","$some")) { print("<a href=$baseurl/$file/$folder/$this/$that/$some>$baseurl/$file/$folder/$this/$ that/$some</a><BR>\n"); flush(); } if ($some != '.' && $some != '..' && is_dir("$base/$file/$folder/$this/$that/$some") && $some != "_data") { $level5 = "$level4/$some"; print("<a href=$baseurl/$file/$folder/$this/$that/$some>$baseurl/$file/$folder/$this/$ that/$some</a><BR>\n"); flush();

    $sixthdir = opendir("$level5"); while ($the = readdir($sixthdir)) { if ($the != '.' && $the != '..' && eregi(".htm","$the")){ print("<a href=$baseurl/$file/$folder/$this/$that/$some/$this/$that/$some/$the>$baseur l/$file/$folder/$this/$that/$some/$the</a><BR>\n"); flush(); } if ($the != '.' && $the != '..' && is_dir("$base/$file/$folder/$this/$that/$some/$the") && $the != "_data") {

    $level6 = "$level5/$the"; print("<a href=$baseurl/$file/$folder/$this/$that/$some/$the>$baseurl/$file/$folder/$t his/$that/$some/$the</a><BR>\n"); flush();

    $seventhdir = opendir("$level6"); while ($it = readdir($seventhdir)) { if ($it != '.' && $it != '..' && eregi(".htm","$it")){ print("<a href=$baseurl/$file/$folder/$this/$that/$some/$the/$it>$baseurl/$file/$folde r/$this/$that/$some/$the/$it</a><BR>\n"); flush(); } if ($it != '.' && $it != '..' && is_dir("$base/$file/$folder/$this/$that/$some/$the/$it") && $it != "_data") {

    $level7 = "$level6/$it"; print("<a href=$baseurl/$file/$folder/$this/$that/$some/$the/$it>$baseurl/$file/$folde r/$this/$that/$some/$the/$it</a><BR>\n"); flush();

    $eighthdir = opendir("$level7"); while ($deep = readdir($eighthdir)){ if ($deep1 != '.' && $deep1 != '..' && eregi(".htm","$deep1")){ print("<a href=$baseurl/$file/$folder/$this/$that/$some/$the/$it/$deep1>$baseurl/$file /$folder/$this/$that/$some/$the/$it/$deep1</a><BR>\n"); flush(); } if ($deep1 != '.' && $deep1 != '..' && is_dir("$base/$file/$folder/$this/$that/$some/$the/$it/$deep1") && $deep1 != "_data") { $level8 = "$level7/$deep1"; print("<a href=$baseurl/$file/$folder/$this/$that/$some/$the/$it/$deep1>$baseurl/$file /$folder/$this/$that/$some/$the/$it/$some/$the/$it/$deep1</a><BR>\n"); flush(); }} }} }} }} }} }} }} }} ?>

    ========================== Karl Phillipson PHP SQL Programmer

    Saffron Hill Ventures 67 Clerkenwell Road London EC1R 5BL

    Saffron Hill: 0207 693 8300 Direct Line: 0207 693 8318

    -----Original Message----- From: Eduardo Kokubo [mailto:kokuboinf.univali.br] Sent: 08 August 2001 13:52 To: php-generallists.php.net Cc: Eduardo Kokubo Subject: [PHP] code to see files in directories

    I think I saw a code to list the files, subdirectories and the files in the subdirectories of a simple directory in this list some time ago, but I didn't save it. Considering the quantitie of messages in this list, It's quite dificult to find this specific code, so ask the person who did it or someone else to write this code again.

    I'm using this one:

    $publico = ftp_nlist ($servidor, "public_html/publico"); $cont = 0; while ($publico[$cont]){ print "$publico[$cont]<br>"; $cont++;}

    This code doesn't show the files in the subdirectories and it requires ftp connection. Not very efficient.

    Thanks in advance.

    Is there a problem if I just write "thanks in advance"??? It's easier then writting back to thanks everybody :)

    attached mail follows:


    Hi Guys,

    When naming classes and function's within the class(and even functions(probably more so?)) do you use a common string infront of everything? For example HM_function_name()

    The reason I am asking is because what if you want to easily intergrate a class/function with lots of other classes/function and then you find out there is two with the same name?

    Any thoughts on this would be good!

    attached mail follows:


    On Wed, Aug 08, 2001 at 09:14:56AM -0700, Bjorn Van Simaeys wrote: > Hey Renze, > > > Don't you think that checking too much is useless and > takes a bite out of your performance too? Don't waste > your time. > > > Greetz, > Bjorn Van Simaeys > www.bvsenterprises.com

    That's right... Checking _too_much_ is useless. But you let me how you check too much? Checking whether or not a variable is set doesn't take any performance. Getting errors and warnings... that sucks. Some guy worked at this company who -we found out- hardly ever checked the results of his db-calls... just because that wouldn't look nice in his code. I mean... what kind of a person are you then. You won't believe how many errors and warnings his code produces. If you use functions calls and don't check the returnvalue(s) your just asking for trouble. And come on... tell me how much performance it takes to see whether or not the returnvalue is true or false after a db-function that takes up about 5 or 6 seconds. Then you're gonna complain about the performance you lose by checking if that db-function succeeded? Tell me... you have any warnings and/or errors logged to your logfiles? Or do you have the errorreportinglevel set to absolute nothing? You ever check if anything goes wrong? How the h*ll can you guarantee functionality of your site?

    -- 
    

    * R&zE:

    -- »»»»»»»»»»»»»»»»»»»»»»»» -- Renze Munnik -- DataLink BV -- -- E: renzedatalink.nl -- W: +31 23 5326162 -- F: +31 23 5322144 -- M: +31 6 21811143 -- H: +31 23 5516190 -- -- Stationsplein 82 -- 2011 LM HAARLEM -- -- http://www.datalink.nl -- ««««««««««««««««««««««««