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: Sat Feb 24 2001 - 10:44:33 CST

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

    php-general Digest 24 Feb 2001 16:44:33 -0000 Issue 531

    Topics (messages 41431 through 41496):

    Re: Download PHP from Linux machine?
            41431 by: Simons
            41437 by: ..s.c.o.t.t..

    Re: Using while as for...
            41432 by: ..s.c.o.t.t..
            41436 by: Andrew Hill
            41438 by: Andrew Hill
            41462 by: PHPBeginner.com

    Re: special characters with perl,mysql,php
            41433 by: ..s.c.o.t.t..
            41464 by: Mitchell Hagerty
            41483 by: Christian Reiniger

    Re: Help INSERTing to MySQL
            41434 by: ..s.c.o.t.t..
            41435 by: ..s.c.o.t.t..

    Can't connect php to mysql on linux
            41439 by: George Alexander
            41492 by: php3.developersdesk.com

    Re: Location
            41440 by: Steve Werby
            41452 by: PHPBeginner.com

    Re: isset()
            41441 by: PHPBeginner.com
            41465 by: Joe Stump
            41466 by: PHPBeginner.com
            41467 by: Joe Stump
            41469 by: PHPBeginner.com
            41472 by: PHPBeginner.com
            41487 by: Joe Stump
            41490 by: PHPBeginner.com

    Re: International support
            41442 by: PHPBeginner.com

    Re: variable sent using pots is cat!
            41443 by: PHPBeginner.com

    Re: How do I request a new feature?
            41444 by: PHPBeginner.com

    Re: Sessions and naming a file with SID
            41445 by: PHPBeginner.com

    Re: Templates & PHP
            41446 by: PHPBeginner.com

    Re: Passing values containing a ? and a &
            41447 by: PHPBeginner.com

    Re: books
            41448 by: PHPBeginner.com

    Re: concatenate vars?
            41449 by: PHPBeginner.com

    Re: Problems sending mail to aol with the mail() function
            41450 by: PHPBeginner.com

    Re: Counter Help
            41451 by: PHPBeginner.com
            41454 by: PHPBeginner.com
            41468 by: Navid Yar
            41470 by: PHPBeginner.com

    Re: <select name=....
            41453 by: PHPBeginner.com

    Re: mail prob
            41455 by: PHPBeginner.com

    Re: php_self
            41456 by: PHPBeginner.com

    Re: PHP / Filemaker?
            41457 by: PHPBeginner.com

    Re: Parsing a string
            41458 by: PHPBeginner.com

    Re: Problem with $REMOTE_ADDR
            41459 by: PHPBeginner.com

    Re: string question
            41460 by: PHPBeginner.com

    Re: URGENT: IE pops-up an Error and File Download Fails. Needs to be fixed NOW. Please advise.
            41461 by: PHPBeginner.com

    Re: encrypt and decrypt in standard PHP
            41463 by: Mukul Sabharwal

    Upload --Permission denied simple error...
            41471 by: Dhaval Desai

    Re: How to pipe a command output into another command
            41473 by: Martin Kong

    Change dir mode to writable for uploading..
            41474 by: Dhaval Desai
            41475 by: PHPBeginner.com
            41479 by: Web Admin

    $result = $$function
            41476 by: Peter Van Dijck
            41481 by: Web Admin

    splitting email on MIME format
            41477 by: n e t b r a i n

    redirect to another page not using headers
            41478 by: kaab kaoutar
            41484 by: Joe Njeru

    checking $more still does not work !
            41480 by: kaab kaoutar
            41482 by: Web Admin

    status page between submit and results
            41485 by: Mitchell Hagerty
            41486 by: Web Admin

    getting result set of a stored procedure
            41488 by: Kevin Beckford

    Class methods in PHP
            41489 by: Kevin Beckford

    session_register in function
            41491 by: Jon Rosenberg

    session_register in function - addendum
            41493 by: Jon Rosenberg

    DIsplaying page before script finnished
            41494 by: David Tandberg-Johansen
            41495 by: Kyndig
            41496 by: Kevin Beckford

    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:


    try to "double quotes" the url

    ""Jorge Alvarez"" <alvarezjehotmail.com> ¼¶¼g©ó¶l¥ó
    news:976k7t$2t2$1toye.p.sourceforge.net...
    > Hi there,
    >
    > I want to download PHP from my Linux server, but I can't just type "lynx
    >
    http://www.php.net/do_download.php?download_file=php-4.0.4pl1.tar.gz&source_
    > site=www.php.net"
    >
    > This is the link in the PHP downloads page, but the shell gets confused by
    > the & character.
    >
    > What should I do?
    >
    > Best Regards,
    >
    > Jorge.
    >
    >
    >
    > --
    > 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:


    well, you could load lynx, then type "G" (go) and
    type in "www.php.net" on the address bar, then
    navigate your way to the download page from there.
    (it's only one page deep into the site)

    that's how i did it at work on our linux machine.

    > -----Original Message-----
    > From: Simons [mailto:simonshongkong.com]
    > Sent: Friday, February 23, 2001 21:00
    > To: php-generallists.php.net
    > Subject: Re: [PHP] Download PHP from Linux machine?
    >
    >
    > try to "double quotes" the url
    >
    >
    > ""Jorge Alvarez"" <alvarezjehotmail.com> ¼¶¼g©ó¶l¥ó
    > news:976k7t$2t2$1toye.p.sourceforge.net...
    > > Hi there,
    > >
    > > I want to download PHP from my Linux server, but I can't just type "lynx
    > >
    > http://www.php.net/do_download.php?download_file=php-4.0.4pl1.tar.gz&source_
    > > site=www.php.net"
    > >
    > > This is the link in the PHP downloads page, but the shell gets confused by
    > > the & character.
    > >
    > > What should I do?
    > >
    > > Best Regards,
    > >
    > > Jorge.
    > >
    > >
    > >
    > > --
    > > 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:


    this is how you'd do it, in any of three ways,
    depending on the values you want to start/stop with.

    //counts from 0 to 10
    $count=0;
    while ($count <= 10) {
            echo "$count, ";
            $count++;
    }
    print "<BR>";

    //counts from 1 to 10
    $count=0;
    while (++$count <= 10) {
            echo "$count, ";
    }
    print "<BR>";

    //counts from 1 to 11
    $count=0;
    while ($count++ <= 10) {
            echo "$count, ";
    }

    > -----Original Message-----
    > From: Felipe Lopes [mailto:php4mailbr.com.br]
    > Sent: Wednesday, January 24, 2001 02:46
    > To: php-generallists.php.net
    > Subject: [PHP] Using while as for...
    >
    >
    > I was trying to code the following script using while instead of for,
    > but I'm havig a lot of problems...Is it possible to do what I want?
    >
    > for ($count = 0; $count <= 10; $count++){
    > echo "Number is $count <BR>\n";
    > }
    >
    > Could anyone tell me how is it with while instead of for??
    > Thank you!!
    >
    > Felipe Lopes
    > MailBR - O e-mail do Brasil -- http://www.mailbr.com.br
    > Faça já o seu. É gratuito!!!
    >
    > --
    > 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:


    $count = 1;

    while($count < 10)
        {
         echo "Number is $count <BR>\n";
         $count++
        }

    > for ($count = 0; $count <= 10; $count++){
    > echo "Number is $count <BR>\n";
    > }
    >
    > Could anyone tell me how is it with while instead of for??
    > Thank you!!

    Best regards,
    Andrew
    ---------------------------------------
    Andrew Hill - OpenLink Software
    Director Technology Evangelism
    eBusiness Infrastructure Technology
    http://www.openlinksw.com

    attached mail follows:


    Whups, forgot a blasted semicolon...

    $count = 1;

    while($count < 10)
        {
         echo "Number is $count <BR>\n";
         $count++;
        }

    Cheers,
    Andrew

    On 2/24/01 12:20 AM, "Andrew Hill" <ahillopenlinksw.com> wrote:

    > $count = 1;
    >
    > while($count < 10)
    > {
    > echo "Number is $count <BR>\n";
    > $count++
    > }

    attached mail follows:


    you can do

    while($count<=10)
    {
       echo "Number is $count <BR>\n";
       $count++;
    }

    Sincerely,

     Maxim Maletsky
     Founder, Chief Developer

     PHPBeginner.com (Where PHP Begins)
     maximphpbeginner.com
     www.phpbeginner.com

    -----Original Message-----
    From: Felipe Lopes [mailto:php4mailbr.com.br]
    Sent: Wednesday, January 24, 2001 2:46 AM
    To: php-generallists.php.net
    Subject: [PHP] Using while as for...

    I was trying to code the following script using while instead of for,
    but I'm havig a lot of problems...Is it possible to do what I want? for
    ($count = 0; $count <= 10; $count++){ echo "Number is $count <BR>\n"; }
    Could anyone tell me how is it with while instead of for?? Thank you!!
    Felipe Lopes
    MailBR - O e-mail do Brasil -- http://www.mailbr.com.br
    Faça já o seu. É gratuito!!!

    --
    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 use a regexp to slash-out single quotes for inclusion into an SQL query:

    // quote a value to make it appropriate for inclusion in an SQL string function db_quote($value) { return ereg_replace("'","\\'",$value); }

    > -----Original Message----- > From: Mitchell Hagerty [mailto:mitchell_hagertyund.nodak.edu] > Sent: Friday, February 23, 2001 18:54 > To: php-generallists.php.net > Subject: [PHP] special characters with perl,mysql,php > > > Hey All, > > What would be a good method for inserting data into a blob field > that contained special characters using perl then retrieving that > data with php? > > URI::Escape has worked well with perl but now that php has > gotten into the picture I need a new method. > > any suggestions? > > tks > mitch > > > > -- > 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:


    The special character I'm concerned with at the moment is the back tick ` which mysql doesn't like on an insert. I was looking for a way not to parse the entire file evertime I inserted or extracted them from the database. Its simple enough todo in perl and php just seems like it would burn alot of cpu time.

    I was actually hoping mysql would have a way to encode it on the way in and decode on the way out. That way php or perl would be irrelevant. Guess not :\

    tks for your help mitch

    > i use a regexp to slash-out single quotes for > inclusion into an SQL query: > > // quote a value to make it appropriate for inclusion in an SQL string > function db_quote($value) { > return ereg_replace("'","\\'",$value); > } > > > > > -----Original Message----- > > From: Mitchell Hagerty [mailto:mitchell_hagertyund.nodak.edu] > > Sent: Friday, February 23, 2001 18:54 > > To: php-generallists.php.net > > Subject: [PHP] special characters with perl,mysql,php > > > > > > Hey All, > > > > What would be a good method for inserting data into a blob field > > that contained special characters using perl then retrieving that > > data with php? > > > > URI::Escape has worked well with perl but now that php has > > gotten into the picture I need a new method. > > > > any suggestions? > > > > tks > > mitch > > > > > > > > -- > > 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:


    On Saturday 24 February 2001 07:49, Mitchell Hagerty wrote: > The special character I'm concerned with at the moment is the back tick > ` which mysql doesn't like on an insert. I was looking for a way not to > parse the entire file evertime I inserted or extracted them from the > database. Its simple enough todo in perl and php just seems like it > would burn alot of cpu time. > > I was actually hoping mysql would have a way to encode it on the way in > and decode on the way out. That way php or perl would be irrelevant. > Guess not :\

    Well, as someone else already said, addslashes () is the tool of choice for the way in, and for he way out you don't need to do anything.

    -- 
    Christian Reiniger
    LGDC Webmaster (http://sunsite.dk/lgdc/)
    

    "The number of Unix installations has grown to 10, with more expected." -- The Unix Programmer's Manual, 2nd Edition, June 1972

    attached mail follows:


    0 also works for AUTO_INCREMENT fields...

    > -----Original Message----- > From: Philip Olson [mailto:philipcornado.com] > Sent: Friday, February 23, 2001 18:41 > To: Clayton Dukes > Cc: php-generallists.php.net > Subject: Re: [PHP] Help INSERTing to MySQL > > > > > If I knew I could get answers that easy here, I woudn't have worked on this > > for 20 hours :-) > > > > THANKS!!!! > > > > btw, field one is an ID field set to auto increment, how can I insert that > > if I don't know what it is? > > In this case use NULL as the value for id and it'll auto increment nicely. > Using a blank '' will work too. Regarding use of NULL, it's NULL and > not 'NULL'. > > Regards, > > Philip > > > -- > 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:


    you dont need to have a list of field names if you insert the exact amount of fields that exist in the table...

    if you have fields Name and Email, you can do: INSERT INTO mytable VALUES ('myname','myemail.com') without a problem. however, if you have fields Name, Email and Password the previous code will break, since MySQL would complain that you're inserting too few (or too many) pieces of data into the table, and it cant decide which data goes where

    > -----Original Message----- > From: Joe Stump [mailto:jstumpzebulon.miester.org] > Sent: Friday, February 23, 2001 17:21 > To: Clayton Dukes > Cc: php-generallists.php.net > Subject: Re: [PHP] Help INSERTing to MySQL > > > Before your VALUES you need to have a list of the fields ie: > > insert into table (id,fname,lname) values ('$id','$fname','$lname') > > --joe > > On Fri, Feb 23, 2001 at 08:00:30PM -0500, Clayton Dukes wrote: > > Hello, > > This is my first attempt, so I'm prolly doing something stupid, but can > someone tell me why this doesn't work? > > All it returns is "Unable to INSERT to database" > > > > > > > > ---BEGIN--- > > <? > > $time = time(); > > $rand = Random_Password(5); > > $docid = $time . $rand; > > > > if (isset($email) && isset($docid)) { > > mysql_connect("$HOSTNAME", "$DB_USER", "$DB_PASS"); > > > > $query = "INSERT INTO documents VALUES ('$docid', '$category', > '$subcategory', '$date', '$subject', '$title', '$author', '$email', > '$language', '$gr > > ade', '$level', '$city', '$state', '$county', '$zip', > '$authors_comments', '$teachers_comments', 'N', '$docdata')"; > > > > $result = mysql_db_query("$DATABASE", $query) or die("Unable to > INSERT to database"); > > > > if ($result) { > > echo "<p>$docid was added to the database</p>"; > > } > > } > > ?> > > > > <h1>Submit a new document to the database</h1> > > <form> > > Email Address: <input type=text name=email><br> > > Category: <select name=category><? print "$CATEGORIES" ?></select><br> > > Sub Category: <select name=subcategory><? print > "$SUBCATEGORIES" ?></select><br> > > Date Document was written: <input type=text name=date> (xx-xx-xxxx)<br> > > Document Subject: <input type=text name=subject><br> > > Document Title: <input type=text name=title><br> > > Document Author: <input type=text name=author><br> > > Document Language: <input type=text name=language value=English><br> > > Grade Received (Percentage): <input type=text name=grade > size=3> (xx/100)<br> > > Grade Level of Paper: <select name=level><option>High > School</option><option>College</option><option>Other</option></select><br> > > City in which paper was submitted: <input type=text name=city > value=Jacksonville><br> > > State in which paper was submitted: <input type=text name=state > value=FL><br> > > County in which paper was submitted: <input type=text > name=county value=Duval> <b>(County, not Country!)</b><br> > > School at which paper was submitted: <input type=text > name=school value="Mandarin High School"><br> > > ZIP code: <input type=text name=zip size=5 value=32257> <b>(Put > your ZIP code in if you don't know your school's)</b><br> > > Author's Comments: <input type=text name=authors_comments><br> > > Teacher's Comments: <input type=text name=teachers_comments><br> > > Document (ASCII TEXT ONLY):<br> > > <textarea name=docdata cols=80 rows=30>Paste document text > here</textarea> > > <p><input type=submit value="Submit for verification"> > > </form> > > > > -----END----- > > > > > > > > TIA! > > Clayton > > > > > -- > > 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 > > -- > > ------------------------------------------------------------------------------- > Joe Stump, PHP Hacker, joestump98yahoo.com -o) > http://www.miester.org http://www.care2.com /\\ > "It's not enough to succeed. Everyone else must fail" -- Larry Ellison _\_V > ------------------------------------------------------------------------------- > > > -- > 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:


    Hi,

    I working on Redhat Linux 6.1 and I've installed MySQL-3.23.33-1.i386.rpm and MySQL-client-3.23.33-1.i386.rpm. MySql is working fine. I've even created a database also using MySqlAdmin. Regarding Php I've installed php-3.0.18-1.6.x.i386.rpm and as for Apache : apache-1.3.14-2.6.2.i386.rpm. I've even installed php-mysql-3.0.16-1.i386.rpm and mod-php3-3.0.12-2.i386.rpm.

    My problem is I can't connect PHP to Mysql Db using the mysyql_connect("localhost","root","mypassword") command.

    Please help me asap. Regards, George

    _____________________________________________________ Chat with your friends as soon as they come online. Get Rediff Bol at http://bol.rediff.com

    attached mail follows:


    Addressed to: "George Alexander" <george_axrediffmail.com> php-generallists.php.net

    ** Reply to note from "George Alexander" <george_axrediffmail.com> 24 Feb 2001 05:40:59 -0000 > > Hi, > > I working on Redhat Linux 6.1 and I've installed > MySQL-3.23.33-1.i386.rpm and MySQL-client-3.23.33-1.i386.rpm. > MySql is working fine. I've even created a database also using > MySqlAdmin. > Regarding Php I've installed php-3.0.18-1.6.x.i386.rpm and as for > Apache : apache-1.3.14-2.6.2.i386.rpm. > I've even installed php-mysql-3.0.16-1.i386.rpm and > mod-php3-3.0.12-2.i386.rpm. > > My problem is I can't connect PHP to Mysql Db using the > mysyql_connect("localhost","root","mypassword") command.

    mypassword is the same password you used for mysqladmin, and the command line interpreter for the root user, right?

    Try this command and see what it returns. If the error message doesn't give you a good idea what is wrong, please post again, including the error message you receive.

    mysql_connect( "localhost", "root", "mypassword" ) or die( "Unable to connect<BR>" . mysql_error());

    I suggest you always use this code, along with:

    mysql_select_db( "database" ) or die( "Unable to select<BR>" . mysql_error());

    in every program you write. It is almost impossible to troubleshoot problems if you don't know what went wrong.

    Rick Widmer Internet Marketing Specialists http://www.developersdesk.com

    attached mail follows:


    "Brandon Feldhahn" <BrandonFeldhahnearthlink.net> wrote: > Im making a website and i want the viewer to know were he of she is, > what do i need to do to make a location bar (home > serverices ect...) > with the $PHP_SELF command, i wasent able to figure it out so i am > asking assistance from another person.

    A simple solution for a site with a small number of pages would be to create an array like the following:

    $location['/index.php'] = "Home"; $location['/services.php'] = "Services"; $location['/products.php'] = "Products";

    Then use $SCRIPT_URL or a similar environment variable to display the proper label in the "location bar".

    <?php echo $location[$SCRIPT_URL]; ?>

    If you have a large number of pages (especially dynamically generated "virtual" pages) or sublevels to your site you'll probably want to use a more advanced solution.

    --
    Steve Werby
    COO
    24-7 Computer Services, LLC
    Tel: 804.817.2470
    http://www.247computing.com/
    

    attached mail follows:


    You need to have an array or db with file and description

    in ca you use array :

    $location = Array( '/index.php' => 'HOME', '/prod_info.php' => 'Product Information', ..etc,,,,

    );

    and then

    if(isset($location[$PHP_SELF])) echo $location[$PHP_SELF];

    and so on ...

    note: this is just a quick and dirty idea on how to do that, with a little bit of logic you can write a very sweet function with does what you need.

    Sincerely,

    Maxim Maletsky Founder, Chief Developer

    PHPBeginner.com (Where PHP Begins) maximphpbeginner.com www.phpbeginner.com

    -----Original Message----- From: Brandon Feldhahn [mailto:BrandonFeldhahnearthlink.net] Sent: Friday, February 23, 2001 10:27 AM To: php-generallists.php.net Subject: [PHP] Location

    Im making a website and i want the viewer to know were he of she is, what do i need to do to make a location bar (home > serverices ect...) with the $PHP_SELF command, i wasent able to figure it out so i am asking assistance from another person.

    --
    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 agree with you in here,

    you usually know what kind of variable you're checking, so strlen() will work just as well as

    $var ? 'OK' : 'Empty'

    will work or the isset() - common, it was made for checking the variables - use it.

    strlen() is in fact an overhead, why would you allow your design to be some sort of untraditional? I don't think there's any necessity for it

    a "good design" often would be something like this:

    $var = 'whatever';

    if($var) ...do this else ERROR('no var') // some your func to output the error mess or to continue with debugging

    in most cases it will work better and simpler for you without spending these bazillions of important for every developer seconds.

    Sincerely,

    Maxim Maletsky Founder, Chief Developer

    PHPBeginner.com (Where PHP Begins) maximphpbeginner.com www.phpbeginner.com

    -----Original Message----- From: Joe Stump [mailto:jstumpzebulon.miester.org] Sent: Friday, February 23, 2001 3:07 AM To: Steve Edberg Cc: Jackylilst; php-generallists.php.net Subject: Re: [PHP] isset()

    I stand firm on strlen() for the following reasons ...

    if(!$var) will sometimes act strangely (has for me in the past) when variables are set to something other than what you are expecting.

    if(isset($var)) will return true if your text field is declared but not filled in.

    if(empty($var)) will return true if $var is set to 0 (for obvious reason) so is only good for certain instances.

    strlen() on the other hand converts the variable to a string and returns a count of characters. It's never failed or acted funky. For this reason I use it religiously.

    Others might say "well it's extra overhead" to which I reply "I'll take an extra bazillionth of a second to know for sure I have what I need"

    --Joe

    On Thu, Feb 22, 2001 at 08:18:22AM -0800, Steve Edberg wrote: > I would do this: > > if (!$AgeChild) $AgeChild = 'NA'; > > More compact, easier to read (to me, anyway). This presumes that a > value of '' (empty string, interpreted by PHP as false) is NOT a > valid value here. > > As far as your sniplet goes, it is possible that there may be some > PHP type-casting issues here, depending on: whether $AgeChild is > numeric or string; the fact that the STRING "false" isn't equivalent > to the CONSTANT false, the use of == vs. ===. > > Time to check out the docs - specifically the types and variables > sections (also the functions->variables section)... > > - steve > > > > At 5:07 PM -0600 2/22/01, Jackylilst wrote: > >People > >I tried to check if teh field has set a vaule in it before submit > >using isset with the sniplet below > > > >if ((isset($AgeChild))=="false") { > >$AgeChild = "NA"; > >} > > > >The resule is that it always displays NA whether or not it has vaule > >in the field, what is the correct way of using isset for this > >purpose? Or should I use empty() ? > >Jack > >jackyactivelifestyle.com > >"There is nothing more rewarding than reaching the goal you set for yourself" > > > -- > +--- "They've got a cherry pie there, that'll kill ya" ------------------+ > | Steve Edberg University of California, Davis | > | sbedbergucdavis.edu Computer Consultant | > | http://aesric.ucdavis.edu/ http://pgfsun.ucdavis.edu/ | > +-------------------------------------- FBI Special Agent Dale Cooper ---+ > > -- > 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

    --
    

    ---------------------------------------------------------------------------- --- Joe Stump, PHP Hacker, -o) http://www.miester.org http://www.care2.com /\\ "It's not enough to succeed. Everyone else must fail" -- Larry Ellison _\_V ---------------------------------------------------------------------------- ---

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


    You are COMPLETELY wrong here. isset() is designed to check if a variable is SET - NOT if it has something in it. empty() is designed for strings NOT for ints - so if it's set to 0 it will fail. Finally in PHP 4 + you have problems when you do checks and variables aren't set.

    I do this, like I said before, because the extra 1 billionth of a second is worth the overhead. I've programmed for sites ranging from a few hundered hits a day to a few million hits a day and this works ALL the time.

    --Joe

    On Sat, Feb 24, 2001 at 03:15:59PM +0900, PHPBeginner.com wrote: > I don't agree with you in here, > > you usually know what kind of variable you're checking, so strlen() will > work just as well as > > $var ? 'OK' : 'Empty' > > will work or the isset() - common, it was made for checking the variables - > use it. > > strlen() is in fact an overhead, why would you allow your design to be some > sort of untraditional? I don't think there's any necessity for it > > a "good design" often would be something like this: > > $var = 'whatever'; > > if($var) > ...do this > else > ERROR('no var') // some your func to output the error mess or to continue > with debugging > > in most cases it will work better and simpler for you without spending these > bazillions of important for every developer seconds. > > > > Sincerely, > > Maxim Maletsky > Founder, Chief Developer > > PHPBeginner.com (Where PHP Begins) > maximphpbeginner.com > www.phpbeginner.com > > > > > > -----Original Message----- > From: Joe Stump [mailto:jstumpzebulon.miester.org] > Sent: Friday, February 23, 2001 3:07 AM > To: Steve Edberg > Cc: Jackylilst; php-generallists.php.net > Subject: Re: [PHP] isset() > > > I stand firm on strlen() for the following reasons ... > > if(!$var) will sometimes act strangely (has for me in the past) when > variables > are set to something other than what you are expecting. > > if(isset($var)) will return true if your text field is declared but not > filled > in. > > if(empty($var)) will return true if $var is set to 0 (for obvious reason) so > is > only good for certain instances. > > strlen() on the other hand converts the variable to a string and returns a > count > of characters. It's never failed or acted funky. For this reason I use it > religiously. > > Others might say "well it's extra overhead" to which I reply "I'll take an > extra > bazillionth of a second to know for sure I have what I need" > > --Joe > > On Thu, Feb 22, 2001 at 08:18:22AM -0800, Steve Edberg wrote: > > I would do this: > > > > if (!$AgeChild) $AgeChild = 'NA'; > > > > More compact, easier to read (to me, anyway). This presumes that a > > value of '' (empty string, interpreted by PHP as false) is NOT a > > valid value here. > > > > As far as your sniplet goes, it is possible that there may be some > > PHP type-casting issues here, depending on: whether $AgeChild is > > numeric or string; the fact that the STRING "false" isn't equivalent > > to the CONSTANT false, the use of == vs. ===. > > > > Time to check out the docs - specifically the types and variables > > sections (also the functions->variables section)... > > > > - steve > > > > > > > > At 5:07 PM -0600 2/22/01, Jackylilst wrote: > > >People > > >I tried to check if teh field has set a vaule in it before submit > > >using isset with the sniplet below > > > > > >if ((isset($AgeChild))=="false") { > > >$AgeChild = "NA"; > > >} > > > > > >The resule is that it always displays NA whether or not it has vaule > > >in the field, what is the correct way of using isset for this > > >purpose? Or should I use empty() ? > > >Jack > > >jackyactivelifestyle.com > > >"There is nothing more rewarding than reaching the goal you set for > yourself" > > > > > > -- > > +--- "They've got a cherry pie there, that'll kill ya" ------------------+ > > | Steve Edberg University of California, Davis | > > | sbedbergucdavis.edu Computer Consultant | > > | http://aesric.ucdavis.edu/ http://pgfsun.ucdavis.edu/ | > > +-------------------------------------- FBI Special Agent Dale Cooper ---+ > > > > -- > > 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 > > -- > > ---------------------------------------------------------------------------- > --- > Joe Stump, PHP Hacker, > -o) > http://www.miester.org http://www.care2.com > /\\ > "It's not enough to succeed. Everyone else must fail" -- Larry Ellison > _\_V > ---------------------------------------------------------------------------- > --- > > > -- > 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 > >

    -- 
    

    ------------------------------------------------------------------------------- Joe Stump, PHP Hacker, joestump98yahoo.com -o) http://www.miester.org http://www.care2.com /\\ "It's not enough to succeed. Everyone else must fail" -- Larry Ellison _\_V -------------------------------------------------------------------------------

    attached mail follows:


    have I said it won't work, Joe?

    I said that using strlen() might not be necessary. (re-read my post) On my own opinion the same things could be done without using the string functions. Am I wrong in something there? then thanks for correcting me - will know it for the feature.

    Sincerely,

    Maxim Maletsky Founder, Chief Developer

    PHPBeginner.com (Where PHP Begins) maximphpbeginner.com www.phpbeginner.com

    -----Original Message----- From: Joe Stump [mailto:jstumpzebulon.miester.org] Sent: Saturday, February 24, 2001 4:17 PM To: PHPBeginner.com Cc: php-generallists.php.net Subject: Re: [PHP] isset()

    You are COMPLETELY wrong here. isset() is designed to check if a variable is SET - NOT if it has something in it. empty() is designed for strings NOT for ints - so if it's set to 0 it will fail. Finally in PHP 4 + you have problems when you do checks and variables aren't set.

    I do this, like I said before, because the extra 1 billionth of a second is worth the overhead. I've programmed for sites ranging from a few hundered hits a day to a few million hits a day and this works ALL the time.

    --Joe

    On Sat, Feb 24, 2001 at 03:15:59PM +0900, PHPBeginner.com wrote: > I don't agree with you in here, > > you usually know what kind of variable you're checking, so strlen() will > work just as well as > > $var ? 'OK' : 'Empty' > > will work or the isset() - common, it was made for checking the variables - > use it. > > strlen() is in fact an overhead, why would you allow your design to be some > sort of untraditional? I don't think there's any necessity for it > > a "good design" often would be something like this: > > $var = 'whatever'; > > if($var) > ...do this > else > ERROR('no var') // some your func to output the error mess or to continue > with debugging > > in most cases it will work better and simpler for you without spending these > bazillions of important for every developer seconds. > > > > Sincerely, > > Maxim Maletsky > Founder, Chief Developer > > PHPBeginner.com (Where PHP Begins) > maximphpbeginner.com > www.phpbeginner.com > > > > > > -----Original Message----- > From: Joe Stump [mailto:jstumpzebulon.miester.org] > Sent: Friday, February 23, 2001 3:07 AM > To: Steve Edberg > Cc: Jackylilst; php-generallists.php.net > Subject: Re: [PHP] isset() > > > I stand firm on strlen() for the following reasons ... > > if(!$var) will sometimes act strangely (has for me in the past) when > variables > are set to something other than what you are expecting. > > if(isset($var)) will return true if your text field is declared but not > filled > in. > > if(empty($var)) will return true if $var is set to 0 (for obvious reason) so > is > only good for certain instances. > > strlen() on the other hand converts the variable to a string and returns a > count > of characters. It's never failed or acted funky. For this reason I use it > religiously. > > Others might say "well it's extra overhead" to which I reply "I'll take an > extra > bazillionth of a second to know for sure I have what I need" > > --Joe > > On Thu, Feb 22, 2001 at 08:18:22AM -0800, Steve Edberg wrote: > > I would do this: > > > > if (!$AgeChild) $AgeChild = 'NA'; > > > > More compact, easier to read (to me, anyway). This presumes that a > > value of '' (empty string, interpreted by PHP as false) is NOT a > > valid value here. > > > > As far as your sniplet goes, it is possible that there may be some > > PHP type-casting issues here, depending on: whether $AgeChild is > > numeric or string; the fact that the STRING "false" isn't equivalent > > to the CONSTANT false, the use of == vs. ===. > > > > Time to check out the docs - specifically the types and variables > > sections (also the functions->variables section)... > > > > - steve > > > > > > > > At 5:07 PM -0600 2/22/01, Jackylilst wrote: > > >People > > >I tried to check if teh field has set a vaule in it before submit > > >using isset with the sniplet below > > > > > >if ((isset($AgeChild))=="false") { > > >$AgeChild = "NA"; > > >} > > > > > >The resule is that it always displays NA whether or not it has vaule > > >in the field, what is the correct way of using isset for this > > >purpose? Or should I use empty() ? > > >Jack > > >jackyactivelifestyle.com > > >"There is nothing more rewarding than reaching the goal you set for > yourself" > > > > > > -- > > +--- "They've got a cherry pie there, that'll kill ya" ------------------+ > > | Steve Edberg University of California, Davis | > > | sbedbergucdavis.edu Computer Consultant | > > | http://aesric.ucdavis.edu/ http://pgfsun.ucdavis.edu/ | > > +-------------------------------------- FBI Special Agent Dale Cooper ---+ > > > > -- > > 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 > > -- > > --------------------------------------------------------------------------

    --
    > ---
    > Joe Stump, PHP Hacker,
    >                      -o)
    > http://www.miester.org http://www.care2.com
    > /\\
    > "It's not enough to succeed. Everyone else must fail" -- Larry Ellison
    > _\_V
    > --------------------------------------------------------------------------
    --
    > ---
    >
    >
    > --
    > 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
    >
    >
    

    --

    ---------------------------------------------------------------------------- --- Joe Stump, PHP Hacker, -o) http://www.miester.org http://www.care2.com /\\ "It's not enough to succeed. Everyone else must fail" -- Larry Ellison _\_V ---------------------------------------------------------------------------- ---

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


    You're wrong in saying that you "usually know what the variable will be" - you never know what it's going to be. You aren't entering it.... you need to remember that mostly idiots are inputting the data :O)

    --Joe

    On Sat, Feb 24, 2001 at 04:17:02PM +0900, PHPBeginner.com wrote: > have I said it won't work, Joe? > > I said that using strlen() might not be necessary. (re-read my post) > On my own opinion the same things could be done without using the string > functions. > Am I wrong in something there? then thanks for correcting me - will know it > for the feature. > > > Sincerely, > > Maxim Maletsky > Founder, Chief Developer > > PHPBeginner.com (Where PHP Begins) > maximphpbeginner.com > www.phpbeginner.com > > > > > -----Original Message----- > From: Joe Stump [mailto:jstumpzebulon.miester.org] > Sent: Saturday, February 24, 2001 4:17 PM > To: PHPBeginner.com > Cc: php-generallists.php.net > Subject: Re: [PHP] isset() > > > You are COMPLETELY wrong here. isset() is designed to check if a variable is > SET - NOT if it has something in it. empty() is designed for strings NOT for > ints - so if it's set to 0 it will fail. Finally in PHP 4 + you have > problems > when you do checks and variables aren't set. > > I do this, like I said before, because the extra 1 billionth of a second is > worth the overhead. I've programmed for sites ranging from a few hundered > hits > a day to a few million hits a day and this works ALL the time. > > --Joe > > On Sat, Feb 24, 2001 at 03:15:59PM +0900, PHPBeginner.com wrote: > > I don't agree with you in here, > > > > you usually know what kind of variable you're checking, so strlen() will > > work just as well as > > > > $var ? 'OK' : 'Empty' > > > > will work or the isset() - common, it was made for checking the > variables - > > use it. > > > > strlen() is in fact an overhead, why would you allow your design to be > some > > sort of untraditional? I don't think there's any necessity for it > > > > a "good design" often would be something like this: > > > > $var = 'whatever'; > > > > if($var) > > ...do this > > else > > ERROR('no var') // some your func to output the error mess or to continue > > with debugging > > > > in most cases it will work better and simpler for you without spending > these > > bazillions of important for every developer seconds. > > > > > > > > Sincerely, > > > > Maxim Maletsky > > Founder, Chief Developer > > > > PHPBeginner.com (Where PHP Begins) > > maximphpbeginner.com > > www.phpbeginner.com > > > > > > > > > > > > -----Original Message----- > > From: Joe Stump [mailto:jstumpzebulon.miester.org] > > Sent: Friday, February 23, 2001 3:07 AM > > To: Steve Edberg > > Cc: Jackylilst; php-generallists.php.net > > Subject: Re: [PHP] isset() > > > > > > I stand firm on strlen() for the following reasons ... > > > > if(!$var) will sometimes act strangely (has for me in the past) when > > variables > > are set to something other than what you are expecting. > > > > if(isset($var)) will return true if your text field is declared but not > > filled > > in. > > > > if(empty($var)) will return true if $var is set to 0 (for obvious reason) > so > > is > > only good for certain instances. > > > > strlen() on the other hand converts the variable to a string and returns a > > count > > of characters. It's never failed or acted funky. For this reason I use it > > religiously. > > > > Others might say "well it's extra overhead" to which I reply "I'll take an > > extra > > bazillionth of a second to know for sure I have what I need" > > > > --Joe > > > > On Thu, Feb 22, 2001 at 08:18:22AM -0800, Steve Edberg wrote: > > > I would do this: > > > > > > if (!$AgeChild) $AgeChild = 'NA'; > > > > > > More compact, easier to read (to me, anyway). This presumes that a > > > value of '' (empty string, interpreted by PHP as false) is NOT a > > > valid value here. > > > > > > As far as your sniplet goes, it is possible that there may be some > > > PHP type-casting issues here, depending on: whether $AgeChild is > > > numeric or string; the fact that the STRING "false" isn't equivalent > > > to the CONSTANT false, the use of == vs. ===. > > > > > > Time to check out the docs - specifically the types and variables > > > sections (also the functions->variables section)... > > > > > > - steve > > > > > > > > > > > > At 5:07 PM -0600 2/22/01, Jackylilst wrote: > > > >People > > > >I tried to check if teh field has set a vaule in it before submit > > > >using isset with the sniplet below > > > > > > > >if ((isset($AgeChild))=="false") { > > > >$AgeChild = "NA"; > > > >} > > > > > > > >The resule is that it always displays NA whether or not it has vaule > > > >in the field, what is the correct way of using isset for this > > > >purpose? Or should I use empty() ? > > > >Jack > > > >jackyactivelifestyle.com > > > >"There is nothing more rewarding than reaching the goal you set for > > yourself" > > > > > > > > > -- > > > +--- "They've got a cherry pie there, that'll kill > ya" ------------------+ > > > | Steve Edberg University of California, Davis > | > > > | sbedbergucdavis.edu Computer Consultant > | > > > | http://aesric.ucdavis.edu/ http://pgfsun.ucdavis.edu/ > | > > > +-------------------------------------- FBI Special Agent Dale > Cooper ---+ > > > > > > -- > > > 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 > > > > -- > > > > -------------------------------------------------------------------------- > -- > > --- > > Joe Stump, PHP Hacker, > > -o) > > http://www.miester.org http://www.care2.com > > /\\ > > "It's not enough to succeed. Everyone else must fail" -- Larry Ellison > > _\_V > > -------------------------------------------------------------------------- > -- > > --- > > > > > > -- > > 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 > > > > > > -- > > ---------------------------------------------------------------------------- > --- > Joe Stump, PHP Hacker, > -o) > http://www.miester.org http://www.care2.com > /\\ > "It's not enough to succeed. Everyone else must fail" -- Larry Ellison > _\_V > ---------------------------------------------------------------------------- > --- > > > -- > 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 > >

    -- 
    

    ------------------------------------------------------------------------------- Joe Stump, PHP Hacker, joestump98yahoo.com -o) http://www.miester.org http://www.care2.com /\\ "It's not enough to succeed. Everyone else must fail" -- Larry Ellison _\_V -------------------------------------------------------------------------------

    attached mail follows:


    Whatever they input is not the objects, right?

    then (I've just double-checked it, to be sure I am not saying some 'BULL')

    $var = 0;

    if($var) echo '<P>var matched';

    if(isset($var)) echo '<P>var is set';

    when the $var is 0 the second condition will return true, the first will be false instead... Obviously if they enter anything else then 0 and NULL (I mean nothing) it will return true in both cases, if($var.., if(isset($var... if(strle($var ...

    What's wrong with isset() in here? I am on PHP4.0.4!

    explain me again, why on user input strlen() would do better then isset() ?

    Sincerely,

    Maxim Maletsky Founder, Chief Developer

    PHPBeginner.com (Where PHP Begins) maximphpbeginner.com www.phpbeginner.com

    -----Original Message----- From: Joe Stump [mailto:jstumpzebulon.miester.org] Sent: Saturday, February 24, 2001 4:25 PM To: PHPBeginner.com Cc: php-generallists.php.net Subject: Re: [PHP] isset()

    You're wrong in saying that you "usually know what the variable will be" - you never know what it's going to be. You aren't entering it.... you need to remember that mostly idiots are inputting the data :O)

    --Joe

    On Sat, Feb 24, 2001 at 04:17:02PM +0900, PHPBeginner.com wrote: > have I said it won't work, Joe? > > I said that using strlen() might not be necessary. (re-read my post) > On my own opinion the same things could be done without using the string > functions. > Am I wrong in something there? then thanks for correcting me - will know it > for the feature. > > > Sincerely, > > Maxim Maletsky > Founder, Chief Developer > > PHPBeginner.com (Where PHP Begins) > maximphpbeginner.com > www.phpbeginner.com > > > > > -----Original Message----- > From: Joe Stump [mailto:jstumpzebulon.miester.org] > Sent: Saturday, February 24, 2001 4:17 PM > To: PHPBeginner.com > Cc: php-generallists.php.net > Subject: Re: [PHP] isset() > > > You are COMPLETELY wrong here. isset() is designed to check if a variable is > SET - NOT if it has something in it. empty() is designed for strings NOT for > ints - so if it's set to 0 it will fail. Finally in PHP 4 + you have > problems > when you do checks and variables aren't set. > > I do this, like I said before, because the extra 1 billionth of a second is > worth the overhead. I've programmed for sites ranging from a few hundered > hits > a day to a few million hits a day and this works ALL the time. > > --Joe > > On Sat, Feb 24, 2001 at 03:15:59PM +0900, PHPBeginner.com wrote: > > I don't agree with you in here, > > > > you usually know what kind of variable you're checking, so strlen() will > > work just as well as > > > > $var ? 'OK' : 'Empty' > > > > will work or the isset() - common, it was made for checking the > variables - > > use it. > > > > strlen() is in fact an overhead, why would you allow your design to be > some > > sort of untraditional? I don't think there's any necessity for it > > > > a "good design" often would be something like this: > > > > $var = 'whatever'; > > > > if($var) > > ...do this > > else > > ERROR('no var') // some your func to output the error mess or to continue > > with debugging > > > > in most cases it will work better and simpler for you without spending > these > > bazillions of important for every developer seconds. > > > > > > > > Sincerely, > > > > Maxim Maletsky > > Founder, Chief Developer > > > > PHPBeginner.com (Where PHP Begins) > > maximphpbeginner.com > > www.phpbeginner.com > > > > > > > > > > > > -----Original Message----- > > From: Joe Stump [mailto:jstumpzebulon.miester.org] > > Sent: Friday, February 23, 2001 3:07 AM > > To: Steve Edberg > > Cc: Jackylilst; php-generallists.php.net > > Subject: Re: [PHP] isset() > > > > > > I stand firm on strlen() for the following reasons ... > > > > if(!$var) will sometimes act strangely (has for me in the past) when > > variables > > are set to something other than what you are expecting. > > > > if(isset($var)) will return true if your text field is declared but not > > filled > > in. > > > > if(empty($var)) will return true if $var is set to 0 (for obvious reason) > so > > is > > only good for certain instances. > > > > strlen() on the other hand converts the variable to a string and returns a > > count > > of characters. It's never failed or acted funky. For this reason I use it > > religiously. > > > > Others might say "well it's extra overhead" to which I reply "I'll take an > > extra > > bazillionth of a second to know for sure I have what I need" > > > > --Joe > > > > On Thu, Feb 22, 2001 at 08:18:22AM -0800, Steve Edberg wrote: > > > I would do this: > > > > > > if (!$AgeChild) $AgeChild = 'NA'; > > > > > > More compact, easier to read (to me, anyway). This presumes that a > > > value of '' (empty string, interpreted by PHP as false) is NOT a > > > valid value here. > > > > > > As far as your sniplet goes, it is possible that there may be some > > > PHP type-casting issues here, depending on: whether $AgeChild is > > > numeric or string; the fact that the STRING "false" isn't equivalent > > > to the CONSTANT false, the use of == vs. ===. > > > > > > Time to check out the docs - specifically the types and variables > > > sections (also the functions->variables section)... > > > > > > - steve > > > > > > > > > > > > At 5:07 PM -0600 2/22/01, Jackylilst wrote: > > > >People > > > >I tried to check if teh field has set a vaule in it before submit > > > >using isset with the sniplet below > > > > > > > >if ((isset($AgeChild))=="false") { > > > >$AgeChild = "NA"; > > > >} > > > > > > > >The resule is that it always displays NA whether or not it has vaule > > > >in the field, what is the correct way of using isset for this > > > >purpose? Or should I use empty() ? > > > >Jack > > > >jackyactivelifestyle.com > > > >"There is nothing more rewarding than reaching the goal you set for > > yourself" > > > > > > > > > -- > > > +--- "They've got a cherry pie there, that'll kill > ya" ------------------+ > > > | Steve Edberg University of California, Davis > | > > > | sbedbergucdavis.edu Computer Consultant > | > > > | http://aesric.ucdavis.edu/ http://pgfsun.ucdavis.edu/ > | > > > +-------------------------------------- FBI Special Agent Dale > Cooper ---+ > > > > > > -- > > > 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 > > > > -- > > > > -------------------------------------------------------------------------- > -- > > --- > > Joe Stump, PHP Hacker, > > -o) > > http://www.miester.org http://www.care2.com > > /\\ > > "It's not enough to succeed. Everyone else must fail" -- Larry Ellison > > _\_V > > -------------------------------------------------------------------------- > -- > > --- > > > > > > -- > > 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 > > > > > > -- > > --------------------------------------------------------------------------

    --
    > ---
    > Joe Stump, PHP Hacker,
    >                      -o)
    > http://www.miester.org http://www.care2.com
    > /\\
    > "It's not enough to succeed. Everyone else must fail" -- Larry Ellison
    > _\_V
    > --------------------------------------------------------------------------
    --
    > ---
    >
    >
    > --
    > 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
    >
    >
    

    --

    ---------------------------------------------------------------------------- --- Joe Stump, PHP Hacker, -o) http://www.miester.org http://www.care2.com /\\ "It's not enough to succeed. Everyone else must fail" -- Larry Ellison _\_V ---------------------------------------------------------------------------- ---

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


    the SOLUTION:

    strlen() is the length of string, right? Then instead of doing

    1. comparison 2. function execution

    (I am talking here about your 1/bazillions of a second)

    a perfect solution would be :

    if($var!='')

    and, this is only

    1. comparison

    am I right?

    Now, no matter how much you care of thinking that the variable you need to match positive is a string longer then 0 characters

    if($var!='')

    will always do the same of strlen() but with less overhead and will add that 1/bazillion of a second to execution of your application...

    I am so 'HOT' on this issue because it looks to me more silly then needed an extra string function during execution of a conditional.

    nice day, Joe!

    Sincerely,

    Maxim Maletsky Founder, Chief Developer

    PHPBeginner.com (Where PHP Begins) maximphpbeginner.com www.phpbeginner.com

    -----Original Message----- From: Joe Stump [mailto:jstumpzebulon.miester.org] Sent: Saturday, February 24, 2001 4:25 PM To: PHPBeginner.com Cc: php-generallists.php.net Subject: Re: [PHP] isset()

    You're wrong in saying that you "usually know what the variable will be" - you never know what it's going to be. You aren't entering it.... you need to remember that mostly idiots are inputting the data :O)

    --Joe

    On Sat, Feb 24, 2001 at 04:17:02PM +0900, PHPBeginner.com wrote: > have I said it won't work, Joe? > > I said that using strlen() might not be necessary. (re-read my post) > On my own opinion the same things could be done without using the string > functions. > Am I wrong in something there? then thanks for correcting me - will know it > for the feature. > > > Sincerely, > > Maxim Maletsky > Founder, Chief Developer > > PHPBeginner.com (Where PHP Begins) > maximphpbeginner.com > www.phpbeginner.com > > > > > -----Original Message----- > From: Joe Stump [mailto:jstumpzebulon.miester.org] > Sent: Saturday, February 24, 2001 4:17 PM > To: PHPBeginner.com > Cc: php-generallists.php.net > Subject: Re: [PHP] isset() > > > You are COMPLETELY wrong here. isset() is designed to check if a variable is > SET - NOT if it has something in it. empty() is designed for strings NOT for > ints - so if it's set to 0 it will fail. Finally in PHP 4 + you have > problems > when you do checks and variables aren't set. > > I do this, like I said before, because the extra 1 billionth of a second is > worth the overhead. I've programmed for sites ranging from a few hundered > hits > a day to a few million hits a day and this works ALL the time. > > --Joe > > On Sat, Feb 24, 2001 at 03:15:59PM +0900, PHPBeginner.com wrote: > > I don't agree with you in here, > > > > you usually know what kind of variable you're checking, so strlen() will > > work just as well as > > > > $var ? 'OK' : 'Empty' > > > > will work or the isset() - common, it was made for checking the > variables - > > use it. > > > > strlen() is in fact an overhead, why would you allow your design to be > some > > sort of untraditional? I don't think there's any necessity for it > > > > a "good design" often would be something like this: > > > > $var = 'whatever'; > > > > if($var) > > ...do this > > else > > ERROR('no var') // some your func to output the error mess or to continue > > with debugging > > > > in most cases it will work better and simpler for you without spending > these > > bazillions of important for every developer seconds. > > > > > > > > Sincerely, > > > > Maxim Maletsky > > Founder, Chief Developer > > > > PHPBeginner.com (Where PHP Begins) > > maximphpbeginner.com > > www.phpbeginner.com > > > > > > > > > > > > -----Original Message----- > > From: Joe Stump [mailto:jstumpzebulon.miester.org] > > Sent: Friday, February 23, 2001 3:07 AM > > To: Steve Edberg > > Cc: Jackylilst; php-generallists.php.net > > Subject: Re: [PHP] isset() > > > > > > I stand firm on strlen() for the following reasons ... > > > > if(!$var) will sometimes act strangely (has for me in the past) when > > variables > > are set to something other than what you are expecting. > > > > if(isset($var)) will return true if your text field is declared but not > > filled > > in. > > > > if(empty($var)) will return true if $var is set to 0 (for obvious reason) > so > > is > > only good for certain instances. > > > > strlen() on the other hand converts the variable to a string and returns a > > count > > of characters. It's never failed or acted funky. For this reason I use it > > religiously. > > > > Others might say "well it's extra overhead" to which I reply "I'll take an > > extra > > bazillionth of a second to know for sure I have what I need" > > > > --Joe > > > > On Thu, Feb 22, 2001 at 08:18:22AM -0800, Steve Edberg wrote: > > > I would do this: > > > > > > if (!$AgeChild) $AgeChild = 'NA'; > > > > > > More compact, easier to read (to me, anyway). This presumes that a > > > value of '' (empty string, interpreted by PHP as false) is NOT a > > > valid value here. > > > > > > As far as your sniplet goes, it is possible that there may be some > > > PHP type-casting issues here, depending on: whether $AgeChild is > > > numeric or string; the fact that the STRING "false" isn't equivalent > > > to the CONSTANT false, the use of == vs. ===. > > > > > > Time to check out the docs - specifically the types and variables > > > sections (also the functions->variables section)... > > > > > > - steve > > > > > > > > > > > > At 5:07 PM -0600 2/22/01, Jackylilst wrote: > > > >People > > > >I tried to check if teh field has set a vaule in it before submit > > > >using isset with the sniplet below > > > > > > > >if ((isset($AgeChild))=="false") { > > > >$AgeChild = "NA"; > > > >} > > > > > > > >The resule is that it always displays NA whether or not it has vaule > > > >in the field, what is the correct way of using isset for this > > > >purpose? Or should I use empty() ? > > > >Jack > > > >jackyactivelifestyle.com > > > >"There is nothing more rewarding than reaching the goal you set for > > yourself" > > > > > > > > > -- > > > +--- "They've got a cherry pie there, that'll kill > ya" ------------------+ > > > | Steve Edberg University of California, Davis > | > > > | sbedbergucdavis.edu Computer Consultant > | > > > | http://aesric.ucdavis.edu/ http://pgfsun.ucdavis.edu/ > | > > > +-------------------------------------- FBI Special Agent Dale > Cooper ---+ > > > > > > -- > > > 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 > > > > -- > > > > -------------------------------------------------------------------------- > -- > > --- > > Joe Stump, PHP Hacker, > > -o) > > http://www.miester.org http://www.care2.com > > /\\ > > "It's not enough to succeed. Everyone else must fail" -- Larry Ellison > > _\_V > > -------------------------------------------------------------------------- > -- > > --- > > > > > > -- > > 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 > > > > > > -- > > --------------------------------------------------------------------------

    --
    > ---
    > Joe Stump, PHP Hacker,
    >                      -o)
    > http://www.miester.org http://www.care2.com
    > /\\
    > "It's not enough to succeed. Everyone else must fail" -- Larry Ellison
    > _\_V
    > --------------------------------------------------------------------------
    --
    > ---
    >
    >
    > --
    > 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
    >
    >
    

    --

    ---------------------------------------------------------------------------- --- Joe Stump, PHP Hacker, -o) http://www.miester.org http://www.care2.com /\\ "It's not enough to succeed. Everyone else must fail" -- Larry Ellison _\_V ---------------------------------------------------------------------------- ---

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


    For the last time - put an input box on a page and submit with NOTHING in the box. Now I want SOMETHING in that box (like a name) - isset() will return true even though it's empty.

    --Joe

    On Sat, Feb 24, 2001 at 04:32:11PM +0900, PHPBeginner.com wrote: > Whatever they input is not the objects, right? > > then (I've just double-checked it, to be sure I am not saying some 'BULL') > > > $var = 0; > > if($var) > echo '<P>var matched'; > > if(isset($var)) > echo '<P>var is set'; > > > when the $var is 0 the second condition will return true, the first will be > false instead... > Obviously if they enter anything else then 0 and NULL (I mean nothing) it > will return true in both cases, if($var.., if(isset($var... if(strle($var > ... > > What's wrong with isset() in here? > I am on PHP4.0.4! > > explain me again, why on user input strlen() would do better then isset() ? > > > Sincerely, > > Maxim Maletsky > Founder, Chief Developer > > PHPBeginner.com (Where PHP Begins) > maximphpbeginner.com > www.phpbeginner.com > > > > > > -----Original Message----- > From: Joe Stump [mailto:jstumpzebulon.miester.org] > Sent: Saturday, February 24, 2001 4:25 PM > To: PHPBeginner.com > Cc: php-generallists.php.net > Subject: Re: [PHP] isset() > > > You're wrong in saying that you "usually know what the variable will be" - > you > never know what it's going to be. You aren't entering it.... you need to > remember that mostly idiots are inputting the data :O) > > --Joe > > On Sat, Feb 24, 2001 at 04:17:02PM +0900, PHPBeginner.com wrote: > > have I said it won't work, Joe? > > > > I said that using strlen() might not be necessary. (re-read my post) > > On my own opinion the same things could be done without using the string > > functions. > > Am I wrong in something there? then thanks for correcting me - will know > it > > for the feature. > > > > > > Sincerely, > > > > Maxim Maletsky > > Founder, Chief Developer > > > > PHPBeginner.com (Where PHP Begins) > > maximphpbeginner.com > > www.phpbeginner.com > > > > > > > > > > -----Original Message----- > > From: Joe Stump [mailto:jstumpzebulon.miester.org] > > Sent: Saturday, February 24, 2001 4:17 PM > > To: PHPBeginner.com > > Cc: php-generallists.php.net > > Subject: Re: [PHP] isset() > > > > > > You are COMPLETELY wrong here. isset() is designed to check if a variable > is > > SET - NOT if it has something in it. empty() is designed for strings NOT > for > > ints - so if it's set to 0 it will fail. Finally in PHP 4 + you have > > problems > > when you do checks and variables aren't set. > > > > I do this, like I said before, because the extra 1 billionth of a second > is > > worth the overhead. I've programmed for sites ranging from a few hundered > > hits > > a day to a few million hits a day and this works ALL the time. > > > > --Joe > > > > On Sat, Feb 24, 2001 at 03:15:59PM +0900, PHPBeginner.com wrote: > > > I don't agree with you in here, > > > > > > you usually know what kind of variable you're checking, so strlen() will > > > work just as well as > > > > > > $var ? 'OK' : 'Empty' > > > > > > will work or the isset() - common, it was made for checking the > > variables - > > > use it. > > > > > > strlen() is in fact an overhead, why would you allow your design to be > > some > > > sort of untraditional? I don't think there's any necessity for it > > > > > > a "good design" often would be something like this: > > > > > > $var = 'whatever'; > > > > > > if($var) > > > ...do this > > > else > > > ERROR('no var') // some your func to output the error mess or to > continue > > > with debugging > > > > > > in most cases it will work better and simpler for you without spending > > these > > > bazillions of important for every developer seconds. > > > > > > > > > > > > Sincerely, > > > > > > Maxim Maletsky > > > Founder, Chief Developer > > > > > > PHPBeginner.com (Where PHP Begins) > > > maximphpbeginner.com > > > www.phpbeginner.com > > > > > > > > > > > > > > > > > > -----Original Message----- > > > From: Joe Stump [mailto:jstumpzebulon.miester.org] > > > Sent: Friday, February 23, 2001 3:07 AM > > > To: Steve Edberg > > > Cc: Jackylilst; php-generallists.php.net > > > Subject: Re: [PHP] isset() > > > > > > > > > I stand firm on strlen() for the following reasons ... > > > > > > if(!$var) will sometimes act strangely (has for me in the past) when > > > variables > > > are set to something other than what you are expecting. > > > > > > if(isset($var)) will return true if your text field is declared but not > > > filled > > > in. > > > > > > if(empty($var)) will return true if $var is set to 0 (for obvious > reason) > > so > > > is > > > only good for certain instances. > > > > > > strlen() on the other hand converts the variable to a string and returns > a > > > count > > > of characters. It's never failed or acted funky. For this reason I use > it > > > religiously. > > > > > > Others might say "well it's extra overhead" to which I reply "I'll take > an > > > extra > > > bazillionth of a second to know for sure I have what I need" > > > > > > --Joe > > > > > > On Thu, Feb 22, 2001 at 08:18:22AM -0800, Steve Edberg wrote: > > > > I would do this: > > > > > > > > if (!$AgeChild) $AgeChild = 'NA'; > > > > > > > > More compact, easier to read (to me, anyway). This presumes that a > > > > value of '' (empty string, interpreted by PHP as false) is NOT a > > > > valid value here. > > > > > > > > As far as your sniplet goes, it is possible that there may be some > > > > PHP type-casting issues here, depending on: whether $AgeChild is > > > > numeric or string; the fact that the STRING "false" isn't equivalent > > > > to the CONSTANT false, the use of == vs. ===. > > > > > > > > Time to check out the docs - specifically the types and variables > > > > sections (also the functions->variables section)... > > > > > > > > - steve > > > > > > > > > > > > > > > > At 5:07 PM -0600 2/22/01, Jackylilst wrote: > > > > >People > > > > >I tried to check if teh field has set a vaule in it before submit > > > > >using isset with the sniplet below > > > > > > > > > >if ((isset($AgeChild))=="false") { > > > > >$AgeChild = "NA"; > > > > >} > > > > > > > > > >The resule is that it always displays NA whether or not it has vaule > > > > >in the field, what is the correct way of using isset for this > > > > >purpose? Or should I use empty() ? > > > > >Jack > > > > >jackyactivelifestyle.com > > > > >"There is nothing more rewarding than reaching the goal you set for > > > yourself" > > > > > > > > > > > > -- > > > > +--- "They've got a cherry pie there, that'll kill > > ya" ------------------+ > > > > | Steve Edberg University of California, > Davis > > | > > > > | sbedbergucdavis.edu Computer > Consultant > > | > > > > | http://aesric.ucdavis.edu/ > http://pgfsun.ucdavis.edu/ > > | > > > > +-------------------------------------- FBI Special Agent Dale > > Cooper ---+ > > > > > > > > -- > > > > 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 > > > > > > -- > > > > > > > -------------------------------------------------------------------------- > > -- > > > --- > > > Joe Stump, PHP Hacker, > > > -o) > > > http://www.miester.org http://www.care2.com > > > /\\ > > > "It's not enough to succeed. Everyone else must fail" -- Larry Ellison > > > _\_V > > > > -------------------------------------------------------------------------- > > -- > > > --- > > > > > > > > > -- > > > 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 > > > > > > > > > > -- > > > > -------------------------------------------------------------------------- > -- > > --- > > Joe Stump, PHP Hacker, > > -o) > > http://www.miester.org http://www.care2.com > > /\\ > > "It's not enough to succeed. Everyone else must fail" -- Larry Ellison > > _\_V > > -------------------------------------------------------------------------- > -- > > --- > > > > > > -- > > 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 > > > > > > -- > > ---------------------------------------------------------------------------- > --- > Joe Stump, PHP Hacker, > -o) > http://www.miester.org http://www.care2.com > /\\ > "It's not enough to succeed. Everyone else must fail" -- Larry Ellison > _\_V > ---------------------------------------------------------------------------- > --- > > > -- > 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 > >

    -- 
    

    ------------------------------------------------------------------------------- Joe Stump, PHP Hacker, joestump98yahoo.com -o) http://www.miester.org http://www.care2.com /\\ "It's not enough to succeed. Everyone else must fail" -- Larry Ellison _\_V -------------------------------------------------------------------------------

    attached mail follows:


    in my preceding email I've written:

    if($var!='')

    will fix your all your worries without an intervention of a strings function.

    Sincerely,

    Maxim Maletsky Founder, Chief Developer

    PHPBeginner.com (Where PHP Begins) maximphpbeginner.com www.phpbeginner.com

    -----Original Message----- From: Joe Stump [mailto:jstumpzebulon.miester.org] Sent: Sunday, February 25, 2001 1:09 AM To: PHPBeginner.com Cc: php-generallists.php.net Subject: Re: [PHP] isset()

    For the last time - put an input box on a page and submit with NOTHING in the box. Now I want SOMETHING in that box (like a name) - isset() will return true even though it's empty.

    --Joe

    On Sat, Feb 24, 2001 at 04:32:11PM +0900, PHPBeginner.com wrote: > Whatever they input is not the objects, right? > > then (I've just double-checked it, to be sure I am not saying some 'BULL') > > > $var = 0; > > if($var) > echo '<P>var matched'; > > if(isset($var)) > echo '<P>var is set'; > > > when the $var is 0 the second condition will return true, the first will be > false instead... > Obviously if they enter anything else then 0 and NULL (I mean nothing) it > will return true in both cases, if($var.., if(isset($var... if(strle($var > ... > > What's wrong with isset() in here? > I am on PHP4.0.4! > > explain me again, why on user input strlen() would do better then isset() ? > > > Sincerely, > > Maxim Maletsky > Founder, Chief Developer > > PHPBeginner.com (Where PHP Begins) > maximphpbeginner.com > www.phpbeginner.com > > > > > > -----Original Message----- > From: Joe Stump [mailto:jstumpzebulon.miester.org] > Sent: Saturday, February 24, 2001 4:25 PM > To: PHPBeginner.com > Cc: php-generallists.php.net > Subject: Re: [PHP] isset() > > > You're wrong in saying that you "usually know what the variable will be" - > you > never know what it's going to be. You aren't entering it.... you need to > remember that mostly idiots are inputting the data :O) > > --Joe > > On Sat, Feb 24, 2001 at 04:17:02PM +0900, PHPBeginner.com wrote: > > have I said it won't work, Joe? > > > > I said that using strlen() might not be necessary. (re-read my post) > > On my own opinion the same things could be done without using the string > > functions. > > Am I wrong in something there? then thanks for correcting me - will know > it > > for the feature. > > > > > > Sincerely, > > > > Maxim Maletsky > > Founder, Chief Developer > > > > PHPBeginner.com (Where PHP Begins) > > maximphpbeginner.com > > www.phpbeginner.com > > > > > > > > > > -----Original Message----- > > From: Joe Stump [mailto:jstumpzebulon.miester.org] > > Sent: Saturday, February 24, 2001 4:17 PM > > To: PHPBeginner.com > > Cc: php-generallists.php.net > > Subject: Re: [PHP] isset() > > > > > > You are COMPLETELY wrong here. isset() is designed to check if a variable > is > > SET - NOT if it has something in it. empty() is designed for strings NOT > for > > ints - so if it's set to 0 it will fail. Finally in PHP 4 + you have > > problems > > when you do checks and variables aren't set. > > > > I do this, like I said before, because the extra 1 billionth of a second > is > > worth the overhead. I've programmed for sites ranging from a few hundered > > hits > > a day to a few million hits a day and this works ALL the time. > > > > --Joe > > > > On Sat, Feb 24, 2001 at 03:15:59PM +0900, PHPBeginner.com wrote: > > > I don't agree with you in here, > > > > > > you usually know what kind of variable you're checking, so strlen() will > > > work just as well as > > > > > > $var ? 'OK' : 'Empty' > > > > > > will work or the isset() - common, it was made for checking the > > variables - > > > use it. > > > > > > strlen() is in fact an overhead, why would you allow your design to be > > some > > > sort of untraditional? I don't think there's any necessity for it > > > > > > a "good design" often would be something like this: > > > > > > $var = 'whatever'; > > > > > > if($var) > > > ...do this > > > else > > > ERROR('no var') // some your func to output the error mess or to > continue > > > with debugging > > > > > > in most cases it will work better and simpler for you without spending > > these > > > bazillions of important for every developer seconds. > > > > > > > > > > > > Sincerely, > > > > > > Maxim Maletsky > > > Founder, Chief Developer > > > > > > PHPBeginner.com (Where PHP Begins) > > > maximphpbeginner.com > > > www.phpbeginner.com > > > > > > > > > > > > > > > > > > -----Original Message----- > > > From: Joe Stump [mailto:jstumpzebulon.miester.org] > > > Sent: Friday, February 23, 2001 3:07 AM > > > To: Steve Edberg > > > Cc: Jackylilst; php-generallists.php.net > > > Subject: Re: [PHP] isset() > > > > > > > > > I stand firm on strlen() for the following reasons ... > > > > > > if(!$var) will sometimes act strangely (has for me in the past) when > > > variables > > > are set to something other than what you are expecting. > > > > > > if(isset($var)) will return true if your text field is declared but not > > > filled > > > in. > > > > > > if(empty($var)) will return true if $var is set to 0 (for obvious > reason) > > so > > > is > > > only good for certain instances. > > > > > > strlen() on the other hand converts the variable to a string and returns > a > > > count > > > of characters. It's never failed or acted funky. For this reason I use > it > > > religiously. > > > > > > Others might say "well it's extra overhead" to which I reply "I'll take > an > > > extra > > > bazillionth of a second to know for sure I have what I need" > > > > > > --Joe > > > > > > On Thu, Feb 22, 2001 at 08:18:22AM -0800, Steve Edberg wrote: > > > > I would do this: > > > > > > > > if (!$AgeChild) $AgeChild = 'NA'; > > > > > > > > More compact, easier to read (to me, anyway). This presumes that a > > > > value of '' (empty string, interpreted by PHP as false) is NOT a > > > > valid value here. > > > > > > > > As far as your sniplet goes, it is possible that there may be some > > > > PHP type-casting issues here, depending on: whether $AgeChild is > > > > numeric or string; the fact that the STRING "false" isn't equivalent > > > > to the CONSTANT false, the use of == vs. ===. > > > > > > > > Time to check out the docs - specifically the types and variables > > > > sections (also the functions->variables section)... > > > > > > > > - steve > > > > > > > > > > > > > > > > At 5:07 PM -0600 2/22/01, Jackylilst wrote: > > > > >People > > > > >I tried to check if teh field has set a vaule in it before submit > > > > >using isset with the sniplet below > > > > > > > > > >if ((isset($AgeChild))=="false") { > > > > >$AgeChild = "NA"; > > > > >} > > > > > > > > > >The resule is that it always displays NA whether or not it has vaule > > > > >in the field, what is the correct way of using isset for this > > > > >purpose? Or should I use empty() ? > > > > >Jack > > > > >jackyactivelifestyle.com > > > > >"There is nothing more rewarding than reaching the goal you set for > > > yourself" > > > > > > > > > > > > -- > > > > +--- "They've got a cherry pie there, that'll kill > > ya" ------------------+ > > > > | Steve Edberg University of California, > Davis > > | > > > > | sbedbergucdavis.edu Computer > Consultant > > | > > > > | http://aesric.ucdavis.edu/ > http://pgfsun.ucdavis.edu/ > > | > > > > +-------------------------------------- FBI Special Agent Dale > > Cooper ---+ > > > > > > > > -- > > > > 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 > > > > > > -- > > > > > > > -------------------------------------------------------------------------- > > -- > > > --- > > > Joe Stump, PHP Hacker, > > > -o) > > > http://www.miester.org http://www.care2.com > > > /\\ > > > "It's not enough to succeed. Everyone else must fail" -- Larry Ellison > > > _\_V > > > > -------------------------------------------------------------------------- > > -- > > > --- > > > > > > > > > -- > > > 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 > > > > > > > > > > -- > > > > -------------------------------------------------------------------------- > -- > > --- > > Joe Stump, PHP Hacker, > > -o) > > http://www.miester.org http://www.care2.com > > /\\ > > "It's not enough to succeed. Everyone else must fail" -- Larry Ellison > > _\_V > > -------------------------------------------------------------------------- > -- > > --- > > > > > > -- > > 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 > > > > > > -- > > --------------------------------------------------------------------------

    --
    > ---
    > Joe Stump, PHP Hacker,
    >                      -o)
    > http://www.miester.org http://www.care2.com
    > /\\
    > "It's not enough to succeed. Everyone else must fail" -- Larry Ellison
    > _\_V
    > --------------------------------------------------------------------------
    --
    > ---
    >
    >
    > --
    > 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
    >
    >
    

    --

    ---------------------------------------------------------------------------- --- Joe Stump, PHP Hacker, -o) http://www.miester.org http://www.care2.com /\\ "It's not enough to succeed. Everyone else must fail" -- Larry Ellison _\_V ---------------------------------------------------------------------------- ---

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


    Hi (Soma Interesting?)

    I am also a developer here in Tokyo and have done few I-Mode websites using PHP and mySQL. (I've used PostgreSQL with Japanese, but not for I-Mode) ( see www.japaninc.com/i )

    There's no particular problems of storing the 2-bit data in your databases, the only thing is that to do sorting you have to compile the databases with the language needed ( regardless of which database you use - see their docs they all support that).

    With PHP there's a little problem using string functions. strlen(), for instance will return you the number of bytes. In Latin characters ASCII 1-255 a character is a byte, but that doesn't apply to Japanese which use double bits (some characters are even three bits), so a strlen() will not return you the number of Hiragana & Kanji in string - it will return you the number of bits these Kanji were composed from - VERY, VERY UGLY....

    You need to use PHP3 Japanese interpretation to do that kind of tasks.

    In our company we use a different server for Japanese characters running PHP3 JIS, and the pages are being included form there.

    IE: www.fusion-2000.net runs both PHP4 and PHP3 JIS with PostgreSQL at the back end.

    While www.japaninc.com/i goes on PHP4.0.1pl2 and mySQL, (check out that game)

    So, no worries, it is all possible to do, except there's a pain with choosing PHP version for the server.

    Sincerely,

    Maxim Maletsky Founder, Chief Developer

    PHPBeginner.com (Where PHP Begins) maximphpbeginner.com www.phpbeginner.com

    -----Original Message----- From: Soma Interesting [mailto:dfuncttelus.net] Sent: Friday, February 23, 2001 3:23 AM To: pgsql-generalpostgresql.org; php-generallists.php.net; php-i18nlists.php.net Subject: [PHP] International support

    Hello everyone,

    I'm currently working a project that is intended to handle Japanese character sets - and now I'm told ideally iMode too. :) The iMode isn't such an issue at the moment - but the article below has spooked me a little. At an early point in the project we tested if putting some input into a web form, which ultimately was handled by php then stored in postgres would return fully intact - and it did. This left me comfortable that PHP and Postgres don't seem to care what language they're storing in fields or variables. I'm 'guessing' that this is because the data, whether its English or Japanese is being stored in binary (or something else?). Of course I wouldn't be able to sort the data or do anything else that would require PHP/Postgres to be able to interpret the data. However if I compile Postgres with locals support for the character set/language in question - then postgres will be able to sort Japanese. Is this right?

    Have I got this all right so far? I have attempted to do my research on this - but finding a real beginners guide to international web development has been a trick. And the best sources I have found on this topic generally are specific to Oracle. Any links would be appreciated.

    Ok the next part of this message is an article I thought would be generally interesting so I'm not hesitating to post it entirely. It was forwarded to me so I'm not sure of the source.

    For the postgres folks, these developers went with MySQL - I've chosen Postgres. Is there anything MySQL does that Postgres doesn't in terms of language support that I should be aware of?

    >Back to case study >r-newbold.com > >George Baptista is riding the wave of the latest technology with his >company's newest venture: ><http://www.r-newbold.com>r-newbold.<http://www.r-newbold.com>com, a >wireless i-Mode site created with PHP. > >Based in Tokyo, George is a Web developer and co-partner with Izumi >Hiroshima at <http://www.omame.com>Studio <http://www.omame.com>Omame. He >was part of the creative team behind the Japanese-language site, and he is >finding that i-Mode is not only fashionable, but also the face of the future. > >r-newbold.com was developed for British fashion designer, Paul Smith. NTT >DoCoMo's i-Mode Web-browsing cellular phones, which already have over 10 >million users, offers a fast wireless data service with Internet access. >In Japan, it's been a hit with the younger generation. And since >r-newbold.com's target population is young, hip and fashionable, the >decision to create an i-Mode site rather than a regular Web site made >perfect sense. > >PHP and i-Mode: The perfect match >"i-Mode is exploding in Japan," George adds. "It offers new and >interesting challenges to the developer. The i18n J version of PHP is an >increasingly popular choice for developers [in Japan] because of its >overall performance, speed of development, and character set capability >features." > >George and his team at Studio Omame have already been using PHP for about >a year prior to developing the r-newbold site, and were very pleased with >its performance. He cites several reasons for his company's choice of PHP >including: >* PHP's overall performance and reliability >* ease with which to prototype in >* PHP's large and growing developer base >"There are a growing number of developers in Tokyo using it. We also knew >there was ample support on both main and Japanese PHP mailing lists for >any problems that might come up," George says. >"PHP became especially useful to us when Shigeru Kanemoto, Hironori Neal >Sato and a few other developers worked to release a version of PHP >3.0.15-i18n. We are looking forward to this same core of people to also >soon release an i18n J version of PHP 4. We expect it will provide us with >even greater speed and performance than PHP 3." >Studio Omame's decision to use PHP was welcomed by Paul Smith's company. >The open-source nature of the product was simply not an issue. "We >suggested PHP, and there was no problem. They were happy about the >cost-savings involved," George recalls. > >PHP's Japanese challenge >Since r-newbold.com is in Japanese only, Studio Omame made sure to utilize >PHP's Japanese character set conversion functions. However, this proved to >be a challenge.

    Is this available for v4 of PHP yet?

    >"Dealing with character sets when developing for the Japanese market is a >headache," George says. "There's not one, but 3 character sets in wide >use: SJIS, EUC and JIS. > >"We used all of them for this project. All output for the i-Mode platform >needs to be SJIS, while input to MySQL is in EUC, and data for mailing was >encoded in JIS. Ensuring the integrity of data via character set >conversion was a very important factor. Ultimately, PHP made this project >much smoother and very enjoyable. Not having to worry about character set >mangling is a godsend." > >There was also the task of adapting PHP from computers to telephones. "The >unique nature of celluar phone interfaces affected our application >development. For example, people browsing the Web using i-Mode phones tend >to use the back button a lot, rather than 'back' or 'return' links. >Figuring out how to deal with this in preserving session data integrity >took a little thinking." > >George and his team did figure it out, although George points out that >"Daryl Jones of TEA, a communications firm based in Silicon Valley, helped >out tremendously with the network and server consulting and set-up, so >that we could focus totally on PHP development." >It took Studio Omame almost two months to write the PHP scripts for all of >the site's functions, including mail and accessing MySQL. "As much as >possible, we try to stick with *nix, Apache, PHP," George says. > >The current shop database holds approximately 60 records, and the >membership section is designed to easily handle an initial 20,000 records. >In addition, other miscellaneous tables are used for administrative purposes. > >PHP's functions >PHP serves a variety of functions on the r-newbold site, including: >* authentication and sessions via PHPLIB for a member-only section >* PHP scripts + cron accessing MySQL database to send out daily e-mails >* heavy use of mail functions for viral-marketing features >* detecting specific browser/celluar handset and serving the appropriate >interface >* Japanese character set functions specific to i18n version, ensuring SJIS >output, internal processing in EUC >* mail operations in JIS > >As far as security purposes are concerned, Studio Omame decided to use >PHPLIB for authentication. "At first we tried using the standard HTTP >authentication method, but it turned out that certain i-Mode handsets had >somewhat sketchy browser implementations, and they would need to log-in >for each password-protected page! So we turned to PHPLIB, which worked >very nicely." > >The site currently receives more than 3,000 page views per day, with most >visitors spending about 5 minutes at a time on the site. "In Japan, people >generally use i-Mode sites in mini-bursts, for example, while waiting for >the train, riding the bus or walking about the street," George says. > >r-newbold.com hopes to receive approximately 200,000 visitors a day >initially. "We tried to reduce the amount of calls to MySQL as much as >possible, and instead created static pages that are updated from an >administration screen." > >Data is collected on visitors in the members' section only. It's an >entirely opt-in, voluntary feature, George notes. >Studio Omame also used Adobe's GoLive 5 for the information design and >page-template creation for this project. The WebDav and i-Mode eMoji >features were particularly useful. > >As i-Mode becomes more and more popular, George says he hopes PHP will >eventually provide more i18n compatibility. >In the meantime, Studio Omame has launched omake.com in an experimental >i-Mode site using PHP. Several other i-Mode projects are also in the >pipeline. "We plan to use PHP extensively for all of them," George predicts.

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


    It shouldn't have happened,

    can you give as a come sample to resolve your situation?

    Sincerely,

    Maxim Maletsky Founder, Chief Developer

    PHPBeginner.com (Where PHP Begins) maximphpbeginner.com www.phpbeginner.com

    -----Original Message----- From: kaab kaoutar [mailto:kaab_khotmail.com] Sent: Friday, February 23, 2001 3:36 AM To: php-generallists.php.net Subject: [PHP] variable sent using pots is cat!

    Hi! i have a problem! i send a variable from one page to another page using post method! but when a variable is like composed of two words , the other page receives only the first word ! can u please help?! Thanks _________________________________________________________________________ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

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


    bugs.php.net

    Sincerely,

    Maxim Maletsky Founder, Chief Developer

    PHPBeginner.com (Where PHP Begins) maximphpbeginner.com www.phpbeginner.com

    -----Original Message----- From: Ide, Jim [mailto:jidelgb-inc.com] Sent: Friday, February 23, 2001 3:49 AM To: 'php-generallists.php.net' Subject: [PHP] How do I request a new feature?

    Hi -

    How can/should I contact the developers of PHP to request that they add a new feature to PHP?

    Thanks - Jim

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


    PHP does it automatically for you.

    YES your session id is $PHPSESSID

    so creating a file called $PHPSESSID should work, I suppose

    Sincerely,

    Maxim Maletsky Founder, Chief Developer

    PHPBeginner.com (Where PHP Begins) maximphpbeginner.com www.phpbeginner.com

    -----Original Message----- From: Brandon Orther [mailto:brandonwebintellects.com] Sent: Friday, February 23, 2001 3:56 AM To: PHP User Group Subject: [PHP] Sessions and naming a file with SID

    Hello,

    Is there a way to start a session and then save a temp file with the name of the Session ID?

    Thank you,

    -------------------------------------------- Brandon Orther WebIntellects Design/Development Manager brandonwebintellects.com 800-994-6364 www.webintellects.com --------------------------------------------

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


    try these:

    search google for fast templates templates,

    check out sourceforge.net

    there's a whole bunch of this applications.

    Sincerely,

    Maxim Maletsky Founder, Chief Developer

    PHPBeginner.com (Where PHP Begins) maximphpbeginner.com www.phpbeginner.com

    -----Original Message----- From: Maamiin [mailto:maamiinhot.ee] Sent: Friday, February 23, 2001 4:06 AM To: PHP General Newslist Subject: [PHP] Templates & PHP

    Where can I find some help, how to make & use page templates on my webpages??? Needs this some add-ons to my PHP3(Linux-main)/PHP4(win98+pws)?

    THNX

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


    use urlencode()

    www.php.net/urlencode

    Sincerely,

    Maxim Maletsky Founder, Chief Developer

    PHPBeginner.com (Where PHP Begins) maximphpbeginner.com www.phpbeginner.com

    -----Original Message----- From: Tom Harris [mailto:stry_catyahoo.com] Sent: Friday, February 23, 2001 4:12 AM To: php-generallists.php.net Subject: [PHP] Passing values containing a ? and a &

    I want to assign a value using the url however the value contains both a ? and an & so PHP (or the browser) seems to get confused.

    Here's an example:

    http://www.mysite.com/index.php?id=23&url=http://www.anothersite.com/file.ph p?qid=234&forum=4

    Everything after url= should be the value of $url but this is not the case. Is there a way to solve this?

    Thanks

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


    Professional PHP Programming is a good one

    Sincerely,

    Maxim Maletsky Founder, Chief Developer

    PHPBeginner.com (Where PHP Begins) maximphpbeginner.com www.phpbeginner.com

    -----Original Message----- From: grios [mailto:grios]On Behalf Of Gustavo Vieira Goncalves Coelho Rios Sent: Thursday, February 22, 2001 1:47 PM To: php-generallists.php.net Subject: [PHP] books

    May some suggest a kick ass book on php?

    Thanks a lot for your time and cooperation.

    best regards, Gustavo Rios

    PS: Any one here from Brazil/South America ?

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


    no, you need to do three different comparisons :

    if( ... something ... ) (eregi("stuff1", $one) and eregi("stuff2", $two) and eregi("stuff3", $three)) ? : do this : do that

    Sincerely,

    Maxim Maletsky Founder, Chief Developer

    PHPBeginner.com (Where PHP Begins) maximphpbeginner.com www.phpbeginner.com

    -----Original Message----- From: W.D. [mailto:suedeunoyahoo.com] Sent: Friday, February 23, 2001 5:38 AM To: Philip Olson Cc: php-generallists.php.net Subject: Re: [PHP] concatenate vars?

    Thanks,

    do you know if making multiple statements to eregi in line 3 is possible?

    1. if(...something...) 2.{ 3. (eregi("stuff1", $one)("stuff2", $two)("stuff3", $three)) ? 4. do something : do something else;

    _________________________________________________________ Do You Yahoo!? Get your free yahoo.com address at http://mail.yahoo.com

    --
    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 cannot help you, but I KNOW you are not the only one, I've been asked this question already, and, I think I've seen something on php.net under mail() ...

    I believe this is your XSender thing, but not sure ...

    Sincerely,

    Maxim Maletsky Founder, Chief Developer

    PHPBeginner.com (Where PHP Begins) maximphpbeginner.com www.phpbeginner.com

    -----Original Message----- From: Steve Kenshalo [mailto:SteveExit1Mile.com] Sent: Friday, February 23, 2001 9:07 AM To: php-generallists.php.net Subject: [PHP] Problems sending mail to aol with the mail() function

    Hello,

    I am working on a PHP script for an e-commerce site that mails out calling card pin numbers after somebody purchases them online. Turing testing I not noticed that aol users were not receiving the messages. AOL seems to be filtering them out without sending a bounce or anything. We tried it with multiple aol users, and nothing I tried when using the mail function got through, but messages sent from the server with pine and the php mail package SquirrelMail do get through. The messages are received on every other mail system I have tried.

    I know this is more of a mail question, but I was hoping somebody here and encountered this before and knew of a workaround. I noticed that SquirrelMail doesn't use the mail function, they chose to write their own SMPT package. I wonder why?

    Anyway, my test scripts look like this: <?php

    mail("steveexit1mile.com", "Test 1", "This is a test", "From: SteveExit1Mile.com\nReply-To: SteveExit1Mile.com\nX-Mailer: My test mail program\nX-Sender: SteveExit1Mile.com\nContent-Type: text/plain; charset=\"us-ascii\"");

    echo "Mail sent!"; ?>

    I tried playing around with different headers and nothing made any difference. I sent them to myself and they sure look like valid email messages to me. Does anybody else have this problem? What did you do about it?

    Thanks,

    Steve

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


    Yup, you need to have your key strings in quotes '', so it doesn't think it's a constant.

    ALWAYS use $array['key'] and not $array[key]

    except for the integrers

    Sincerely,

    Maxim Maletsky Founder, Chief Developer

    PHPBeginner.com (Where PHP Begins) maximphpbeginner.com www.phpbeginner.com

    -----Original Message----- From: Navid Yar [mailto:Superbus22home.com] Sent: Friday, February 23, 2001 9:11 AM To: PHP (E-mail) Subject: [PHP] Counter Help

    Can someone help me with this script? It is an example from weberdev.com. I ran it and it gave me the following error...

    -- Warning: Use of undefined constant count - assumed 'count' in c:\windows\desktop\localhost\examples\counter\counter1.php on line 27 25

    The number 25 is the correct number for the counter, but how do I get rid of that error message that keeps coming up before the counter number (25)? I am testing and learning PHP on Windows ME and am using PHP 4.0.4 with MySQL 3.23.33. Here is the script:

    <HTML> <HEAD> <TITLE></TITLE> </HEAD>

    <BODY>

    <!-- This example from http://www.weberdev.com/index.php3?GoTo=ShowShoppingItems.php3%3FMasterCateg -->

    <?php $hostname = 'localhost'; $username = 'username'; $password = 'password'; $dbName = 'database'; MYSQL_CONNECT($hostname,$username,$password) OR DIE("Unable to connect to database"); mysql_select_db("$dbName") or die("Unable to select database");

    $name = "$SCRIPT_NAME";

    $result = MYSQL_QUERY("SELECT * FROM counter WHERE (name = '$name')") or die ("Bad query: ".mysql_error()); $row = mysql_fetch_array($result);

    if($row){ MYSQL_QUERY("UPDATE counter SET count = count+1 WHERE (name = '$name')") or die ("Bad query: ".mysql_error()); $count = $row[count]; }else{ MYSQL_QUERY("INSERT INTO counter VALUES ('', '$name', '2')") or die ("Bad query: ".mysql_error()); $count = '1'; } echo $count; ?>

    </BODY> </HTML>

    -- Navid

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


    Yeah, this is very silly thing using arrays without quotes,

    I once had this problem - learned it - and sticked to using quotes whenever is not an integrer.

    advising to everyone,

    Maxim Maletsky Founder, Chief Developer

    PHPBeginner.com (Where PHP Begins) maximphpbeginner.com www.phpbeginner.com

    -----Original Message----- From: Simon Garner [mailto:sgarnerexpio.co.nz] Sent: Friday, February 23, 2001 1:32 PM To: php-generallists.php.net Subject: Re: [PHP] Counter Help

    From: "Chris Lee" <leemediawaveonline.com>

    > change > > $row[count] > > to > > $row['count'] > > it thinks the work [count] is some kind of conastant, it doesnt know you > mean (string) 'count' >

    <rant>

    I have noticed a lot of people do not put quotes on their array indexes (e.g. VBulletin is a prime offender) - imho this is a really bad practice because your code becomes ambiguous.

    Example:

    <?php define("foo", "donkey");

    $test = array("foo"=>"orange", "bar"=>"purple");

    echo $test[foo]; ?>

    Now, I think that should print nothing (or an error), because there is no index matching "donkey" (the value of the constant "foo"). But for some reason PHP looks for an array index matching the string "foo" as well, encouraging this kind of sloppy programming.

    Regards

    Simon Garner

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


    Sounds good to me, I should, and will, always keep that in mind. Thanks for the tips. Also I want to say PHPBeginner.com is starting off very well, keep up the good work. I've been watching over it to see when the grand opening would be, and it's finally here. I hope it becomes a success someday. If I was good at PHP, I would contribute some articles, but I'm just a newbie for now. But maybe someday. Take it easy :)

    Sincerely, Navid Yar

    -----Original Message----- From: PHPBeginner.com [mailto:php-generalphpbeginner.com] Sent: Saturday, February 24, 2001 12:16 AM To: Superbus22home.com; PHP (E-mail) Subject: RE: [PHP] Counter Help

    Yup, you need to have your key strings in quotes '', so it doesn't think it's a constant.

    ALWAYS use $array['key'] and not $array[key]

    except for the integrers

    Sincerely,

    Maxim Maletsky Founder, Chief Developer

    PHPBeginner.com (Where PHP Begins) maximphpbeginner.com www.phpbeginner.com

    -----Original Message----- From: Navid Yar [mailto:Superbus22home.com] Sent: Friday, February 23, 2001 9:11 AM To: PHP (E-mail) Subject: [PHP] Counter Help

    Can someone help me with this script? It is an example from weberdev.com. I ran it and it gave me the following error...

    -- Warning: Use of undefined constant count - assumed 'count' in c:\windows\desktop\localhost\examples\counter\counter1.php on line 27 25

    The number 25 is the correct number for the counter, but how do I get rid of that error message that keeps coming up before the counter number (25)? I am testing and learning PHP on Windows ME and am using PHP 4.0.4 with MySQL 3.23.33. Here is the script:

    <HTML> <HEAD> <TITLE></TITLE> </HEAD>

    <BODY>

    <!-- This example from http://www.weberdev.com/index.php3?GoTo=ShowShoppingItems.php3%3FMasterCateg -->

    <?php $hostname = 'localhost'; $username = 'username'; $password = 'password'; $dbName = 'database'; MYSQL_CONNECT($hostname,$username,$password) OR DIE("Unable to connect to database"); mysql_select_db("$dbName") or die("Unable to select database");

    $name = "$SCRIPT_NAME";

    $result = MYSQL_QUERY("SELECT * FROM counter WHERE (name = '$name')") or die ("Bad query: ".mysql_error()); $row = mysql_fetch_array($result);

    if($row){ MYSQL_QUERY("UPDATE counter SET count = count+1 WHERE (name = '$name')") or die ("Bad query: ".mysql_error()); $count = $row[count]; }else{ MYSQL_QUERY("INSERT INTO counter VALUES ('', '$name', '2')") or die ("Bad query: ".mysql_error()); $count = '1'; } echo $count; ?>

    </BODY> </HTML>

    -- Navid

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


    Thanks, I still remember your reply on my test post be in touch!

    Sincerely,

    Maxim Maletsky Founder, Chief Developer

    PHPBeginner.com (Where PHP Begins) maximphpbeginner.com www.phpbeginner.com

    -----Original Message----- From: Navid Yar [mailto:Superbus22home.com] Sent: Saturday, February 24, 2001 4:26 PM To: 'PHPBeginner.com'; 'PHP (E-mail)' Subject: RE: [PHP] Counter Help

    Sounds good to me, I should, and will, always keep that in mind. Thanks for the tips. Also I want to say PHPBeginner.com is starting off very well, keep up the good work. I've been watching over it to see when the grand opening would be, and it's finally here. I hope it becomes a success someday. If I was good at PHP, I would contribute some articles, but I'm just a newbie for now. But maybe someday. Take it easy :)

    Sincerely, Navid Yar

    -----Original Message----- From: PHPBeginner.com [mailto:php-generalphpbeginner.com] Sent: Saturday, February 24, 2001 12:16 AM To: Superbus22home.com; PHP (E-mail) Subject: RE: [PHP] Counter Help

    Yup, you need to have your key strings in quotes '', so it doesn't think it's a constant.

    ALWAYS use $array['key'] and not $array[key]

    except for the integrers

    Sincerely,

    Maxim Maletsky Founder, Chief Developer

    PHPBeginner.com (Where PHP Begins) maximphpbeginner.com www.phpbeginner.com

    -----Original Message----- From: Navid Yar [mailto:Superbus22home.com] Sent: Friday, February 23, 2001 9:11 AM To: PHP (E-mail) Subject: [PHP] Counter Help

    Can someone help me with this script? It is an example from weberdev.com. I ran it and it gave me the following error...

    -- Warning: Use of undefined constant count - assumed 'count' in c:\windows\desktop\localhost\examples\counter\counter1.php on line 27 25

    The number 25 is the correct number for the counter, but how do I get rid of that error message that keeps coming up before the counter number (25)? I am testing and learning PHP on Windows ME and am using PHP 4.0.4 with MySQL 3.23.33. Here is the script:

    <HTML> <HEAD> <TITLE></TITLE> </HEAD>

    <BODY>

    <!-- This example from http://www.weberdev.com/index.php3?GoTo=ShowShoppingItems.php3%3FMasterCateg -->

    <?php $hostname = 'localhost'; $username = 'username'; $password = 'password'; $dbName = 'database'; MYSQL_CONNECT($hostname,$username,$password) OR DIE("Unable to connect to database"); mysql_select_db("$dbName") or die("Unable to select database");

    $name = "$SCRIPT_NAME";

    $result = MYSQL_QUERY("SELECT * FROM counter WHERE (name = '$name')") or die ("Bad query: ".mysql_error()); $row = mysql_fetch_array($result);

    if($row){ MYSQL_QUERY("UPDATE counter SET count = count+1 WHERE (name = '$name')") or die ("Bad query: ".mysql_error()); $count = $row[count]; }else{ MYSQL_QUERY("INSERT INTO counter VALUES ('', '$name', '2')") or die ("Bad query: ".mysql_error()); $count = '1'; } echo $count; ?>

    </BODY> </HTML>

    -- Navid

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


    No it will give you the same value twice...

    you need a loop

    <SELECT NAME="state" SIZE="1"> <OPTION VALUE="Canberra">ACT</OPTION> <OPTION VALUE="Victoria">VIC</OPTION>

    looping the rows .,...{

    echo "<OPTION VALUE=\"".$row['state']."\">".$row['state_abbr']."</OPTION> ";

    }

    </SELECT>

    Sincerely,

    Maxim Maletsky Founder, Chief Developer

    PHPBeginner.com (Where PHP Begins) maximphpbeginner.com www.phpbeginner.com

    -----Original Message----- From: Peter Houchin [mailto:peterhvfsa.com.au] Sent: Friday, February 23, 2001 1:17 PM To: PHP MAIL GROUP Subject: [PHP] <select name=....

    if i have a form with a select box in it how an i get the values to echo a php value ...

    ie

    <SELECT NAME="state" SIZE="1"> <OPTION VALUE="Canberra">ACT</OPTION> <OPTION VALUE="Victoria">VIC</OPTION> </SELECT>

    can i change it to say <SELECT NAME="state" SIZE="1"> <OPTION VALUE="<? echo $state ?>">ACT</OPTION> <OPTION VALUE="<?echo $state ?>">VIC</OPTION> </SELECT>

    so that when the page loads it shows which ever option is in the Data base?

    Peter Houchin Sun Rentals peterhsunrentals.com.au

    attached mail follows:


    just get some examples from php.net/mail

    and pass the variables to it any way you wish - it all will work

    Sincerely,

    Maxim Maletsky Founder, Chief Developer

    PHPBeginner.com (Where PHP Begins) maximphpbeginner.com www.phpbeginner.com

    -----Original Message----- From: W.D. [mailto:suedeunoyahoo.com] Sent: Friday, February 23, 2001 2:54 PM To: php-generallists.php.net Subject: [PHP] mail prob

    I'm using a remote host, and when I call mail() with all the var's pulling values from form fields, it still shows as nobody in from header. Is this a server situation? Theyre using php4 support and they claim its that I'm not using appropriate variables in the function.

    _________________________________________________________ Do You Yahoo!? Get your free yahoo.com address at http://mail.yahoo.com

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


    You have compiled it as CGI, didn't ya?

    recompile it as apache's module if you can so apache can give PHP_SELF the right value,

    Sincerely,

    Maxim Maletsky Founder, Chief Developer

    PHPBeginner.com (Where PHP Begins) maximphpbeginner.com www.phpbeginner.com

    -----Original Message----- From: Brandon Feldhahn [mailto:BrandonFeldhahnearthlink.net] Sent: Friday, February 23, 2001 4:30 PM To: php-generallists.php.net Subject: [PHP] php_self

    Why does php self always show php4/php.exe? how do i take it off?

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


    never heard of one...

    is there any? I'm curious too...

    Sincerely,

    Maxim Maletsky Founder, Chief Developer

    PHPBeginner.com (Where PHP Begins) maximphpbeginner.com www.phpbeginner.com

    -----Original Message----- From: knaSen [mailto:knassehome.se] Sent: Friday, February 23, 2001 7:05 PM To: php-generallists.php.net Subject: [PHP] PHP / Filemaker?

    Hey

    This is my first question and mail to this list...hope u treat me decent =) My earlier work have been lasso/filemaker (mac) I´ve been heard that PHP is coming strongly and I have no reason not to join. How is the relation between PHP/Filemaker?

    ----------------------* [knaSen] icq #23830427

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


    Oh, yeah... my favorite:

    explode()!

    $var = '1,2,3,4,5,6,7,8,9,10'; $var_array = explode(',',$var);

    /* will become: $var_array[0] = '1'; $var_array[1] = '2'; $var_array[2] = '3'; $var_array[3] = '4'; ... and so on */

    as you notice the array starts from 0

    Sincerely,

    Maxim Maletsky Founder, Chief Developer

    PHPBeginner.com (Where PHP Begins) maximphpbeginner.com www.phpbeginner.com

    -----Original Message----- From: Todd Cary [mailto:toddaristesoftware.com] Sent: Friday, February 23, 2001 11:41 PM To: php-generallists.php.net Subject: [PHP] Parsing a string

    I have a comma delimited string that I need to parse into an array. Is there a PHP function that will do that ?

    Many thanks..........

    Todd

    --
    Todd Cary
    Ariste Software
    toddaristesoftware.com
    

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


    If you are developing on windows (save - refresh ie ... )

    then sure, your IP is the IP of the machine ...

    if someone connects to you from outside then the remote host won't be 127.0.0.1 .. it will be his own

    Sincerely,

    Maxim Maletsky Founder, Chief Developer

    PHPBeginner.com (Where PHP Begins) maximphpbeginner.com www.phpbeginner.com

    -----Original Message----- From: Rosen [mailto:rosen_dmdir.bg] Sent: Friday, February 23, 2001 11:54 PM To: php-generallists.php.net Subject: [PHP] Problem with $REMOTE_ADDR

    Hi, I have problem with using of "$REMOTE_ADDR" variable. The variable always return me "127.0.0.1" ( localhost ),

    How can I get the IP of the remote host ?

    Thanks, Rosen Marinov

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


    check out php.net/number-format

    Sincerely,

    Maxim Maletsky Founder, Chief Developer

    PHPBeginner.com (Where PHP Begins) maximphpbeginner.com www.phpbeginner.com

    -----Original Message----- From: MinorThreatBmxxxaol.com [mailto:MinorThreatBmxxxaol.com] Sent: Saturday, February 24, 2001 4:53 AM To: php-generallists.php.net Subject: [PHP] string question

    I have a string that contains a number such as: $string = '12345'

    I want that to read 12,345 though.  Is there any way in which I can insert a comma in there in the correct places?

    -Matt

    attached mail follows:


    Cheers!

    I've fixed that by adding some extra characters (new lines actually) in a loop... it worked...

    my conclusion was - MSIE5.01 bug ... didn't read pockets well ...

    Sincerely,

    Maxim Maletsky Founder, Chief Developer

    PHPBeginner.com (Where PHP Begins) maximphpbeginner.com www.phpbeginner.com

    -----Original Message----- From: Richard Lynch [mailto:richardzend.com] Sent: Saturday, February 24, 2001 7:26 AM To: php-generallists.php.net Subject: Re: [PHP] URGENT: IE pops-up an Error and File Download Fails. Needs to be fixed NOW. Please advise.

    Read the http://php.net/FAQ about the NULL character problem.

    I'm betting you have some funky character that confuses that browser in the output that the other browsers just ignore.

    --
    Visit the Zend Store at http://www.zend.com/store/
    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: Boaz Yahav <berbernetvision.net.il>
    Newsgroups: php.general
    Sent: Wednesday, February 21, 2001 12:59 AM
    Subject: RE: [PHP] URGENT: IE pops-up an Error and File Download Fails.
    Needs to be fixed NOW. Please advise.
    

    > What do you see in your web server logs? > what webserver do you use? > > Sincerely > > berber > > Visit http://www.weberdev.com Today!!! > To see where PHP might take you tomorrow. > > > > -----Original Message----- > From: Maxim Maletsky [mailto:maxim.maletskyjapaninc.net] > Sent: Wednesday, February 21, 2001 8:59 AM > To: 'PHP General List. (E-mail)' > Subject: [PHP] URGENT: IE pops-up an Error and File Download Fails. Needs to > be fixed NOW. Please advise. > > > Hello guys, > This is that time when I am in trouble ... > > One of our internal databases receives inputs from all kind of different > places and stores them for later reviews. > Since it's creation it was all going perfectly well, but now it has a little > problem: > > The Internet Explorer gives me this error while listing one of databases' > tables: > > (it is a pop up message of internet explorer) > ---- > Internet Explorer Cannot Open the internet site > http://that.damn.db/database.php <http://that.damn.db/database.php> > ?db=opp_post > > The download of the specified resource has filed. > ---- > > What is it, PHP or IE? I suppose something is wrong with IE (5.01 for > instance), but so far couldn't come with any solution. The output is simply > not there, source shows cuted off at the very beginning of file - after few > hundreds of bytes. > > This suggests me that one of the entries in Database is somehow corrupting > IE. But I have not found anything strange. What to look for, guys? > > I tested it on Opera and Netscape - no probs whatsoever. > I also tested it on Linux, and Mac (Opera, Netscape) - no probs whatsoever. > ...and (listen to this one)... > I tested it on Mac, MSIE 5.(01)? (just the version I have on my Win2k) -- > and It gave me no errors at all. > > Why MSIE 5.01 of Win2k gives that message and breaks download? > > I've seen this messages already while browsing the web, and that's the > reason I'm asking you: anyone had to fix that before? What are your guesses > on my problem? > > It is quite urgent since the database is not usable and I don't have much > time for researches on this issue. > The sad thing is that our office uses the exactly same configured machines > (MSIE5 - Win2k) and no one can view the database from their PCs. All the > sales and coordinators are staying here in line near my MAC while I am > writing you this. > > Any help is greatly appreciated! > > Cheers, > Maxim Maletsky > > P.S: if any friends of Bill are around the list, please forward him my happy > moments and eventual sweet words. > > Maxim Maletsky - maximj-door.com <mailto:maximj-door.com> > Webmaster, J-Door.com / Jpan Inc. > LINC Media, Inc. > TEL: 03-3499-2175 x 1271 > FAX: 03-3499-3109 > > http://www.j-door.com <http://www.j-door.com/> > http://www.japaninc.net <http://www.japaninc.net/> > http://www.lincmedia.co.jp <http://www.lincmedia.co.jp/> > > > > > > -- > 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:


    Hi,

    You can also use an RC4Encryption / Decryption class made in PHP.

    http://www.devhome.net/php/tutorials/230101.html

    it's pretty easy to use.

    --- Richard Lynch <richardzend.com> wrote: > You could use popen() to execute http://gnupg.org or > PGP... > > It would be easier to recompile PHP, though, and > performance on popen() is > going to suck. > > You *might* be able to compile just the encryption > module, and use > dl("mcrypt.so") in your PHP script to load it up > rather than recompile all > of PHP, but again, it's going to be harder, and > performance will suffer. > > Compiling PHP the *second* time is *way* easier than > the first time, > especially if you've saved your previous PHP source > tree and all the other > source trees -- There's a file in the PHP source > tree called config.status, > and some other config.* files, that "remember" what > you did last time. So, > copy those somewhere safe, and then look at them. > > You'll probably be able to copy config.status to > config.zhu, and then edit > that to add --with-mcrypt (or whatever it is), and > do: > chmod 755 config.zhu > ./config.zhu > > -- > Visit the Zend Store at http://www.zend.com/store/ > 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: Zhu George-CZZ010 <George.Z.Zhumotorola.com> > Newsgroups: php.general > Sent: Friday, February 23, 2001 11:07 AM > Subject: [PHP] encrypt and decrypt in standard PHP > > > > As the PHP manual indicates, we can use Mcrypt > to do the encrypt and > decrypt work in PHP, but that needs to download the > encrypt module and > recompile PHP. Is there any other way to encrypt > and decrypt the string in > standard PHP4.0.4 without any extension module? > > > > Thank you very much! > > > > -- > > 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 >

    ===== To find out more about me : http://www.geocities.com/mimodit My bookmarks are available http://mukul.free.fr

    __________________________________________________ Do You Yahoo!? Get email at your own domain with Yahoo! Mail. http://personal.mail.yahoo.com/

    attached mail follows:


    hi!

    I have fws simple lines:

    <?php if ($userfile) { copy($userfile, "C:\\"); } else { echo "Possible file upload attack: filename '$userfile'."; }

    ?>

    Warning: Unable to create 'C:\': Permission denied in c:\phpdev2\www\upload\action.php on line 3

    and I get this error..I tried coyping to D:\ too but the same error..

    Can u tell me what could be the problem possibly..

    Thank you Dhaval Desai

    __________________________________________________ Do You Yahoo!? Get email at your own domain with Yahoo! Mail. http://personal.mail.yahoo.com/

    attached mail follows:


    Thanks! After upgrading to the latest PHP, it's working now.

    Sebastian Stadtlich wrote: > > this one uses pipe.... > > $command=`find $verzeichnis. -iname $DateiPattern |sort -f`; > $verzeichnisliste = explode ("\n",$command); > > sebastian > > -----Ursprungliche Nachricht----- > Von: Martin Kong [mailto:mkongintisoft.com] > Gesendet: Mittwoch, 21. Februar 2001 15:45 > An: php-generallists.php.net > Betreff: [PHP] How to pipe a command output into another command > > >From within PHP, I'm trying to execute an external command and pipe (|) > the result into another command, then capture the output. I've tried > everything, exec, system, passthru, popen and backtick, and still could > get it to work. Has anyone done it before? Is it possible with PHP? > > Running PHP 4.0.1pl2 as a Apache module. > > Thanks. > > -- > 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:


    Hi!

    I have problem uploading the file to a directory... It says permission denied. THe problem is taht ther directory is on the web. I connect using WS_ftp. THe directory is set to:

    drwxr-xr-x

    How do I make it writable..?

    I am using form to upload the files there..

    Is there any way I can make the directory writable..?

    Thank You!

    Dhaval Desai

    __________________________________________________ Do You Yahoo!? Get email at your own domain with Yahoo! Mail. http://personal.mail.yahoo.com/

    attached mail follows:


    use chmod 775 dir (or 777 - but not recommended)

    Sincerely,

    Maxim Maletsky Founder, Chief Developer

    PHPBeginner.com (Where PHP Begins) maximphpbeginner.com www.phpbeginner.com

    -----Original Message----- From: Dhaval Desai [mailto:dhaval_adamsyahoo.com] Sent: Saturday, February 24, 2001 5:25 PM To: php-generallists.php.net Subject: [PHP] Change dir mode to writable for uploading..

    Hi!

    I have problem uploading the file to a directory... It says permission denied. THe problem is taht ther directory is on the web. I connect using WS_ftp. THe directory is set to:

    drwxr-xr-x

    How do I make it writable..?

    I am using form to upload the files there..

    Is there any way I can make the directory writable..?

    Thank You!

    Dhaval Desai

    __________________________________________________ Do You Yahoo!? Get email at your own domain with Yahoo! Mail. http://personal.mail.yahoo.com/

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


    Hi Dhaval, You said in your previous e-mail 'C:\'. Are you using a NT based server or Unix based? If your server is a unix based one, consider trying this command: chmod 777 /path/to/directory Warning, this is a bit dangerous and might be vulnerable, are you running your webserver with nobody? Anyone else has access to write cgi scripts on your servers? If everything's set up carefully, you can chown your directory to nobody. It will work with the current permission. Ahmad Anvari

    ----- Original Message ----- From: Dhaval Desai To: php-generallists.php.net Sent: Saturday, February 24, 2001 11:55 AM Subject: [PHP] Change dir mode to writable for uploading..

    Hi!

    I have problem uploading the file to a directory... It says permission denied. THe problem is taht ther directory is on the web. I connect using WS_ftp. THe directory is set to:

    drwxr-xr-x

    How do I make it writable..?

    I am using form to upload the files there..

    Is there any way I can make the directory writable..?

    Thank You!

    Dhaval Desai

    __________________________________________________ Do You Yahoo!? Get email at your own domain with Yahoo! Mail. http://personal.mail.yahoo.com/

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


    Hi, I'd like to do: $function = "build_result()"; $result = $$function; but it doesn't seem to work. The reason why I think I need it is that I have a generic function, but within it I have to call another function depending on who called it. I could build a switch within the generic function deciding which function to call, but tht seems less elegant, as I'd have to adjust the generic function every time a new function calls it. The build_result() function only gets called in certain cases by the generic function (if it's not cached), so I can't just put it outside fo the generic function. Any hints? Thanks! Peter ~~~~~~~~~~~~~~~~~~~~~ http://liga1.com ,a weblog on: - Localisation - Internationalisation - Globalisation - Accessibility

    attached mail follows:


    Hi, I didn't get why you haven't used this: switch $var case something: $result=$build_result(); break; case somethingelse: $result=$build2(); break; blah blah blah...

    Ahmad ----- Original Message ----- From: Peter Van Dijck To: php gen list Sent: Saturday, February 24, 2001 4:00 PM Subject: [PHP] $result = $$function

    Hi, I'd like to do: $function = "build_result()"; $result = $$function; but it doesn't seem to work. The reason why I think I need it is that I have a generic function, but within it I have to call another function depending on who called it. I could build a switch within the generic function deciding which function to call, but tht seems less elegant, as I'd have to adjust the generic function every time a new function calls it. The build_result() function only gets called in certain cases by the generic function (if it's not cached), so I can't just put it outside fo the generic function. Any hints? Thanks! Peter ~~~~~~~~~~~~~~~~~~~~~ http://liga1.com ,a weblog on: - Localisation - Internationalisation - Globalisation - Accessibility

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


    Hi all,

    anyone could show me how to split an multi-part email in mime format using imap funct? I need to take an email in html format with embedded images and store its html,text and etc. in a mysql db ....

    simple script, class, tutorial or specified howto are very welcomed

    many thanks in advance max

    attached mail follows:


    Hi! i'm working on Windows NT workstation with PWS§ Therefore header does not work ! but i want to redirect to another page! any server isde idea ? Thanks _________________________________________________________________________ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

    attached mail follows:


    HI, why don't you implement some client side script in your page for example:

    echo ("<script language=JavaScript>function Relod1(){window.location='your.php?url=default.php';}</script>") <body onLoad=Relod1()>

    Joe Njeru, Nairobi Kenya

    ""kaab kaoutar"" <kaab_khotmail.com> wrote in message news:F687mvjkO22ZhCl8aii00016c2dhotmail.com... > Hi! > i'm working on Windows NT workstation with PWS§ > Therefore header does not work ! but i want to redirect to another page! > any server isde idea ? > Thanks > _________________________________________________________________________ > Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com. > > > -- > 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:


    Hi! i have a submit button called "more" in a page that calles itself i try to check whether the page was just loaded or called by clicking on that button using : if ($more) {....echo "hi";} it never echo hi any idea ? Thanks _________________________________________________________________________ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

    attached mail follows:


    Hi Kaab, There must be another problem, it should work. Maybe it helps if you send your code here. To see how a simple script works, try this tiny script named test.php:

    <form action=test.php> <input type=submit name=more> </form> <?php if ($more) {print "<p>Submit is pressed</p>"; }; ?>

    If you first load the php page, you don't see anything rather than a submit button. If you press submit, you will see a message.

    Ahmad Anvari ----- Original Message ----- From: kaab kaoutar To: php-generallists.php.net Sent: Saturday, February 24, 2001 5:35 PM Subject: [PHP] checking $more still does not work !

    Hi! i have a submit button called "more" in a page that calles itself i try to check whether the page was just loaded or called by clicking on that button using : if ($more) {....echo "hi";} it never echo hi any idea ? Thanks _________________________________________________________________________ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

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


    Blizzard here, hows the weather there? :)

    The website I am working on has several forms, a search, and a login that can take close to a minute depending on much traffic it is recieving. I've noticed on other sites ("paypal" for instance) that when you submit it throws up a "loading..." page that goes onto the results page when it is returned.

    any ideas on how to do this?

    tks mitch

    attached mail follows:


    Here?! Sunny today! ;-) I highly suggest you use client side scripting in this case. onLoad Event handler. A load event occurs when Navigator finishes loading a window or all frames within a <FRAMESET> tag. The onLoad event handler executes JavaScript code when a load event occurs.

    Here's a sample code for your result page:

    <body onload=document.loadingimage.src='blank.gif'> ...... Some Coding Here ....... <p align=center><img src=loading.gif name=loadingimage></p> ...... The rest of coding...... </body>

    That's the snippiest piece of code. [I didn't test it, however, I'm sure that it work out] Create a loading.gif animation gif which shows a [Loading...] animation. It will be replaced by a blank gif file named blank.gif which shows a blank screen. Take care, Ahmad Anvari ----- Original Message ----- From: Mitchell Hagerty To: php-generallists.php.net Sent: Saturday, February 24, 2001 7:02 PM Subject: [PHP] status page between submit and results

    Blizzard here, hows the weather there? :)

    The website I am working on has several forms, a search, and a login that can take close to a minute depending on much traffic it is recieving. I've noticed on other sites ("paypal" for instance) that when you submit it throws up a "loading..." page that goes onto the results page when it is returned.

    any ideas on how to do this?

    tks mitch

    -- 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 have been working with mysql for a while, and now I am working with Sybase ASE. I have some stored procedures that I can run, but I would like to know how to access the result set of such a call. In mysql, the result set is just another table, and I can fetch it as a hash or object to get what I need. Using stored procedures, how would I do the same thing?

    attached mail follows:


    Is there class methods in php?

    attached mail follows:


    The variable I register before the function becomes available in the session to other pages...the variable I register inside the function are not accessible in the session to ohter pages. Is this normal? How can I work around this? Thanks! PHP4.0.4pl1 on Linux.

    sample code:

    <? session_Start();

    $foo = "bar"; session_register("foo");

    function bob($user){ $username = $user . "one"; $username2 = $user . "two"; session_register("username"); session_register("username2"); return true; } ?>

    attached mail follows:


    The code snippet below is from a file that is the post action of a login form the login form also has session_start();

    ----- Original Message ----- From: "Jon Rosenberg" <phpcolumbusinteractive.com> To: "PHP List" <php-generallists.php.net> Sent: Saturday, February 24, 2001 11:16 AM Subject: [PHP] session_register in function

    > The variable I register before the function becomes available in the session > to other pages...the variable I register inside the function are not > accessible in the session to ohter pages. Is this normal? How can I work > around this? Thanks! PHP4.0.4pl1 on Linux. > > sample code: > > <? > session_Start(); > > $foo = "bar"; > session_register("foo"); > > function bob($user){ > $username = $user . "one"; > $username2 = $user . "two"; > session_register("username"); > session_register("username2"); > return true; > } > ?> > > > -- > 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:


    Hello!

    I wonder if there are any way to display the page before the script is finished?

    I have a loop in my script,and I want to display the resoult for each loop.

    Thanks

    David :-)

    attached mail follows:


    On Sat, 24 Feb 2001, David Tandberg-Johansen wrote: > Hello! > > I wonder if there are any way to display the page before the script is > finished? > > I have a loop in my script,and I want to display the resoult for each loop. Try the REFRESH meta tag

    > > Thanks > > David :-) > > > > -- > 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

    -- 
    Kind Regards,
    ---
    Kyndig
    Online Text Game Resource Site:  http://www.kyndig.com
    ICQ# 	10451240
    

    attached mail follows:


    try using flush() ----- Original Message ----- From: "David Tandberg-Johansen" <daviddatajo.no> To: <php-generallists.php.net> Sent: Saturday, February 24, 2001 11:34 AM Subject: [PHP] DIsplaying page before script finnished

    : Hello! : : I wonder if there are any way to display the page before the script is : finished? : : I have a loop in my script,and I want to display the resoult for each loop. : : Thanks : : David :-) : : : : -- : 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