OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
php-general-digest-help_at_lists.php.net
Date: Wed Jul 24 2002 - 20:19:25 CDT

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

    php-general Digest 25 Jul 2002 01:19:25 -0000 Issue 1484

    Topics (messages 109297 through 109395):

    Re: MySQL - PHP combined log
            109297 by: Dave
            109299 by: PHPCoder

    www.php.net/docs.php
            109298 by: Francis
            109300 by: Chris Hounsell

    File upload memory usage.
            109301 by: Reid Sutherland
            109348 by: Jason Wong
            109349 by: Reid Sutherland

    ldap_connect()
            109302 by: Michael Gladden

    Re: Certificate information using php?
            109303 by: Scott Fletcher

    Re: Sessions don't work?
            109304 by: Alexander Deruwe
            109322 by: Mike Mannakee

    Re: XML vs. PHP manual???
            109305 by: Scott Fletcher

    Re: PHP Security Advisory: Vulnerability in PHP versions 4.2.0
            109306 by: Scott Fletcher
            109307 by: Scott Fletcher
            109347 by: Jason Wong
            109386 by: Rick Widmer

    When to destroy sessions that iterate
            109308 by: PHPCoder
            109312 by: Tom Rogers

    Re-directing
            109309 by: Roberts, Mark
            109310 by: B i g D o g
            109311 by: Balaji Ankem
            109314 by: Martin Clifford
            109316 by: Chris Sharkey
            109317 by: Martin Clifford

    PHP-GD and JPEG+PNG - Which versions is required?
            109313 by: Steve Alberty

    Re: Object problem
            109315 by: Tom Rogers

    Cookies
            109318 by: John S. Huggins

    Running ./configure multiple times
            109319 by: Chris Garaffa
            109320 by: Tom Rogers
            109343 by: Scott Fletcher
            109346 by: Jason Wong
            109352 by: Matt Schroebel

    Oh man!!!
            109321 by: Scott Fletcher

    PHPMyAdmin interface
            109323 by: paulson.coastnet.com
            109324 by: Brian V Bonini
            109325 by: Martin Clifford
            109326 by: Adam Voigt
            109327 by: Mark Middleton

    Help with msql_fetch_array()
            109328 by: Matthew Bielecki
            109331 by: PHPCoder
            109332 by: Kevin Stone
            109335 by: Kevin Stone
            109336 by: PHPCoder
            109338 by: Martin Clifford
            109340 by: Phillip S. Baker
            109342 by: Martin Clifford
            109345 by: Jason Wong
            109350 by: Matthew Bielecki
            109356 by: Kevin Stone

    Re: MySQL Backup and Restore
            109329 by: 1LT John W. Holmes
            109333 by: Andrew Chase
            109334 by: Martin Clifford

    Re: Inserting Processed Data from One Table 2 Another!
            109330 by: Michael Sweeney

    Hitting return in a textarea box...
            109337 by: Jesse Lawrence
            109339 by: Martin Clifford
            109341 by: Phillip S. Baker
            109390 by: Tom Rogers

    Best template class
            109344 by: Remy Dufour
            109354 by: Hans Lellelid

    Re: Windows installation help.
            109351 by: Nadrew

    socket_set_block(); - question
            109353 by: Micha

    date
            109355 by: Alexander Ross
            109369 by: Joel Colombo
            109371 by: Julio Nobrega

    Removing \ From a String?
            109357 by: skeller.healthtvchannel.org
            109358 by: 1LT John W. Holmes

    Free WEB Hosting with PHP and MySQL support
            109359 by: crimix
            109360 by: Zac Hillier
            109361 by: Wm
            109362 by: crimix

    Re: need some help on stratagy... (php/mysql/javascript)
            109363 by: Richard Lynch

    Re: Banner Ad Serving...
            109364 by: Jeff Bearer

    Trouble with \
            109365 by: skeller.healthtvchannel.org
            109367 by: Richard Baskett
            109370 by: skeller.healthtvchannel.org
            109372 by: Richard Baskett
            109373 by: Tech Support
            109375 by: skeller.healthtvchannel.org
            109376 by: skeller.healthtvchannel.org
            109384 by: Justin French

    Speeding up PHP or MySQL
            109366 by: Richard Baskett
            109368 by: Julio Nobrega

    Php and Apache
            109374 by: Varsha Agarwal

    How do I validate input using php?
            109377 by: Øystein Håland
            109378 by: JSheble

    Image upload into database
            109379 by: Jesse Lawrence
            109382 by: Tyler Longren
            109383 by: Brian V Bonini
            109385 by: Justin French

    Re: PHP 4.2.2 install woe: cannot stat libs/libphp.so
            109380 by: David Robley

    Re: create object from variable class.
            109381 by: Martin Towell

    HTTP_POST_FILES undefined - What happen?
            109387 by: Rija
            109392 by: Tom Rogers
            109394 by: Tom Rogers

    Numbers with leading zero...
            109388 by: vins
            109389 by: Martin Towell
            109391 by: Tom Rogers

    Re: Numbers with leading zero... :: THANK YOU!!
            109393 by: vins

    best way to log bad email address'
            109395 by: Justin French

    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:


    >><clipped>
    >>>>how about this curve... getting PHP to append a line to the apache log.
    >>>
    >>>How about reading the documentation?
    >>
    >>Deserved that for not being clear enough... see below.
    >
    >My apologies if I missed the word "access log" or even assumed you meant
    >"error log" when you just said "log." I shouldn't have.

    RTFM never hurt anyone :)

    >You're right, you can't do that, without opening up security more than you
    >want to.
    >
    >*ACTUALLY*...
    >
    >There *probably* is an Apache function for access logs just like the error
    >logging one that PHP is using, and you could *PROBABLY* patch PHP with some
    >dead-easy copy&paste to use it, and you could even submit that worthy patch
    >to the PHP Group. I suspect it's not there only because nobody really saw a
    >need for it.

    I've never had a use for it untill now, wanting to charge a customer for massive
    uploads via file_upload forms... transfer that is not recorded in the apache
    logs and therefor not collected for billable bandwidth (while still preserving
    IP addresses and avoiding a ipfw counting per IP). Probably a requirement with
    limited scope.

    >It's kinda icky that you'd almost have to use 4 (the next unused number) for
    >"Apache access log" with 0 being "Apache error log" and 1,2,3 being other
    >stuff between... Maybe -1 for "access log"? Ewwwww. That's not 'right'
    >either, but maybe it's 'less wrong' than 4.

    icky, I agree

    >Damn things shouldn't have been magic numbers in the first place. Should be
    >constants. Hey, while you're in there, make up some decent constant names
    >and let's migrate to them and then deprecate the magic numbers and fix it
    >right :-)

    :)

    >Another option might involve some sort of nasty named pipe stuff and
    >redirection and whatnot, and you *MIGHT* be able to have a "file" that you
    >error_log into, but it really just ends up going into the Apache log...
    >There may be some risk of corrupting your access log, however, if any
    >incredibly *HUGE* entry over-steps the atomicity threshold for file
    >appending in Linux...

    sounds like a nest of potential problems

    >Not so sure it's a Good Idea anyway to have two programs trying to write to
    >the same file at once if it can be avoided.

    thus the interim solution of having PHP write to a seperate log file, then doing
    a merge/sort during rotation time.

    Will look into it to see if something can be presented without creating more
    problems than the solution is worth.

    Cheers,

    Dave

    attached mail follows:


    Well, I think the solutions or ideas are maybe a bit too involved.
    I was hoping that the errors I am interested in were already logged by
    default to some obscure location, and I *could* if needed just go and
    scrutinize them by hand.
    But, it seems like a detailed (specially mysql) error log does not exist
    and thus cannot be scrutinized.
    Reading some of the possible solutions regarding adding error_log()
    functions to existing code leads me to believe that it could be easier
    to maybe incorporate those functions into PHP by means of a switch in
    php.ini, one could theoretically have two sets of functions, a
    mysql_query() for "normal" use that acts as we all know it, and another
    mysql_query() (yes, with the same name), that has the error_log()
    function call built into it, and the one that gets used is determined by
    the (lets call it) mysql_error_log = on in php.ini.
    This way, the entire thing will be transparent to both users and
    existing/future code.
    Granted, I have no idea how PHP is coded "behind the scenes" and if
    something like this is even possible, it's simply an idea, and hopefully
    some of the more learned people on this list will be able to comment on
    the feasability of something like that.

    Dave wrote:

    >>><clipped>
    >>>
    >>>>>how about this curve... getting PHP to append a line to the apache log.
    >>>>>
    >>>>How about reading the documentation?
    >>>>
    >>>Deserved that for not being clear enough... see below.
    >>>
    >>My apologies if I missed the word "access log" or even assumed you meant
    >>"error log" when you just said "log." I shouldn't have.
    >>
    >
    >RTFM never hurt anyone :)
    >
    >>You're right, you can't do that, without opening up security more than you
    >>want to.
    >>
    >>*ACTUALLY*...
    >>
    >>There *probably* is an Apache function for access logs just like the error
    >>logging one that PHP is using, and you could *PROBABLY* patch PHP with some
    >>dead-easy copy&paste to use it, and you could even submit that worthy patch
    >>to the PHP Group. I suspect it's not there only because nobody really saw a
    >>need for it.
    >>
    >
    >I've never had a use for it untill now, wanting to charge a customer for massive
    >uploads via file_upload forms... transfer that is not recorded in the apache
    >logs and therefor not collected for billable bandwidth (while still preserving
    >IP addresses and avoiding a ipfw counting per IP). Probably a requirement with
    >limited scope.
    >
    >>It's kinda icky that you'd almost have to use 4 (the next unused number) for
    >>"Apache access log" with 0 being "Apache error log" and 1,2,3 being other
    >>stuff between... Maybe -1 for "access log"? Ewwwww. That's not 'right'
    >>either, but maybe it's 'less wrong' than 4.
    >>
    >
    >icky, I agree
    >
    >>Damn things shouldn't have been magic numbers in the first place. Should be
    >>constants. Hey, while you're in there, make up some decent constant names
    >>and let's migrate to them and then deprecate the magic numbers and fix it
    >>right :-)
    >>
    >
    >:)
    >
    >>Another option might involve some sort of nasty named pipe stuff and
    >>redirection and whatnot, and you *MIGHT* be able to have a "file" that you
    >>error_log into, but it really just ends up going into the Apache log...
    >>There may be some risk of corrupting your access log, however, if any
    >>incredibly *HUGE* entry over-steps the atomicity threshold for file
    >>appending in Linux...
    >>
    >
    >sounds like a nest of potential problems
    >
    >>Not so sure it's a Good Idea anyway to have two programs trying to write to
    >>the same file at once if it can be avoided.
    >>
    >
    >thus the interim solution of having PHP write to a seperate log file, then doing
    >a merge/sort during rotation time.
    >
    >Will look into it to see if something can be presented without creating more
    >problems than the solution is worth.
    >
    >Cheers,
    >
    >Dave
    >
    >

    attached mail follows:


    whats the reason why www.php.net/docs.php has been down for days? why is it
    still saying this error?

    Warning: main("geoip.inc") - No such file or directory in
    /local/Web/sites/phpweb/include/prepend.inc on line 6

    Fatal error: Failed opening required 'geoip.inc'
    (include_path='.:/local/Web/sites/phpweb/include') in
    /local/Web/sites/phpweb/include/prepend.inc on line 6

    attached mail follows:


    It has been working fine for me!
    Sorry

    "Francis" <newsradnip.com> wrote in message
    news:20020724133608.89493.qmailpb1.pair.com...
    > whats the reason why www.php.net/docs.php has been down for days? why is
    it
    > still saying this error?
    >
    > Warning: main("geoip.inc") - No such file or directory in
    > /local/Web/sites/phpweb/include/prepend.inc on line 6
    >
    > Fatal error: Failed opening required 'geoip.inc'
    > (include_path='.:/local/Web/sites/phpweb/include') in
    > /local/Web/sites/phpweb/include/prepend.inc on line 6
    >
    >
    >

    attached mail follows:


    Hi,

    I'm currently locked in a battle with PHP and file uploads. I've
    searched the list to no avail. I actually found a guy with the same
    problem who ended up using perl to make this work. I'm trying to avoid
    that.

    The problem is, I'm dealing with huge POST uploads (100+ mb). And
    everytime you upload a file it stores it in RAM and then dumps the file
    to the drive. Is there any way around this? This is extremely
    dangerous. Since this customer may have multiple people uploading at
    the same time, it could result in a massive memory hit over a long
    period of time.

    Now I figured PHP would pipe the POST stream into a temporary file
    instead of holding it in RAM. This is how it should work right?

    _Any_ help would be appreciated before I have to recode this section in
    perl.

    Thank you greatly in advance! If you live close to me, drinks are on me! :)

    Take care everyone,

    -reid

    attached mail follows:


    On Wednesday 24 July 2002 21:48, Reid Sutherland wrote:
    > Hi,
    >
    > I'm currently locked in a battle with PHP and file uploads. I've
    > searched the list to no avail. I actually found a guy with the same
    > problem who ended up using perl to make this work. I'm trying to avoid
    > that.
    >
    > The problem is, I'm dealing with huge POST uploads (100+ mb). And
    > everytime you upload a file it stores it in RAM and then dumps the file
    > to the drive. Is there any way around this? This is extremely
    > dangerous. Since this customer may have multiple people uploading at
    > the same time, it could result in a massive memory hit over a long
    > period of time.
    >
    > Now I figured PHP would pipe the POST stream into a temporary file
    > instead of holding it in RAM. This is how it should work right?

    Apparently that is how it will work in a _future_ version of PHP. But for now
    it's all stuffed in RAM until the complete file is received.

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

    /* Yow! Did something bad happen or am I in a drive-in movie?? */

    attached mail follows:


    Jason Wong wrote:

    > Apparently that is how it will work in a _future_ version of PHP. But for now > it's all stuffed in RAM until the complete file is received.

    That's crazy. Maybe I don't understand enough of how PHP deals with various web servers and maybe that's why this is the way it is. But man... the way it's done is _very_ silly.

    Anyway, thanks for the update Jason.

    -reid

    attached mail follows:


    I am new to using PHP on RedHat 7.3 and am running into a problem with ldap_connect(). When I attempt to run ldap_connect, I get the error:

    Call to undefined function: ldap_connect()

    The system I am working on has the default install of Redhat 7.3 with Apache version "Apache/1.3.23". It has been suggested to me that I need to recompile either PHP and/or Apache and am still quite new to this. The PHP configure command is:

    './configure' 'i386-redhat-linux' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/usr/com' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--prefix=/usr' '--with-config-file-path=/etc' '--enable-force-cgi-redirect' '--disable-debug' '--enable-dbg=shared' '--with-dbg-profiler' '--enable-pic' '--disable-rpath' '--enable-inline-optimization' '--with-bz2' '--with-db3' '--with-curl' '--with-dom=/usr' '--with-exec-dir=/usr/bin' '--with-freetype-dir=/usr' '--with-png-dir=/usr' '--with-gd' '--enable-gd-native-ttf' '--with-ttf' '--with-gdbm' '--with-gettext' '--with-ncurses' '--with-gmp' '--with-iconv' '--with-jpeg-dir=/usr' '--with-mm' '--with-openssl' '--with-png' '--with-pspell' '--with-regex=system' '--with-xml' '--with-expat-dir=/usr' '--with-zlib' '--with-layout=GNU' '--enable-bcmath' '--enable-debugger' '--enable-exif' '--enable-ftp' '--enable-magic-quotes' '--enable-safe-mode' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-discard-path' '--enable-track-vars' '--enable-trans-sid' '--enable-yp' '--enable-wddx' '--without-oci8' '--with-imap=shared' '--with-imap-ssl' '--with-kerberos=/usr/kerberos' '--with-ldap=shared' '--with-mysql=shared,/usr' '--with-pgsql=shared' '--with-snmp=shared,/usr' '--with-snmp=shared' '--enable-ucd-snmp-hack' '--with-unixODBC=shared' '--enable-memory-limit' '--enable-bcmath' '--enable-shmop' '--enable-versioning' '--enable-calendar' '--enable-dbx' '--enable-dio' '--enable-mcal' '--enable-mbstring' '--enable-mbstr-enc-trans' '--with-apxs=/usr/sbin/apxs'

    I am sure that I will eventually figure this out, but in the interim was hoping to gain the advice of others who have previously solved this problem and/or might be able to point me in the right direction.

    Thanks -Mike Gladden

    attached mail follows:


    I will find out about the "phpinfo()". I have looked at the options in cURL and I haven't seen one that would enable it to get the certificate from the credit bureau. I will keep checking. Um, I have used cURL with the credit bureau #2 and they send the encryption packages over and all I had to do is to put it on the PHP webserver and have cURL use it. This make it possible to authenticate to the credit bureau #2. Alright, I'm going to give it a call to the credit bureau #1 to request an encryption packages. Hopefully, they won't say, "what????". :-)

    Thanks, FletchSOD

    "Richard Lynch" <richphpbootcamp.com> wrote in message news:php.general-109236news.php.net... > >I have a challenging part to this project. Let's say the PHP webserver > >establish a connection to a different website and received the ssl > >connection from there. How do I get the certificate information from that > >website and display it? I can use print_r($GLOBALS) but it only display the > >certificate from this PHP webserver. So, how do I get the certificate > >information from that website?? > > I don't really know the answer, but... > > Check the output of <?php phpinfo();?> to see if there are any leads. > > Maybe cURL has a way to request the certificate information. > > You can't get like their whole certificate, though, right? I mean, there's > definitely a part of that which is "private" like the "private" half of a > PGP key, right?... It may not be possible to access what you think you want > to access. > > -- > Like Music? http://l-i-e.com/artists.htm > I'm looking for a PRO QUALITY two-input sound card supported by Linux (any > major distro). Need to record live events (mixed already) to stereo > CD-quality. Soundcard Recommendations? > Software to handle the recording? Don't need fancy mixer stuff. Zero (0) > post-production time. Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo > audio-to-disk.

    attached mail follows:


    I'd like to post a follow-up to my previous message on this subject. Please still CC me when replying, thanks.

    New test code:

    " <?php session_start();

    if (!isset($HTTP_SESSION_VARS['counter'])) { $HTTP_SESSION_VARS['counter'] = 1; } else { $HTTP_SESSION_VARS['counter']++; } if (!isset($counter2)) { session_register('counter2'); $counter2 = 1; } else { $counter2++; }

    if (!isset($_SESSION['counter3'])) { $_SESSION['counter3'] = 1; } else { $_SESSION['counter3']++; }

    echo(sprintf("You have visited this page %d times!", $HTTP_SESSION_VARS['counter']) . "<br>"); echo(sprintf("You have visited this page %d times!", $counter2) . "<br>"); echo(sprintf("You have visited this page %d times!", $_SESSION['counter3']) . "<br>"); ?> "

    Tried these on PHP 4.0.6 (register_globals = On): - counter: doesn't work - counter1: works - counter2: doesn't work (to be expected)

    PHP 4.2.2 (register_globals = Off): None of the counters work; same when register_globals = On

    I'm really puzzled by this; could someone please point me in the right direction?

    -- 
    Alexander Deruwe
    AQS-CarControl
    

    attached mail follows:


    Your problem is very simple. You're beginning a new session every execution, without checking if a session is already going. So every time it comes back around it's looking for the variables in the current session, which every time just began.

    Check for an existing session first like:

    if(!(session_id())) session_start();

    Mike Mannakee

    "Alexander Deruwe" <aderuweaqs-carcontrol.be> wrote in message news:20020724135629.GA6905nbalexander.aqs-carcontrol.be... > I'd like to post a follow-up to my previous message on this subject. > Please still CC me when replying, thanks. > > New test code: > > " > <?php > session_start(); > > if (!isset($HTTP_SESSION_VARS['counter'])) { > $HTTP_SESSION_VARS['counter'] = 1; > } else { > $HTTP_SESSION_VARS['counter']++; > } > > if (!isset($counter2)) { > session_register('counter2'); > $counter2 = 1; > } else { > $counter2++; > } > > if (!isset($_SESSION['counter3'])) { > $_SESSION['counter3'] = 1; > } else { > $_SESSION['counter3']++; > } > > echo(sprintf("You have visited this page %d times!", $HTTP_SESSION_VARS['counter']) . "<br>"); > echo(sprintf("You have visited this page %d times!", $counter2) . "<br>"); > echo(sprintf("You have visited this page %d times!", $_SESSION['counter3']) . "<br>"); > ?> > " > > Tried these on PHP 4.0.6 (register_globals = On): > - counter: doesn't work > - counter1: works > - counter2: doesn't work (to be expected) > > PHP 4.2.2 (register_globals = Off): > None of the counters work; same when register_globals = On > > I'm really puzzled by this; could someone please point me in the right > direction? > > -- > Alexander Deruwe > AQS-CarControl

    attached mail follows:


    I alway knew there is an easier way to do that. Problem is just don't know it. I like your example and it is an wonderful example. I can use it. One quick question. The function, "posttofunction()", is that a make-believe function? I check PHP.net and it doesn't have this function, so I assume you just put it there to make a point about the whole script.

    Thanks, FletchSOD "Richard Lynch" <richphpbootcamp.com> wrote in message news:php.general-109230news.php.net... > >I read the useful document about XML in PHP on > >http://www.analysisandsolutions.com/code/phpxml.html. I still haven't made > >much progress on XML. I'm still confuse about XML. I had to write XML > >stuffs on the client-side with the build-in XML request and it doesn't make > >sense that the client brower should be communicating to credit bureau > >network without going to my company's PHP webserver to that credit bureau. > >So, it meant I have to use the post request that would send the data to my > >company's PHP webserver and somehow convert it into xml and send it to that > >credit bureau by cURL. Is there a way to do that?? > > As I recall, only the DOM model can easily add/alter "nodes" to an XML > document. SAX would be not useful... (Or was it the other way around...?) > > Anyway, you may be trying too hard :-) > > Unless your credit bureau is incredibly different from all the rest, it will > *PROBABLY* be easiest to just do something not unlike: > > <?php > # import expected $_POST variables if register_globals is off. > $xml = <<<ENDOFXML > <XML> > <NAME>$name</NAME> > <ADDRESS>$address</ADDRESS> > . > . > . > </XML> > ENDOFXML; > $result = posttohost('http://yourcreditbureau.com', $xml); > ?> > > I mean, really, do you want to make life all complicated by trying to create > some giant XML data structure when all you really need is one stupid little > never-changing string with the data in it? > > If you're building a complex application to *TRADE* tons of info with your > credit bureau, you'd want to "scale up" and generalize your XML-creation > with complex data structures so you can easily alter it when they change the > DTD out from under you or whatever. > > But if you are just sending the one kind of XML request off to the credit > bureau, don't make your life complicated for no real reason. > > Just my opinion. > > -- > Like Music? http://l-i-e.com/artists.htm > I'm looking for a PRO QUALITY two-input sound card supported by Linux (any > major distro). Need to record live events (mixed already) to stereo > CD-quality. Soundcard Recommendations? > Software to handle the recording? Don't need fancy mixer stuff. Zero (0) > post-production time. Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo > audio-to-disk.

    attached mail follows:


    Doing that right now! Just like a basic upgrade.

    Thanks, FletchSOD

    "Matt Schroebel" <MSchroebelhsus.org> wrote in message news:4B08FD7DB3CBD4119F560002A508C453015B38DAhsus3... > > From: Scott Fletcher [mailto:scottabcoa.com] > > Sent: Tuesday, July 23, 2002 12:43 PM > > To: php-generallists.php.net > > Subject: Re: [PHP] Re: PHP Security Advisory: Vulnerability > > in PHP versions 4.2.0 > > > > > > I don't know how to appy patches to the PHP software. I just finish > > upgrading the website to work with PHP 4.2.1 from PHP 4.0.6. And now > > this.... So, just patched it then configure openssl, > > mycrypt, curl, modssl > > then do the usual stuff for PHP then apache, right?? > > Rebuilding from source: > 1. download the new php source, extract it to whereever you do. > 2. cd to php-4.2.2 copy config.nice from your existing php compile dir (this has your previous complies config command). > 3. Run it: > ./config.nice > 4. make > 5. apachectl stop > 6. make install > 7a. i. If php is a DSO: > ii. apachectl start (you're done) > 7b. i. If php is compiled into apache: > ii. cd to apache compile dir > iii. make clean > iv. ./config.status > v. make > vi. make install > vii. apachectl start (you're done)

    attached mail follows:


    It work very nicely!!!! The whole process take 30 to 45 minutes for just one server. I wonder how does someone did 12 computers in 10 minutes. Cool!

    "Matt Schroebel" <MSchroebelhsus.org> wrote in message news:4B08FD7DB3CBD4119F560002A508C453015B38DAhsus3... > > From: Scott Fletcher [mailto:scottabcoa.com] > > Sent: Tuesday, July 23, 2002 12:43 PM > > To: php-generallists.php.net > > Subject: Re: [PHP] Re: PHP Security Advisory: Vulnerability > > in PHP versions 4.2.0 > > > > > > I don't know how to appy patches to the PHP software. I just finish > > upgrading the website to work with PHP 4.2.1 from PHP 4.0.6. And now > > this.... So, just patched it then configure openssl, > > mycrypt, curl, modssl > > then do the usual stuff for PHP then apache, right?? > > Rebuilding from source: > 1. download the new php source, extract it to whereever you do. > 2. cd to php-4.2.2 copy config.nice from your existing php compile dir (this has your previous complies config command). > 3. Run it: > ./config.nice > 4. make > 5. apachectl stop > 6. make install > 7a. i. If php is a DSO: > ii. apachectl start (you're done) > 7b. i. If php is compiled into apache: > ii. cd to apache compile dir > iii. make clean > iv. ./config.status > v. make > vi. make install > vii. apachectl start (you're done)

    attached mail follows:


    On Wednesday 24 July 2002 22:22, Scott Fletcher wrote: > It work very nicely!!!! The whole process take 30 to 45 minutes for just > one server.

    You've got a slow computer and/or you type too slow ;-)

    > I wonder how does someone did 12 computers in 10 minutes. > Cool!

    For me it was a case of 'typing' in 6 commands:

    1) download php 2) untar it 3) cd 4) configure 5) make 6) make install

    Actually I just copy and pasted those commands which took me all of 5 seconds to do. So unless you count the download and compilation time, 12 systems in 10 minutes is in the ballpark.

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

    /* Yow! I just went below the poverty line! */

    attached mail follows:


    At 10:22 AM 7/24/02 -0400, Scott Fletcher wrote: >It work very nicely!!!! The whole process take 30 to 45 minutes for just >one server. I wonder how does someone did 12 computers in 10 minutes. >Cool!

    For me the key to upgrading many servers is to compile once then copy the resulting files to all my other servers. I also compile Apache + mod_ssl + PHP static into one file so usually all I have to do is copy the httpd file to the other machines.

    The machines need similar CPUs and identical library versions, but that isn't too hard to do. With Linux it is legal to copy in the new httpd file then apachectl restart to update the server.

    Rick

    attached mail follows:


    Prolly a silly question, but I have a session process that never really ends as it is supposed to allow the user to carry on submitting etc.

    So I don't know where and when to end the session, and if it is really nescessary to end a session?

    Obviously a logout button will do the trick, but what about aborting users that don't bother to logout? I presume a session will have a timeout value? If so, how does this work? Surely there can't be a physical time allowed for a session to stay alive? What about if I want to have an intranet application that could ( and preferably should) be able to be open indefinately?

    Ta

    attached mail follows:


    Hi,

    Thursday, July 25, 2002, 12:20:47 AM, you wrote: P> Prolly a silly question, but I have a session process that never really P> ends as it is supposed to allow the user to carry on submitting etc.

    P> So I don't know where and when to end the session, and if it is really P> nescessary to end a session?

    P> Obviously a logout button will do the trick, but what about aborting P> users that don't bother to logout? I presume a session will have a P> timeout value? If so, how does this work? Surely there can't be a P> physical time allowed for a session to stay alive? What about if I want P> to have an intranet application that could ( and preferably should) be P> able to be open indefinately?

    P> Ta

    Just checkout the session section of the manual and you will find you can set the timeout to what you want.

    -- 
    Best regards,
    Tom
    

    attached mail follows:


    Is there a way to redirect to a different script in PHP? I call it redirecting, but can't find it in the documentation using that track.

    I have a script...that if a certain criteria is met, I want to load a different script. Haven't been able to figure that out yet. I have gotten about it by conditionally executing a location.href in javascript. It works, but would like to know how to do it in PHP.

    ~Thanks.

    Mark Roberts Sr. Systems Analyst LanApps/Web Development The Williams Information Services Corporation 918-573-1706 mark.robertswilliams.com

    attached mail follows:


    Check under header() in the docs...

    .: B i g D o g :.

    ----- Original Message ----- From: "Roberts, Mark" <Mark.Robertswilliams.com> To: "PHP Mailing list (E-mail)" <php-generallists.php.net> Sent: Wednesday, July 24, 2002 8:28 AM Subject: [PHP] Re-directing

    > Is there a way to redirect to a different script in PHP? I call it > redirecting, but can't find it in the documentation using that track. > > I have a script...that if a certain criteria is met, I want to load a > different script. Haven't been able to figure that out yet. I have gotten > about it by conditionally executing a location.href in javascript. It works, > but would like to know how to do it in PHP. > > ~Thanks. > > Mark Roberts > Sr. Systems Analyst > LanApps/Web Development > The Williams Information Services Corporation > 918-573-1706 > mark.robertswilliams.com > > >

    attached mail follows:


    Use header() function..

    Header('Location: script name');

    Best Regards Balaji

    -----Original Message----- From: Roberts, Mark [mailto:Mark.Robertswilliams.com] Sent: Wednesday, July 24, 2002 7:58 PM To: PHP Mailing list (E-mail) Subject: [PHP] Re-directing

    Is there a way to redirect to a different script in PHP? I call it redirecting, but can't find it in the documentation using that track.

    I have a script...that if a certain criteria is met, I want to load a different script. Haven't been able to figure that out yet. I have gotten about it by conditionally executing a location.href in javascript. It works, but would like to know how to do it in PHP.

    ~Thanks.

    Mark Roberts Sr. Systems Analyst LanApps/Web Development The Williams Information Services Corporation 918-573-1706 mark.robertswilliams.com


    attached mail follows:


    PHP redirects using the header() function, but it's not very useful if information has already been sent to the browser. ANY information, including a hard return. So if you have a login script, you would start your session, register any variables, then redirect.

    <?php header("Location: index.php"); ?>

    That would do the trick. But like I said, once the parser begins to write HTML to the browser, then you can no longer send HTTP headers.

    Martin Clifford Homepage: http://www.completesource.net Developer's Forums: http://www.completesource.net/forums/

    >>> "Roberts, Mark" <Mark.Robertswilliams.com> 07/24/02 10:28AM >>> Is there a way to redirect to a different script in PHP? I call it redirecting, but can't find it in the documentation using that track.

    I have a script...that if a certain criteria is met, I want to load a different script. Haven't been able to figure that out yet. I have gotten about it by conditionally executing a location.href in javascript. It works, but would like to know how to do it in PHP.

    ~Thanks.

    Mark Roberts Sr. Systems Analyst LanApps/Web Development The Williams Information Services Corporation 918-573-1706 mark.robertswilliams.com

    attached mail follows:


    Well you can actually,

    If you start your script IMMEDIATELY (well before you output anything) with:

    <?php ob_start();

    This will buffer output so you can use your header anywhere in your script

    eg header("location.php"); exit;

    and then if you weren't redirected then you send the output with

    ob_end_flush();

    Chris.

    ----- Original Message ----- From: "Martin Clifford" <MLC1nrc.gov> To: <php-generallists.php.net>; <Mark.Robertswilliams.com> Sent: Thursday, July 25, 2002 12:47 AM Subject: Re: [PHP] Re-directing

    PHP redirects using the header() function, but it's not very useful if information has already been sent to the browser. ANY information, including a hard return. So if you have a login script, you would start your session, register any variables, then redirect.

    <?php header("Location: index.php"); ?>

    That would do the trick. But like I said, once the parser begins to write HTML to the browser, then you can no longer send HTTP headers.

    Martin Clifford Homepage: http://www.completesource.net Developer's Forums: http://www.completesource.net/forums/

    >>> "Roberts, Mark" <Mark.Robertswilliams.com> 07/24/02 10:28AM >>> Is there a way to redirect to a different script in PHP? I call it redirecting, but can't find it in the documentation using that track.

    I have a script...that if a certain criteria is met, I want to load a different script. Haven't been able to figure that out yet. I have gotten about it by conditionally executing a location.href in javascript. It works, but would like to know how to do it in PHP.

    ~Thanks.

    Mark Roberts Sr. Systems Analyst LanApps/Web Development The Williams Information Services Corporation 918-573-1706 mark.robertswilliams.com

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

    attached mail follows:


    Awesome! Learn something new everyday!

    That's why I love this list :o)

    Martin Clifford Homepage: http://www.completesource.net Developer's Forums: http://www.completesource.net/forums/

    >>> "Chris Sharkey" <csharkeyozstays.com> 07/24/02 11:01AM >>> Well you can actually,

    If you start your script IMMEDIATELY (well before you output anything) with:

    <?php ob_start();

    This will buffer output so you can use your header anywhere in your script

    eg header("location.php"); exit;

    and then if you weren't redirected then you send the output with

    ob_end_flush();

    Chris.

    ----- Original Message ----- From: "Martin Clifford" <MLC1nrc.gov> To: <php-generallists.php.net>; <Mark.Robertswilliams.com> Sent: Thursday, July 25, 2002 12:47 AM Subject: Re: [PHP] Re-directing

    PHP redirects using the header() function, but it's not very useful if information has already been sent to the browser. ANY information, including a hard return. So if you have a login script, you would start your session, register any variables, then redirect.

    <?php header("Location: index.php"); ?>

    That would do the trick. But like I said, once the parser begins to write HTML to the browser, then you can no longer send HTTP headers.

    Martin Clifford Homepage: http://www.completesource.net Developer's Forums: http://www.completesource.net/forums/

    >>> "Roberts, Mark" <Mark.Robertswilliams.com> 07/24/02 10:28AM >>> Is there a way to redirect to a different script in PHP? I call it redirecting, but can't find it in the documentation using that track.

    I have a script...that if a certain criteria is met, I want to load a different script. Haven't been able to figure that out yet. I have gotten about it by conditionally executing a location.href in javascript. It works, but would like to know how to do it in PHP.

    ~Thanks.

    Mark Roberts Sr. Systems Analyst LanApps/Web Development The Williams Information Services Corporation 918-573-1706 mark.robertswilliams.com

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

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

    attached mail follows:


    Hi,

    which version of libpng and libjpeg is needed to use the bundled libgd in the current php tree.

    I using libpng 1.2.3 and php crashes with a segfault

    and with libjpeg62 (6b Mandrake RPM) in apache logs:

    gd-jpeg: JPEG library reports unrecoverable error: JPEG parameter struct mismatch: library thinks size is 372, caller expects 376

    Hmmm, maybe the bundled gd has more bugs as the 'normal' 2.0.1 (Beta) Version?!

    Regards,

    Steve

    attached mail follows:


    Hi,

    Wednesday, July 24, 2002, 5:04:06 AM, you wrote: MD> I just wrote this message in the wrong list so i'll be short...

    MD> I have two classes: MD> - mysql_connection MD> - data_collection

    MD> data_collection REQUIRES a mysql_connection object to work. So i decided to MD> pass this object in the constructor for the data_collection, but when i do MD> so it seems it creates a copy of this object and doesn't use the object i MD> had previously created...

    MD> I tried to do function data_collection(&$mysql_server){ MD> ... MD> }

    MD> But even the & sign like they say to use on the php.net web site doesn't MD> work, it creates a copy of the object. The only way i found to bypass this MD> problem is to do:

    my_collection->>mysql_server = &$mysql_server;

    MD> which will assign a reference of the mysql_collection object to my MD> collection, but this means i need to modify something like 45 files of my MD> web site and also i have to add some init settings because they where done MD> in the constructor where you needed the connection...

    MD> please help me out!!!

    MD> InsaneCoder

    what I do is to create a global array of class objects to provide inter class communication.

    class a { var $test; function a(){ global $class; $class['a'] =& $this; $this->test = 'Opened'; } } class b { function b(){ global $class; echo 'Class a value = '.$class['a']->test.'<br>'; } }

    $a = new a(); $b = new b();

    -- 
    Best regards,
    Tom
    

    attached mail follows:


    Say it is not so.

    I hear the PHP 4.2.2 will only set the last cookie delivered by a browser to a variable in the PHP environment.

    Is this true?

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

    John Huggins VANet

    jhugginsva.net http://www.va.net/

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

    attached mail follows:


    Well my RedHat system got hosed, so I reinstalled everything. I'm back to installing PHP now, and I'm wondering if it's safe for me to run ./configure multiple times. Here's the situation: I want to compile with gd support, and pdflib, and a bunch of other options. Instead of running a whole huge 5 line ./configure, can I run one at a time to make sure they all work, then run the whole thing? Also, just noticed this: I have gd installed, and libgd.so in /usr/lib, so I tried ./configure --with-apxs --with-gd=/usr/lib/ (also tried without the trailing /), but it gives: configure: error: Unable to find libgd.(a|so) anywhere under /usr/lib/ What gives? (in this ouptut, the stuff that's not important is cut out -- dates, etc) [rootsaturn php-4.2.2]# ls -l /usr/lib/libgd.* lrwxrwxrwx Š /usr/lib/libgd.so -> libgd.so.1.8.3 lrwxrwxrwx Š /usr/lib/libgd.so.1 -> libgd.so.1.8.3 lrwxrwxrwx Š /usr/lib/libgd.so.1.8 -> libgd.so.1.8.3 lrwxrwxrwx Š /usr/lib/libgd.so.1.8.3 [rootsaturn php-4.2.2]#

    TIA, c.

    attached mail follows:


    Hi,

    Thursday, July 25, 2002, 1:41:25 AM, you wrote: CG> Well my RedHat system got hosed, so I reinstalled everything. I'm back to CG> installing PHP now, and I'm wondering if it's safe for me to run ./configure CG> multiple times. Here's the situation: CG> I want to compile with gd support, and pdflib, and a bunch of other options. CG> Instead of running a whole huge 5 line ./configure, can I run one at a time CG> to make sure they all work, then run the whole thing? CG> Also, just noticed this: I have gd installed, and libgd.so in /usr/lib, so I CG> tried ./configure --with-apxs --with-gd=/usr/lib/ (also tried without the CG> trailing /), but it gives: configure: error: Unable to find libgd.(a|so) CG> anywhere under /usr/lib/ CG> What gives? CG> (in this ouptut, the stuff that's not important is cut out -- dates, etc) CG> [rootsaturn php-4.2.2]# ls -l /usr/lib/libgd.* CG> lrwxrwxrwx Š /usr/lib/libgd.so -> libgd.so.1.8.3 CG> lrwxrwxrwx Š /usr/lib/libgd.so.1 -> libgd.so.1.8.3 CG> lrwxrwxrwx Š /usr/lib/libgd.so.1.8 -> libgd.so.1.8.3 CG> lrwxrwxrwx Š /usr/lib/libgd.so.1.8.3 CG> [rootsaturn php-4.2.2]#

    CG> TIA, CG> c.

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

    it may be looking for libgd.a in the gd directory do a make libgd.a then copy it to /usr/lib

    -- 
    Best regards,
    Tom
    

    attached mail follows:


    Yes, it is pretty safe to run ./configure more than once. The 1st time, it create the config.cache and so on. The 2nd time, it use the config.cache and other stuffs instead of starting from scratch. To redo everything from scratch. I believe one of those config.* files need to be removed so you can start again from scratch, not sure which files that need to be delete. But don't delete the original file, config or configure.

    Second of all, the list you provided to me. I noticed it is a link file, not a source file because of hte L before rwx. The first three links that point to the 4th file. The fouth file is a link that aren't pointed to anything, so it meant it is a link without a file. That may be why you got the error.

    FletchSOD

    "Tom Rogers" <trogerskwikin.com> wrote in message news:11627330869.20020725015636kwikin.com... > Hi, > > Thursday, July 25, 2002, 1:41:25 AM, you wrote: > CG> Well my RedHat system got hosed, so I reinstalled everything. I'm back to > CG> installing PHP now, and I'm wondering if it's safe for me to run ./configure > CG> multiple times. Here's the situation: > CG> I want to compile with gd support, and pdflib, and a bunch of other options. > CG> Instead of running a whole huge 5 line ./configure, can I run one at a time > CG> to make sure they all work, then run the whole thing? > CG> Also, just noticed this: I have gd installed, and libgd.so in /usr/lib, so I > CG> tried ./configure --with-apxs --with-gd=/usr/lib/ (also tried without the > CG> trailing /), but it gives: configure: error: Unable to find libgd.(a|so) > CG> anywhere under /usr/lib/ > CG> What gives? > CG> (in this ouptut, the stuff that's not important is cut out -- dates, etc) > CG> [rootsaturn php-4.2.2]# ls -l /usr/lib/libgd.* > CG> lrwxrwxrwx S /usr/lib/libgd.so -> libgd.so.1.8.3 > CG> lrwxrwxrwx S /usr/lib/libgd.so.1 -> libgd.so.1.8.3 > CG> lrwxrwxrwx S /usr/lib/libgd.so.1.8 -> libgd.so.1.8.3 > CG> lrwxrwxrwx S /usr/lib/libgd.so.1.8.3 > CG> [rootsaturn php-4.2.2]# > > CG> TIA, > CG> c. > > > CG> -- > CG> PHP General Mailing List (http://www.php.net/) > CG> To unsubscribe, visit: http://www.php.net/unsub.php > > > it may be looking for libgd.a in the gd directory do a make libgd.a > then copy it to /usr/lib > > -- > Best regards, > Tom >

    attached mail follows:


    On Wednesday 24 July 2002 23:41, Chris Garaffa wrote: > Well my RedHat system got hosed, so I reinstalled everything. I'm back to > installing PHP now, and I'm wondering if it's safe for me to run > ./configure multiple times. Here's the situation: > I want to compile with gd support, and pdflib, and a bunch of other > options. Instead of running a whole huge 5 line ./configure, can I run one > at a time to make sure they all work, then run the whole thing? > Also, just noticed this: I have gd installed, and libgd.so in /usr/lib, so > I tried ./configure --with-apxs --with-gd=/usr/lib/ (also tried without the > trailing /), but it gives: configure: error: Unable to find libgd.(a|so) > anywhere under /usr/lib/ > What gives?

    Use: --with-gd=/usr

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

    /* There can be no daily democracy without daily citizenship. -- Ralph Nader */

    attached mail follows:


    > From: Scott Fletcher [mailto:scottabcoa.com] > Sent: Wednesday, July 24, 2002 2:53 PM > Subject: Re: [PHP] Running ./configure multiple times > > Yes, it is pretty safe to run ./configure more than once. > The 1st time, it > create the config.cache and so on. The 2nd time, it use the > config.cache > and other stuffs instead of starting from scratch. To redo > everything from scratch. I believe one of those config.* files need to be > removed so you can start again from scratch, not sure which files that need > to be delete.

    I always rm config.cache before rebuilding with new options so the configure script will pick up the right libraries and new options.

    attached mail follows:


    I now understand why I'm having trouble communicating with the credit bureau. I did sucessfully get through to them the first time, unfortunately, I was able to get through, through security breach at the credit bureau. The credit bureau there was not design to work with cURL, so the encryption and other stuffs doesn't work. The bad thing is I had sucessfully made it through at 5 different places. I want to thank you all for your best, your help and support on why I have difficultiles with XML and PHP. I'm still learning. :-)

    Thanks, FletchSOD

    attached mail follows:


    I have just recently just signed up for virtual hosting with a MySQL database. They do not have a PHPMyAdmin interface too access the database. All they have given me is my username and password and the server too login too. They suggested that I install PHPMyAdmin on my workstation and access my database that way. Is there major security risks too my database doing this? Is this normal, where service providers request that I install PHPMyAdmin on my workstation or should I be looking for a new internet service provider who supplies the interface on the server?

    attached mail follows:


    Why don't you just install a copy on the server? If the only access you have is through the mysql monitor program then you must have shell access so installing your own copy of phpMyAdmin should not be an issue.

    But, if your going to access it remotely from a win machine I would use MySQL-Front instead.

    -B ------ > -----Original Message----- > From: paulsoncoastnet.com [mailto:paulsoncoastnet.com] > Sent: Wednesday, July 24, 2002 12:47 PM > To: php-generallists.php.net > Subject: [PHP] PHPMyAdmin interface > > > I have just recently just signed up for virtual hosting with a MySQL > database. They do not have a PHPMyAdmin interface too access the > database. All they have given me is my username and password and the > server too login too. They suggested that I install PHPMyAdmin on my > workstation and access my database that way. > Is there major security risks too my database doing this? Is this normal, > where service providers request that I install PHPMyAdmin on my > workstation or should I be looking for a new internet service provider who > supplies the interface on the server? > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >

    attached mail follows:


    It's not normal that I've come across. Any hosting company I've ever dealt with (albeit not many, still three different ones), have all offered phpMyAdmin for interfacing with MySQL. And honestly, if the host REQUIRES you to do it, then they aren't worth hosting with. You'll find that will transcend into other areas of how they do business (i.e. technical support tickets, etc).

    Currently I'm hosting with http://www.websytz.com, and they have good prices. Another of my sites is on http://www.dzones.com, and they're very good as well.

    WebSytz' control panel flat out sucks, but it's usable. DZones has an incredible control panel, but they just didn't have the price I wanted for my current website. There's plenty out there, and since you pay monthly, you lose nothing by switching to another company. The choice is yours.

    BTW, I hadn't intended this to become a chapter, but it did... sorry for the length :o)

    Martin Clifford Homepage: http://www.completesource.net Developer's Forums: http://www.completesource.net/forums/

    >>> <paulsoncoastnet.com> 07/24/02 12:46PM >>> I have just recently just signed up for virtual hosting with a MySQL database. They do not have a PHPMyAdmin interface too access the database. All they have given me is my username and password and the server too login too. They suggested that I install PHPMyAdmin on my workstation and access my database that way. Is there major security risks too my database doing this? Is this normal, where service providers request that I install PHPMyAdmin on my workstation or should I be looking for a new internet service provider who supplies the interface on the server?

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

    attached mail follows:


    PHPMyAdmin must be run a server, or alteast a workstation with PHP's MySQL extension installed on it, so are you sure he didn't mean, install PHPMyAdmin yourself on there server (the one with the account your paying for), in like your webdirectory (which is incredibly easy and simple to do)?

    Adam Voigt adam.voigtcryptocomm.com

    On Wed, 2002-07-24 at 12:46, paulsoncoastnet.com wrote: > I have just recently just signed up for virtual hosting with a MySQL > database. They do not have a PHPMyAdmin interface too access the > database. All they have given me is my username and password and the > server too login too. They suggested that I install PHPMyAdmin on my > workstation and access my database that way. > Is there major security risks too my database doing this? Is this normal, > where service providers request that I install PHPMyAdmin on my > workstation or should I be looking for a new internet service provider who > supplies the interface on the server? > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    When they say, "install it on your workstation" are you sure they mean your desktop computer? phpMyAdmin is not a normal install on your desktop (unless you run a server with PHP and MySQL on your desktop, which you may do)

    It's very straight-forward to install phpMyAdmin on your web site. And yes, there are severe security implications to consider. You should protect the phpMyAdmin install with either an .htaccess file, or using the "authentication method" to "http" of phpMyAdmin (I'm not sure that's exactly what it's called... but it's close)

    If you leave the install of phpMyAdmin unprotected, your database is completely vulnerable.

    Does this help? -Mark

    > I have just recently just signed up for virtual hosting with a MySQL > database. They do not have a PHPMyAdmin interface too access the > database. All they have given me is my username and password and the > server too login too. They suggested that I install PHPMyAdmin on my > workstation and access my database that way. > Is there major security risks too my database doing this? Is this normal, > where service providers request that I install PHPMyAdmin on my > workstation or should I be looking for a new internet service provider who > supplies the interface on the server? >

    attached mail follows:


    I have a couple of scripts that fail with the error of: Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in...

    I'm new to both SQL and PHP and I'm wondering if I have some setting turned off or what.

    Here's the piece of code that is failing (the second line fails):

    $result = mysql_db_query($dbname, "SELECT * FROM tablename ORDER BY id"); $row = mysql_fetch_array($result);

    Thanks for your help in advance!!

    attached mail follows:


    Message-ID: <3D3EE902.7040700vsa.co.za> Date: Wed, 24 Jul 2002 19:50:58 +0200 From: PHPCoder <internetvsa.co.za> MIME-Version: 1.0 To: Matthew Bielecki <Matthew.Bieleckihobartcorp.com> CC: php-general <php-generallists.php.net> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP] Help with msql_fetch_array()

    I can almost guarantee that it's not the second line that is "failing", the problem here is that $result is not containing naything, and that is normally due to the fact that you are not connecting to the db, or the table "tablename" is not there.

    I use the following format as my "standard" MySQL connect and query snippet:

    $link = mysql_connect("localhost",$username,$password) or die ('Could not connect!'); // suppresses the default error message generated by this function and the "or die()" bit kills the script right then and there should it not be able to connect. mysql_select_db("YOUR_DB_NAME",$link); $sql = "select * from your_table_name"; if ( $result = mysql_query($sql)) { // checks to see if $result contains anything before it even tries to fetch an associative array from it. $row = mysql_fetch_assoc($result); } else { echo "Empty result set!";

    Note also that I use mysql_fetch_assoc and NOT mysql_fecth_array, as 9 out of 10 times, you don't need the array element id's that is returned by mysql_fetch_array.

    Matthew Bielecki wrote:

    >I have a couple of scripts that fail with the error of: >Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result >resource in... > >I'm new to both SQL and PHP and I'm wondering if I have some setting >turned off or what. > >Here's the piece of code that is failing (the second line fails): > >$result = mysql_db_query($dbname, "SELECT * FROM tablename ORDER BY id"); > $row = mysql_fetch_array($result); > > >Thanks for your help in advance!! >

    attached mail follows:


    Try using mysql_query(); instead of mysql_db_query(); The SQL query is the first parameter in this function. The second parameter is a pointer connecting to the mysql server. The pointer is generated by mysql_connect() and you'll also need to select the database with mysql_select_db(). But it's the standard way..

    $db = mysql_connect("localhost", "username", "password"); // connect to mysql server mysql_select_db("mytable", $db); // select database by name $query = "SELECT * FROM mytable ORDER BY id"; // define query to submit $result = mysql_query($query, $db); // submit query if (mysql_num_rows($result) > 0) // skip if no rows were found { while ($row = mysql_fetch_array($result)) { // .. do whtever.. } } mysql_close($db);

    It's also a common practice to put the first couple of lines in a file to include() back into your main script so that you can protect your useranme and password.

    Good luck. -Kevin

    ----- Original Message ----- From: "Matthew Bielecki" <Matthew.Bieleckihobartcorp.com> To: <php-generallists.php.net> Sent: Wednesday, July 24, 2002 10:34 AM Subject: [PHP] Help with msql_fetch_array()

    > I have a couple of scripts that fail with the error of: > Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result > resource in... > > I'm new to both SQL and PHP and I'm wondering if I have some setting > turned off or what. > > Here's the piece of code that is failing (the second line fails): > > $result = mysql_db_query($dbname, "SELECT * FROM tablename ORDER BY id"); > $row = mysql_fetch_array($result); > > > Thanks for your help in advance!!

    attached mail follows:


    You beat me too the punch and I think you explained it better than me, but just one minor little thing to note. Where you said..

    "if ( $result = mysql_query($sql)) "

    This is not a valid way to check if the query has returned anything. mysql_query() returns FALSE on error. So if there was no error but there also wasn't anything returned then the object stored in $result wiill more than likely evaluate to TRUE. For the determining factor you should count the number of rows with mysql_num_rows($result). If the returned value is zero then you know it hasn't returned anything.

    -Kevin

    ----- Original Message ----- From: "PHPCoder" <internetvsa.co.za> To: "Matthew Bielecki" <Matthew.Bieleckihobartcorp.com> Cc: "php-general" <php-generallists.php.net> Sent: Wednesday, July 24, 2002 11:50 AM Subject: Re: [PHP] Help with msql_fetch_array()

    > I can almost guarantee that it's not the second line that is "failing", > the problem here is that $result is not containing naything, and that is > normally due to the fact that you are not connecting to the db, or the > table "tablename" is not there. > > I use the following format as my "standard" MySQL connect and query snippet: > > $link = mysql_connect("localhost",$username,$password) or die ('Could > not connect!'); // suppresses the default error message generated by > this function and the "or die()" bit kills the script right then and > there should it not be able to connect. > mysql_select_db("YOUR_DB_NAME",$link); > $sql = "select * from your_table_name"; > if ( $result = mysql_query($sql)) { // checks to see if $result > contains anything before it even tries to fetch an associative array > from it. > $row = mysql_fetch_assoc($result); > } else { > echo "Empty result set!"; > > Note also that I use mysql_fetch_assoc and NOT mysql_fecth_array, as 9 > out of 10 times, you don't need the array element id's that is returned > by mysql_fetch_array. > > Matthew Bielecki wrote: > > >I have a couple of scripts that fail with the error of: > >Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result > >resource in... > > > >I'm new to both SQL and PHP and I'm wondering if I have some setting > >turned off or what. > > > >Here's the piece of code that is failing (the second line fails): > > > >$result = mysql_db_query($dbname, "SELECT * FROM tablename ORDER BY id"); > > $row = mysql_fetch_array($result); > > > > > >Thanks for your help in advance!! > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    Yes, what on earth was I thinking! should be: ... $result = mysql_query($sql); if (mysql_num_rows($result)) { $row = mysql_fetch_assoc($result); } else { echo "whatever"; } ...

    Kevin Stone wrote:

    >You beat me too the punch and I think you explained it better than me, but >just one minor little thing to note. Where you said.. > >"if ( $result = mysql_query($sql)) " > >This is not a valid way to check if the query has returned anything. >mysql_query() returns FALSE on error. So if there was no error but there >also wasn't anything returned then the object stored in $result wiill more >than likely evaluate to TRUE. For the determining factor you should count >the number of rows with mysql_num_rows($result). If the returned value is >zero then you know it hasn't returned anything. > >-Kevin > >----- Original Message ----- >From: "PHPCoder" <internetvsa.co.za> >To: "Matthew Bielecki" <Matthew.Bieleckihobartcorp.com> >Cc: "php-general" <php-generallists.php.net> >Sent: Wednesday, July 24, 2002 11:50 AM >Subject: Re: [PHP] Help with msql_fetch_array() > > >>I can almost guarantee that it's not the second line that is "failing", >>the problem here is that $result is not containing naything, and that is >>normally due to the fact that you are not connecting to the db, or the >>table "tablename" is not there. >> >>I use the following format as my "standard" MySQL connect and query >> >snippet: > >>$link = mysql_connect("localhost",$username,$password) or die ('Could >>not connect!'); // suppresses the default error message generated by >>this function and the "or die()" bit kills the script right then and >>there should it not be able to connect. >> mysql_select_db("YOUR_DB_NAME",$link); >> $sql = "select * from your_table_name"; >> if ( $result = mysql_query($sql)) { // checks to see if $result >>contains anything before it even tries to fetch an associative array >>from it. >> $row = mysql_fetch_assoc($result); >> } else { >> echo "Empty result set!"; >> >>Note also that I use mysql_fetch_assoc and NOT mysql_fecth_array, as 9 >>out of 10 times, you don't need the array element id's that is returned >>by mysql_fetch_array. >> >>Matthew Bielecki wrote: >> >>>I have a couple of scripts that fail with the error of: >>>Warning: mysql_fetch_array(): supplied argument is not a valid MySQL >>> >result > >>>resource in... >>> >>>I'm new to both SQL and PHP and I'm wondering if I have some setting >>>turned off or what. >>> >>>Here's the piece of code that is failing (the second line fails): >>> >>>$result = mysql_db_query($dbname, "SELECT * FROM tablename ORDER BY id"); >>> $row = mysql_fetch_array($result); >>> >>> >>>Thanks for your help in advance!! >>> >> >> >>-- >>PHP General Mailing List (http://www.php.net/) >>To unsubscribe, visit: http://www.php.net/unsub.php >> > >

    attached mail follows:


    Shouldn't it be:

    $result = mysql_query($sql, $link_id);

    PHP will be quick to tell you that there is a missing link identifier in the mysql_query() call. It's happened to me plenty of times. HTH!

    Martin Clifford Homepage: http://www.completesource.net Developer's Forums: http://www.completesource.net/forums/

    >>> PHPCoder <internetvsa.co.za> 07/24/02 02:16PM >>> Yes, what on earth was I thinking! should be: ... $result = mysql_query($sql); if (mysql_num_rows($result)) { $row = mysql_fetch_assoc($result); } else { echo "whatever"; } ...

    Kevin Stone wrote:

    >You beat me too the punch and I think you explained it better than me, but >just one minor little thing to note. Where you said.. > >"if ( $result = mysql_query($sql)) " > >This is not a valid way to check if the query has returned anything. >mysql_query() returns FALSE on error. So if there was no error but there >also wasn't anything returned then the object stored in $result wiill more >than likely evaluate to TRUE. For the determining factor you should count >the number of rows with mysql_num_rows($result). If the returned value is >zero then you know it hasn't returned anything. > >-Kevin > >----- Original Message ----- >From: "PHPCoder" <internetvsa.co.za> >To: "Matthew Bielecki" <Matthew.Bieleckihobartcorp.com> >Cc: "php-general" <php-generallists.php.net> >Sent: Wednesday, July 24, 2002 11:50 AM >Subject: Re: [PHP] Help with msql_fetch_array() > > >>I can almost guarantee that it's not the second line that is "failing", >>the problem here is that $result is not containing naything, and that is >>normally due to the fact that you are not connecting to the db, or the >>table "tablename" is not there. >> >>I use the following format as my "standard" MySQL connect and query >> >snippet: > >>$link = mysql_connect("localhost",$username,$password) or die ('Could >>not connect!'); // suppresses the default error message generated by >>this function and the "or die()" bit kills the script right then and >>there should it not be able to connect. >> mysql_select_db("YOUR_DB_NAME",$link); >> $sql = "select * from your_table_name"; >> if ( $result = mysql_query($sql)) { // checks to see if $result >>contains anything before it even tries to fetch an associative array >>from it. >> $row = mysql_fetch_assoc($result); >> } else { >> echo "Empty result set!"; >> >>Note also that I use mysql_fetch_assoc and NOT mysql_fecth_array, as 9 >>out of 10 times, you don't need the array element id's that is returned >>by mysql_fetch_array. >> >>Matthew Bielecki wrote: >> >>>I have a couple of scripts that fail with the error of: >>>Warning: mysql_fetch_array(): supplied argument is not a valid MySQL >>> >result > >>>resource in... >>> >>>I'm new to both SQL and PHP and I'm wondering if I have some setting >>>turned off or what. >>> >>>Here's the piece of code that is failing (the second line fails): >>> >>>$result = mysql_db_query($dbname, "SELECT * FROM tablename ORDER BY id"); >>> $row = mysql_fetch_array($result); >>> >>> >>>Thanks for your help in advance!! >>> >> >> >>-- >>PHP General Mailing List (http://www.php.net/) >>To unsubscribe, visit: http://www.php.net/unsub.php >> > >

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

    attached mail follows:


    At 11:26 AM 7/24/2002 Wednesday, Martin Clifford wrote: >Shouldn't it be: > >$result = mysql_query($sql, $link_id);

    Actually mysql_query should default to the last database connection opened if no link identifier has been specified. So the link identifier to not absolutely required.

    Phillip

    attached mail follows:


    It is on whatever installation my host is running :o) I know it's 4.x, though I should really make them upgrade.

    >>> "Phillip S. Baker" <phillipfreewolf.net> 07/24/02 02:34PM >>> At 11:26 AM 7/24/2002 Wednesday, Martin Clifford wrote: >Shouldn't it be: > >$result = mysql_query($sql, $link_id);

    Actually mysql_query should default to the last database connection opened if no link identifier has been specified. So the link identifier to not absolutely required.

    Phillip

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

    attached mail follows:


    On Thursday 25 July 2002 00:34, Matthew Bielecki wrote: > I have a couple of scripts that fail with the error of: > Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result > resource in... > > I'm new to both SQL and PHP and I'm wondering if I have some setting > turned off or what. > > Here's the piece of code that is failing (the second line fails): > > $result = mysql_db_query($dbname, "SELECT * FROM tablename ORDER BY id"); > $row = mysql_fetch_array($result);

    It's a very good idea to add some error checking code it'll save you a lot of grief. See examples in manual for details.

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

    /* "Nine years of ballet, asshole." -- Shelly Long, to the bad guy after making a jump over a gorge that he couldn't quite, in "Outrageous Fortune" */

    attached mail follows:


    Well I think you were correct about not connecting to the db, but I don't understand why. I wrote another little script just to test the connection.

    <?php

    $link = mysql_connect("servername","username","password") or die("Couldn't make connection."); $diditwork = mysql_select_db("news", $link);

    if ($diditwork <> FALSE) { echo "got the db..yeahhhh!"; echo $link; } else { echo "didnt get db...booooo"; echo $link; } ?>

    This returns "didnt get db...booooooResource id #1

    I don't understand how I can get a resource ID but then not be able to use the "news" database. Like I described earlier, this happens with my other db as well. I can connect to the db through the console or any other client I have on the physical server and do whatever I want with the db's, I'm just having problems with php.

    Thanks again for your help!!

    PHPCoder <internetvsa.co.za> 07/24/02 01:50 PM

    To: Matthew Bielecki <Matthew.Bieleckihobartcorp.com> cc: php-general <php-generallists.php.net> Subject: Re: [PHP] Help with msql_fetch_array()

    I can almost guarantee that it's not the second line that is "failing", the problem here is that $result is not containing naything, and that is normally due to the fact that you are not connecting to the db, or the table "tablename" is not there.

    I use the following format as my "standard" MySQL connect and query snippet:

    $link = mysql_connect("localhost",$username,$password) or die ('Could not connect!'); // suppresses the default error message generated by this function and the "or die()" bit kills the script right then and there should it not be able to connect. mysql_select_db("YOUR_DB_NAME",$link); $sql = "select * from your_table_name"; if ( $result = mysql_query($sql)) { // checks to see if $result contains anything before it even tries to fetch an associative array from it. $row = mysql_fetch_assoc($result); } else { echo "Empty result set!";

    Note also that I use mysql_fetch_assoc and NOT mysql_fecth_array, as 9 out of 10 times, you don't need the array element id's that is returned by mysql_fetch_array.

    Matthew Bielecki wrote:

    >I have a couple of scripts that fail with the error of: >Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result >resource in... > >I'm new to both SQL and PHP and I'm wondering if I have some setting >turned off or what. > >Here's the piece of code that is failing (the second line fails): > >$result = mysql_db_query($dbname, "SELECT * FROM tablename ORDER BY id"); > $row = mysql_fetch_array($result); > > >Thanks for your help in advance!! >

    attached mail follows:


    Message-ID: <014501c23352$321e0c00$6501a8c0kevin> From: "Kevin Stone" <kevinhelpelf.com> To: "php-general" <php-generallists.php.net> Date: Wed, 24 Jul 2002 14:39:18 -0600 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Subject: Re: [PHP] Help with msql_fetch_array()

    That should definitely be working. Only thing I can think of is that you're database name isn't correct. You're certain "news" is the full name of the database.. I mean it's not "news_com" or something like that? The $link must be valid becuase the script isn't ending with "Couldn't make connection". So that just leaves the mysql_select_db() function. And the only thing that will make that function return FALSE is if it can't find the database name for that user on the specified server. -Kevin

    ----- Original Message ----- From: "Matthew Bielecki" <Matthew.Bieleckihobartcorp.com> To: "PHPCoder" <internetvsa.co.za>; <kevinhelpelf.com> Cc: "php-general" <php-generallists.php.net> Sent: Wednesday, July 24, 2002 2:07 PM Subject: Re: [PHP] Help with msql_fetch_array()

    > Well I think you were correct about not connecting to the db, but I don't > understand why. I wrote another little script just to test the > connection. > > <?php > > $link = mysql_connect("servername","username","password") > or die("Couldn't make connection."); > $diditwork = mysql_select_db("news", $link); > > if ($diditwork <> FALSE) > { > echo "got the db..yeahhhh!"; > echo $link; > } > else > { > echo "didnt get db...booooo"; > echo $link; > } > ?> > > This returns "didnt get db...booooooResource id #1 > > I don't understand how I can get a resource ID but then not be able to use > the "news" database. Like I described earlier, this happens with my other > db as well. I can connect to the db through the console or any other > client I have on the physical server and do whatever I want with the db's, > I'm just having problems with php. > > Thanks again for your help!! > > > > > > > > > > PHPCoder <internetvsa.co.za> > 07/24/02 01:50 PM > > > To: Matthew Bielecki <Matthew.Bieleckihobartcorp.com> > cc: php-general <php-generallists.php.net> > Subject: Re: [PHP] Help with msql_fetch_array() > > > I can almost guarantee that it's not the second line that is "failing", > the problem here is that $result is not containing naything, and that is > normally due to the fact that you are not connecting to the db, or the > table "tablename" is not there. > > I use the following format as my "standard" MySQL connect and query > snippet: > > $link = mysql_connect("localhost",$username,$password) or die ('Could > not connect!'); // suppresses the default error message generated by > this function and the "or die()" bit kills the script right then and > there should it not be able to connect. > mysql_select_db("YOUR_DB_NAME",$link); > $sql = "select * from your_table_name"; > if ( $result = mysql_query($sql)) { // checks to see if $result > contains anything before it even tries to fetch an associative array > from it. > $row = mysql_fetch_assoc($result); > } else { > echo "Empty result set!"; > > Note also that I use mysql_fetch_assoc and NOT mysql_fecth_array, as 9 > out of 10 times, you don't need the array element id's that is returned > by mysql_fetch_array. > > Matthew Bielecki wrote: > > >I have a couple of scripts that fail with the error of: > >Warning: mysql_fetch_array(): supplied argument is not a valid MySQL > result > >resource in... > > > >I'm new to both SQL and PHP and I'm wondering if I have some setting > >turned off or what. > > > >Here's the piece of code that is failing (the second line fails): > > > >$result = mysql_db_query($dbname, "SELECT * FROM tablename ORDER BY id"); > > $row = mysql_fetch_array($result); > > > > > >Thanks for your help in advance!! > > > > > > >

    attached mail follows:


    I've never had any luck using PHPMyAdmin for dumping databases. They always time out over the 30 second limit. I know if it was my installation, I could fix it, but these are usually with hosting companies, where that's the only access they provide. It's very much a pain in the butt...

    ---John Holmes...

    ----- Original Message ----- From: "Justin French" <justinindent.com.au> To: "Peter" <phpvfsa.com.au>; "kip" <kenny_iphotmail.com>; <php-generallists.php.net> Sent: Tuesday, July 23, 2002 11:29 PM Subject: Re: [PHP] MySQL Backup and Restore

    > Can highly recommend doing it (and a whole lot more) with phpMyAdmin > (http://phpMyAdmin.net) > > Justin French > > > > > on 24/07/02 1:04 PM, Peter (phpvfsa.com.au) wrote: > > > grab ur self a copy of myphpadmin or use mysqldump or just simply make a > > copy of the data dir or grab ur self a copy of mysql_front > > > >> -----Original Message----- > >> From: kip [mailto:kenny_iphotmail.com] > >> Sent: Wednesday, 24 July 2002 12:58 PM > >> To: php-generallists.php.net > >> Subject: [PHP] MySQL Backup and Restore > >> > >> > >> Hi, > >> > >> Can you tell me the steps of backup and restore the databases in Mysql? > >> > >> And can i specific a path for the backup file? > >> > >> Futhermore, i have installed the MySQL in Win2000 but i don't know how to > >> restore the database of MySQL from a Linux server to Win2000 MySQL. > >> > >> Thanks > >> > >> > >> > >> -- > >> PHP General Mailing List (http://www.php.net/) > >> To unsubscribe, visit: http://www.php.net/unsub.php > >> > >> > >> > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    I encountered that same timeout problem once, and I wound up just installing my own copy of PhpMyAdmin in an .htaccess protected directory on the server, and extending the time limit there. It only took about 10 minutes to set up, and as an added bonus it was a more recent version of PhpMyAdmin than the one the host provided. :)

    -Andy

    > -----Original Message----- > From: 1LT John W. Holmes [mailto:holmes072000charter.net] > > I've never had any luck using PHPMyAdmin for dumping databases. > They always > time out over the 30 second limit. I know if it was my > installation, I could > fix it, but these are usually with hosting companies, where > that's the only > access they provide. It's very much a pain in the butt...

    attached mail follows:


    With phpMyAdmin, just scroll down until you see the dumping section. Select the appropriate information, tick the "save as file" box, then "Go". It'll prompt you to save the file. You just use that file, then, as a query to your next database.

    Martin

    >>> "1LT John W. Holmes" <holmes072000charter.net> 07/24/02 01:38PM >>> I've never had any luck using PHPMyAdmin for dumping databases. They always time out over the 30 second limit. I know if it was my installation, I could fix it, but these are usually with hosting companies, where that's the only access they provide. It's very much a pain in the butt...

    ---John Holmes...

    ----- Original Message ----- From: "Justin French" <justinindent.com.au> To: "Peter" <phpvfsa.com.au>; "kip" <kenny_iphotmail.com>; <php-generallists.php.net> Sent: Tuesday, July 23, 2002 11:29 PM Subject: Re: [PHP] MySQL Backup and Restore

    > Can highly recommend doing it (and a whole lot more) with phpMyAdmin > (http://phpMyAdmin.net) > > Justin French > > > > > on 24/07/02 1:04 PM, Peter (phpvfsa.com.au) wrote: > > > grab ur self a copy of myphpadmin or use mysqldump or just simply make a > > copy of the data dir or grab ur self a copy of mysql_front > > > >> -----Original Message----- > >> From: kip [mailto:kenny_iphotmail.com] > >> Sent: Wednesday, 24 July 2002 12:58 PM > >> To: php-generallists.php.net > >> Subject: [PHP] MySQL Backup and Restore > >> > >> > >> Hi, > >> > >> Can you tell me the steps of backup and restore the databases in Mysql? > >> > >> And can i specific a path for the backup file? > >> > >> Futhermore, i have installed the MySQL in Win2000 but i don't know how to > >> restore the database of MySQL from a Linux server to Win2000 MySQL. > >> > >> Thanks > >> > >> > >> > >> -- > >> PHP General Mailing List (http://www.php.net/) > >> To unsubscribe, visit: http://www.php.net/unsub.php > >> > >> > >> > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

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

    attached mail follows:


    You might want to consider a slightly different approach - that being to use your php code to generate a delimited file of your data and use either mysqlimport from the command line if you can, or the LOAD DATA INFILE sql statement to load the file into your database. That's going to be a lot faster than running 13000 queries through your php script.

    ..mike..

    On Wed, 2002-07-24 at 00:01, Thomas Edison Jr. wrote: > Ok i have simple issue, i'm stuck at one point. > > I have a table "Clientdetails" which contains > ClientID. > I have created another table "Authentication" with 2 > fields, "ClientID" and "Password". > > I want to pick up the ClientID from table > "Clientdetails" and insert "ClientID" and a Password i > have generated using a code, into "Authentication". > > So if there are 13000 ClientID's in "Clientdetails", > as, many rows with the ClientID & it's corresponding > password should be Inserted into table > "Authentication". > > I'm using the following code which i know is wrong, > what would be correct? > > <? > $db = mysql_connect("localhost","user","pwd"); > mysql_select_db("myDB",$db); > > $result = mysql_query("SELECT * FROM > clientdetails",$db); > if ($myrow = mysql_fetch_array($result)) { > do { > > $some = $myrow[clientid] > $newid = eregi_replace('100', '', $myrow[clientid]); > $date = date("dn"); > $stuff = $newid.def.$date; > > $sql = "INSERT INTO authentication > VALUES('$some','$stuff')"; > $result = mysql_query($sql); > echo "All Done!"; > > } while ($myrow = mysql_fetch_array($result)); > } > > ?> >

    attached mail follows:


    I'm putting together a message board, and I'm having problems with hitting the return(enter) key within my textarea.

    I've looked around for a solution, I tried wrap="hard", wrap="soft" and wrap="vitual" and none of them worked (should they? I may have done it wrong?) and I also tried nohardbreaks and nosoftbreaks, but I think they may be no longer supported.

    Is this a case for regex? If so, can someone perhaps point me to an article on how to accomplish this? Thanks very much for any help.

    Jesse

    ______________________________________________________________________ Post your ad for free now! http://personals.yahoo.ca

    attached mail follows:


    I've never had a problem with this. Even using a textbox with only the required parameters works fine as far as hitting the return key to get a newline. If you're talking about hitting the return key to submit, that's something else entirely, hehe.

    Martin Clifford Homepage: http://www.completesource.net Developer's Forums: http://www.completesource.net/forums/

    >>> Jesse Lawrence <lawrence_jesseyahoo.ca> 07/24/02 02:26PM >>> I'm putting together a message board, and I'm having problems with hitting the return(enter) key within my textarea.

    I've looked around for a solution, I tried wrap="hard", wrap="soft" and wrap="vitual" and none of them worked (should they? I may have done it wrong?) and I also tried nohardbreaks and nosoftbreaks, but I think they may be no longer supported.

    Is this a case for regex? If so, can someone perhaps point me to an article on how to accomplish this? Thanks very much for any help.

    Jesse

    ______________________________________________________________________ Post your ad for free now! http://personals.yahoo.ca

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

    attached mail follows:


    At 11:26 AM 7/24/2002 Wednesday, Jesse Lawrence wrote: >I'm putting together a message board, and I'm having >problems with hitting the return(enter) key within my >textarea. > >I've looked around for a solution, I tried >wrap="hard", wrap="soft" and wrap="vitual" and none of >them worked (should they? I may have done it wrong?) >and I also tried nohardbreaks and nosoftbreaks, but I >think they may be no longer supported. > >Is this a case for regex? If so, can someone perhaps >point me to an article on how to accomplish this? >Thanks very much for any help. > >Jesse

    What problem specifically are you having? Not clear on what issue you are having?

    Displaying the carriage returns?

    if you use nl2br($textarea_input) function then this will convert all carriage returns to <BR> tags to properly display HTML. Is that what you are looking for?

    Phillip

    attached mail follows:


    Hi,

    Thursday, July 25, 2002, 4:26:15 AM, you wrote: JL> I'm putting together a message board, and I'm having JL> problems with hitting the return(enter) key within my JL> textarea.

    JL> I've looked around for a solution, I tried JL> wrap="hard", wrap="soft" and wrap="vitual" and none of JL> them worked (should they? I may have done it wrong?) JL> and I also tried nohardbreaks and nosoftbreaks, but I JL> think they may be no longer supported.

    JL> Is this a case for regex? If so, can someone perhaps JL> point me to an article on how to accomplish this? JL> Thanks very much for any help.

    JL> Jesse

    JL> ______________________________________________________________________ JL> Post your ad for free now! http://personals.yahoo.ca

    I use wrap="soft" in the textarea input and then to display I use nl2br(htmlentities($content));

    -- 
    Best regards,
    Tom
    

    attached mail follows:


    Hi, Im currently working with phplib template and im wondering if PEAR template class can give me more... Anyone got an idea ?

    Rémy

    attached mail follows:


    From: Hans Lellelid <hansforumone.com> To: Remy Dufour <rdufourpropage.com> Cc: php-generallists.php.net Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Date: 24 Jul 2002 16:31:51 -0400 Message-Id: <1027542711.6163.124.camellavoro.xmpl.org> Mime-Version: 1.0 Subject: Re: [PHP] Best template class

    I would recommend Smarty (http://smarty.php.net). Smarty is unique (?) in that it compiles templates into PHP code -- making it one of the faster templating engines out there.

    I use Smarty & love it.

    Cheers, Hans

    On Wed, 2002-07-24 at 15:02, Remy Dufour wrote: > Hi, > Im currently working with phplib template and im wondering if PEAR template class can give me more... > Anyone got an idea ? > > Rémy

    attached mail follows:


    (This was from an email sent to Gabor, and the site said this address was for help)

    >This is not a definition of the $blah variable. $blah = 1; would be a definition.

    I've never had any problems using just $blah; before, it never errored on me once, is there any reason it does this? (by the way the version I use on Nadrew.com is 4.2.1 and it works fine.) -Nadrew

    attached mail follows:


    To: php-windowslists.php.net, php-generallists.php.net Message-ID: <3D3F0BAC.263D4009raydan.de> Date: Wed, 24 Jul 2002 22:18:52 +0200 From: Micha <armageddonraydan.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: socket_set_block(); - question

    Hi,

    I found the function socket_set_block(); in ext/sockets/sockets.c (the function is not documented) and I tried to use it but it seems to doesn't take effect... Why doesn't this function work ? Am I doing something wrong ?

    Here is my code:

    function sockRead($length = 1) { socket_set_block($this->IcqSocket); return socket_read($this->IcqSocket, $length, PHP_BINARY_READ); socket_set_nonblock($this->IcqSocket); }

    attached mail follows:


    I have a column in one of my mysql tables which holds the date & time that the record was inserted. When I run a query later on I want to display the date, but if the date is today or yesterday I want to display "today" or "yesterday" instead .. how do i compare to stored date with todays date? todays date -1? Thanks

    attached mail follows:


    i use seconds in place of time alot. using the PHP time() function and Date() functions u can do a lot.

    instead of a time / date TIMESTAMP field type i use an INT type i then call the $the_time = Time(); and insert that. then u can manipulate the hell outta that INT value from the DB with php's Date() function.

    allows u to compare lengths between times and perform much simplier numeric math on the values rather then the 'calender' math. somethings can be trickier like Leaps and stuff, but i found more pors for most of my application needs.

    Same data sizes : INT or TIMESTAMP in mysql are 4 bytes and they both give u down to the second.

    then to find out today, u just run Date('m-d-Y'); compare those vals to Date('m-d-Y', $DB_VALUE);

    there u go.... it is today or it isnt ! out put data accordingly.

    Joel

    "Alexander Ross" <alexrossbleen.net> wrote in message news:20020724203928.45708.qmailpb1.pair.com... > I have a column in one of my mysql tables which holds the date & time that > the record was inserted. When I run a query later on I want to display the > date, but if the date is today or yesterday I want to display "today" or > "yesterday" instead .. how do i compare to stored date with todays date? > todays date -1? Thanks > >

    attached mail follows:


    I am not sure it works, since isn't tested, but here we go. It's pure Mysql, and it would be probaly easier, faster, and more readable to do with PHP mixed. But where's the fun of it? ;-)

    date_field is the name of your date column.

    $sql = "SELECT IF(DAYOFMONTH(date_field) = DAYOFMONTH(CURRENT_DATE), 'Today', IF (date_field = DATE_SUB(date_field, INTERVAL 1 DAYS), 'Yesterday', date_field)) FROM table"....

    If the date isn't today or yesterday, you will get the date_field contents.

    --
    Julio Nobrega
    Pode acessar:
    http://www.inerciasensorial.com.br
    

    "Alexander Ross" <alexrossbleen.net> escreveu na mensagem news:20020724203928.45708.qmailpb1.pair.com... > I have a column in one of my mysql tables which holds the date & time that > the record was inserted. When I run a query later on I want to display the > date, but if the date is today or yesterday I want to display "today" or > "yesterday" instead .. how do i compare to stored date with todays date? > todays date -1? Thanks > >

    attached mail follows:


    I'm trying to remove all \'s from a string before printing it, but strtr still treats it as an escape character. How do I remove them? Anyone?

    --
    The Health TV Channel, Inc.
    (a non - profit organization)
    3820 Lake Otis Pkwy.
    Anchorage, AK 99508
    907.770.6200 ext.220
    907.336.6205 (fax)
    Web: www.healthtvchannel.org
    

    attached mail follows:


    RTM. stripslashes()

    ---John Holmes...

    ----- Original Message ----- From: <skellerhealthtvchannel.org> To: <php-generallists.php.net> Sent: Wednesday, July 24, 2002 5:21 PM Subject: [PHP] Removing \ From a String?

    > I'm trying to remove all \'s from a string before printing it, but strtr > still treats it as an escape character. How do I remove them? Anyone? > > -- > The Health TV Channel, Inc. > (a non - profit organization) > 3820 Lake Otis Pkwy. > Anchorage, AK 99508 > 907.770.6200 ext.220 > 907.336.6205 (fax) > Web: www.healthtvchannel.org > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    Unfortunatelly I changed my ADLS setting from IP static to IP dynamic and now nobody, me too, can access to my data. My question is if exist a Free WEB Server where I can place my data using PHP and MySQL support? Thank you and have a nice day

    Tiziano Crimella - Switzerland

    attached mail follows:


    easyDNS.com provide a dynamic dns solution to your problem

    Zac

    ----- Original Message ----- From: "crimix" <t.crimellaticino.com> To: <php-generallists.php.net> Sent: Wednesday, July 24, 2002 10:03 PM Subject: [PHP] Free WEB Hosting with PHP and MySQL support

    > Unfortunatelly I changed my ADLS setting from IP static to IP dynamic > and now nobody, me too, can access to my data. > My question is if exist a Free WEB Server where I can place my data > using PHP and MySQL support? > Thank you and have a nice day > > Tiziano Crimella - Switzerland > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >

    attached mail follows:


    If you want to continue to host it yourself, and simply want a stable address, try this: http://www.dynip.com/. I've used it for FTP serving before, and it works very well.

    Wm

    "Crimix" <t.crimellaticino.com> wrote in message news:3D3F1639.5060008ticino.com... > Unfortunatelly I changed my ADLS setting from IP static to IP dynamic > and now nobody, me too, can access to my data. > My question is if exist a Free WEB Server where I can place my data > using PHP and MySQL support? > Thank you and have a nice day > > Tiziano Crimella - Switzerland >

    attached mail follows:


    As I written to zac, I tried avoid this problem with Dns2Go but the Client application send the Ip of my router and not that of my computer.

    Tiz

    Wm wrote: > If you want to continue to host it yourself, and simply want a stable > address, try this: http://www.dynip.com/. I've used it for FTP serving > before, and it works very well. > > Wm > > "Crimix" <t.crimellaticino.com> wrote in message > news:3D3F1639.5060008ticino.com... > >>Unfortunatelly I changed my ADLS setting from IP static to IP dynamic >>and now nobody, me too, can access to my data. >>My question is if exist a Free WEB Server where I can place my data >>using PHP and MySQL support? >>Thank you and have a nice day >> >>Tiziano Crimella - Switzerland >> > > >

    attached mail follows:


    >..and how poor would the performance be if there were 813 shots in the >movie? Thanks for your help

    How fast/big is the surfer's computer?

    It's the work on THEIR side that matters.

    PHP can spew out 813 shots pretty quickly.

    For that matter, if the movie itself is static, you can use PHP to just prepare the 813 shots "off-line" and paste it in.

    How fast will JavaScript handle the 813-element array is entirely up to the browser/JavaScript computer, not your web-server or PHP.

    -- 
    Like Music?  http://l-i-e.com/artists.htm
    I'm looking for a PRO QUALITY two-input sound card supported by Linux (any
    major distro).  Need to record live events (mixed already) to stereo
    CD-quality.  Soundcard Recommendations?
    Software to handle the recording? Don't need fancy mixer stuff.  Zero (0)
    post-production time.  Just raw PCM/WAV/AIFF 16+ bit, 44.1KHz, Stereo
    audio-to-disk.
    

    attached mail follows:


    You can also checkout OASIS

    http://oasis.sourceforge.net/

    It's pretty good software, but i'm unable to use it here because it doesn't have as man features as OAS from RealMedia which my manager is used to.

    http://www.realmedia.com

    It's expensive and doesn't really integrate into PHP. but it's very indepth.

    On Tue, 2002-07-23 at 23:47, Dave at Sinewaves.net wrote: > Is there any way of automatically adding a certain bit of code to every page > on a web server (or within a given directory)? > > As in, is there any kind of Apache-specific PHP stuff that will add a banner > ad or copyright notice to pages (without editing the actual pages themselves > and without changing their file names)? I've looked around a bit, and I > can't seem to brainstorm how it could be done. > > Any help will be greatly appreciated (with good karma to boot). :) > > Dave > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    -- 
    Jeff Bearer, RHCE
    Webmaster, PittsburghLIVE.com
    2002 EPpy Award Winner, Best Newspaper Website
    

    attached mail follows:


    Anyway, with asides to the snooty "RTFM" reply I got, I thought I'd share.

    Turns out the \'s that I was having problems getting rid of were written there from a form post that was used to collect the data. I still haven't found a way to remove them after reading them from the file, but I did manage to change them before they were posted by doing a strtr.

    If someone has a way to clearn \'s out of a string brought in from a file, I'm all ears, but it's working now.

    --
    The Health TV Channel, Inc.
    (a non - profit organization)
    3820 Lake Otis Pkwy.
    Anchorage, AK 99508
    907.770.6200 ext.220
    907.336.6205 (fax)
    Web: www.healthtvchannel.org
    

    attached mail follows:


    Try this function:

    http://www.php.net/manual/en/function.stripslashes.php

    Rick

    "And God shall wipe away all tears from their eyes; and there shall be no more death, neither sorrow, nor crying, neither shall there be any more pain: for the former things are passed away." - Revelation 21:4

    > From: <skellerhealthtvchannel.org> > Date: Wed, 24 Jul 2002 14:30:08 -0800 > To: "PHP List \(E-mail\)" <php-generallists.php.net> > Subject: [PHP] Trouble with \ > > Anyway, with asides to the snooty "RTFM" reply I got, I thought I'd share. > > Turns out the \'s that I was having problems getting rid of were written > there from a form post that was used to collect the data. I still haven't > found a way to remove them after reading them from the file, but I did > manage to change them before they were posted by doing a strtr. > > If someone has a way to clearn \'s out of a string brought in from a file, > I'm all ears, but it's working now. > > > > -- > The Health TV Channel, Inc. > (a non - profit organization) > 3820 Lake Otis Pkwy. > Anchorage, AK 99508 > 907.770.6200 ext.220 > 907.336.6205 (fax) > Web: www.healthtvchannel.org > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    > Try this function: > http://www.php.net/manual/en/function.stripslashes.php

    Oddly enough, as I told John, I did that as well and it doesn't work.

    attached mail follows:


    It's extremely important as to where you put the function within your script. I know it's basic and goes without saying, but hey a lot of mistakes that we make.. Especially late at night, are ones that embarrass us after we find out the answer :) I guess I would have to find out exactly what you are doing to know what the problem is.

    Cheers!

    Rick

    "The future does not belong to those who are content with today, apathetic toward common problems and their fellow man alike, timid and fearful in the face of bold projects and new ideas. Rather, it will belong to those who can blend passion, reason and courage in a personal commitment to the great enterprises and ideals of American society." - Robert F. Kennedy

    > From: <skellerhealthtvchannel.org> > Date: Wed, 24 Jul 2002 14:48:07 -0800 > To: "PHP List \(E-mail\)" <php-generallists.php.net> > Subject: RE: [PHP] Trouble with \ > >> Try this function: >> http://www.php.net/manual/en/function.stripslashes.php > > Oddly enough, as I told John, I did that as well and it doesn't work. > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    If the "\" are showing up in form posted data just do this:

    $newtext = stripslashes($oldtext);

    The slashes are put before any single or double quote by a nifty little php feature called "magic quotes". By escaping quotes in form posted data you greatly reduce the risk of sql injections and other types of sneaky stuff.

    Jim Grill Support Web-1 Hosting http://www.web-1hosting.net ----- Original Message ----- From: <skellerhealthtvchannel.org> To: "PHP List (E-mail)" <php-generallists.php.net> Sent: Wednesday, July 24, 2002 5:30 PM Subject: [PHP] Trouble with \

    > Anyway, with asides to the snooty "RTFM" reply I got, I thought I'd share. > > Turns out the \'s that I was having problems getting rid of were written > there from a form post that was used to collect the data. I still haven't > found a way to remove them after reading them from the file, but I did > manage to change them before they were posted by doing a strtr. > > If someone has a way to clearn \'s out of a string brought in from a file, > I'm all ears, but it's working now. > > > > -- > The Health TV Channel, Inc. > (a non - profit organization) > 3820 Lake Otis Pkwy. > Anchorage, AK 99508 > 907.770.6200 ext.220 > 907.336.6205 (fax) > Web: www.healthtvchannel.org > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > >

    attached mail follows:


    > It's extremely important as to where you put the function within your > script.

    Understood, and as I said before, I'm fairly new to PHP, so I'm bound to make the boneheaded mistakes. But I did try and solve it myself before begging for help :)

    Basically, the user enteres some text into a form, posted to a script that catches the data and appends their name and text to the end of a file. Then, on another function on another page, I'm reading that line in and regurgitating it onto a page to generate a list of the last 20 posters and their comment.

    $myLine = fgets($myFile,255); print("<b>$myLine</b> \n");

    That's it. I figured between those two lines would be something like

    $myLine = (stripslashes($myLine));

    Which I tried, in several variations depending on which page I was looking at for help. I also tried using strtr instead. Neither of those would remove the slashes before the line was printed to the page. I even tried using a new variable name, as in

    $fauxText = (stripslashes($myLine));

    in case PHP had some kind of quirk about variables tweaking themselves.

    The file that's being read is plain text, btw. So if you want to try and duplicate, just read from a text file.

    But, like I said, using stripslashes *before* writing to the file fixes it regardless.

    attached mail follows:


    > If the "\" are showing up in form posted data just do this: > > $newtext = stripslashes($oldtext);

    That's what I'm doing now before they're written to the file.

    > The slashes are put before any single or double quote by a > nifty little php feature called "magic quotes". By escaping > quotes in form posted data you greatly reduce the risk of > sql injections and other types of sneaky stuff.

    Right. And what I was also trying to do was keep users from posting characters that would mess up the data being written to the page. It's for a limited audience, but you never know who's going to stumble onto it.

    Thanks for that.

    It certainly looks like nuking them preemptively is the way to go.

    attached mail follows:


    on 25/07/02 8:30 AM, skellerhealthtvchannel.org (skellerhealthtvchannel.org) wrote:

    > Anyway, with asides to the snooty "RTFM" reply I got, I thought I'd share.

    No, I agree with the RTFM statement. A simple search for "remove slashes" on php.net would have resulted in links to all the slashes functions, including stripslashes().

    Then you could have tested it using this function, and posted a more meaningful message like:

    "I have a file in my disk hierarchy which seems to have \'s added to it, possibly from a form post or something... any ideas how I strip them out? I've tried doing it with stripslashes() using the following code, but it isn't working."

    Then we could have checked out your code, and offered more help.

    In any way, this code should strip slashes out of a file:

    <? $file = "mydir/myfile.txt"; if(file_exists($file)) { // get contents of a file into a string $fd = fopen ($file, "r"); $txt = fread ($fd, filesize($file)); fclose ($fd); $txt = stripslashes($txt); } else { $txt = "File {$file} could not be found"; }

    echo $txt; ?>

    Which, incidently, was adapted from a sample script in the file section (fread I think) of the PHP manual :P

    I know a few of us tend to just reply with RTM all the time, but in reality, it helps you form better questions, and helps you understand your own problem a little better. More often than not, a decent sample script is available for what you want, either in the manual, or in the user contributed notes... but if you at least look at the manual first, you'll be more likely to get good responses, because you post better questions like:

    "I've tried to stripslashes using the following code, but it aint working... any ideas?"

    ... which make it a lot easier to help you.

    Justin French

    -------------------- Creative Director http://Indent.com.au --------------------

    attached mail follows:


    Is there anyways to speed up MySQL queries? Or showing the results through PHP? I have several queries that have about 8 left joins or so.. Yes very huge and when you have lots of people using these functions at once it really slows down.. Are there any practices that you can think of that would speed up any sql queries? I was thinking of using stored procedures, but after a bit of research I found ou= t that MySQL doesn=B9t have that yet so that's a no go :( Or is there a way of storing common query results? I am looking for _anything_ that will speed up showing results to large queries..

    I do use the ob_gzhandler and that helps a bit... Help! :)

    Cheers and Thanks!

    Rick

    "Let us live as people who are prepared to die, and die as people who are prepared to live." - James S. Stewart

    attached mail follows:


    Mysql 4 can cache queries. You can try using temporary tables, so you can break up joins.

    Also, perhaps making a "rawdata" table placeholder. Put a timestamp field on your columns. Make the query and store somewhere the query itself, the results and the time they were last modified. Then when the next query comes, compare if one already exists on the database. If so, only grab the "rawdata", ie, the previous results.

    And read Mysql's manual section about optimization if you haven't done so already, since it has important tips.

    --
    Julio Nobrega
    Pode acessar:
    http://www.inerciasensorial.com.br
    

    "Richard Baskett" <rickbaskettcase.com> escreveu na mensagem news:B96477C7.C3D4%rickbaskettcase.com... > Is there anyways to speed up MySQL queries? Or showing the results through > PHP? I have several queries that have about 8 left joins or so.. Yes very > huge and when you have lots of people using these functions at once it > really slows down.. Are there any practices that you can think of that would > speed up any sql queries? I was thinking of using stored procedures, but > after a bit of research I found ou= t that MySQL doesn=B9t have that yet so > that's a no go :( Or is there a way of storing common query results? I am > looking for _anything_ that will speed up showing results to large queries.. > > I do use the ob_gzhandler and that helps a bit... Help! :) > > Cheers and Thanks! > > Rick > > "Let us live as people who are prepared to die, and die as people who are > prepared to live." - James S. Stewart > >

    attached mail follows:


    Hi, I have istalled php from the red hat cd at the time i installed red hat itself. I downloaded apache and installed it. Can anyone tell me how to configure php on apache server? I mean what do I do next to run php scripts? I am totally new to all this. Please help. -Varsha

    __________________________________________________ Do You Yahoo!? Yahoo! Health - Feel better, live better http://health.yahoo.com

    attached mail follows:


    I've tried a function like this: function validate() { // if ( is_numeric($input1) && is_numeric($input2) && ctype_alpha($input3) && ctype_alpha($input4) ) return true; }

    And then I call the function:

    if (validate() == false) { some action; }

    My problem is I get the action every time, even though the input is of the right type. And, is ctype_alpha() the only way to check for only alphabetic characters? And (this started with one question), anyone got a good solution on validating email-adresses with php?

    attached mail follows:


    you're returning a literal true if the condition matches, and nothing if it fails...

    function validate() { // if ( is_numeric($input1) && is_numeric($input2) && ctype_alpha($input3) && ctype_alpha($input4) ) return true; else return false; }

    At 12:38 AM 7/25/2002 +0200, Øystein Håland wrote: >I've tried a function like this: >function validate() { // >if ( is_numeric($input1) && is_numeric($input2) && ctype_alpha($input3) && >ctype_alpha($input4) ) > return true; >} > > >And then I call the function: > >if (validate() == false) { > some action; >} > >My problem is I get the action every time, even though the input is of the >right type. And, is ctype_alpha() the only way to check for only alphabetic >characters? >And (this started with one question), anyone got a good solution on >validating email-adresses with php? > > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php

    attached mail follows:


    I've setup an image upload feature on a site, which uploads images into a mysql database.

    The uploads are working absolutely as expected on my local computer (the server), but when someone else tried to upload, only 1/3 of the image was uploaded. Could it be a matter of size? I was originally using just a Blob, and have since switched to a Long Blob. Any thoughts or comments on this would be greatly appreciated.

    Thanks a bunch,

    Jesse

    ______________________________________________________________________ Post your ad for free now! http://personals.yahoo.ca

    attached mail follows:


    Are you trying to upload the same image as you did at home? If so, size isn't the problem if you can do it from home. It might be a timeout issue. There might be something in php.ini you can set for timeout. You can specify the max filesize to upload in php.ini also.

    Good luck, Tyler

    On Wed, 24 Jul 2002 19:43:37 -0400 (EDT) Jesse Lawrence <lawrence_jesseyahoo.ca> wrote:

    > I've setup an image upload feature on a site, which > uploads images into a mysql database. > > The uploads are working absolutely as expected on my > local computer (the server), but when someone else > tried to upload, only 1/3 of the image was uploaded. > Could it be a matter of size? I was originally using > just a Blob, and have since switched to a Long Blob. > Any thoughts or comments on this would be greatly > appreciated. > > Thanks a bunch, > > Jesse > > ______________________________________________________________________ > > Post your ad for free now! http://personals.yahoo.ca > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php

    attached mail follows:


    Just curious why you don't upload the image to a dir and just store the link in the db?

    > -----Original Message----- > From: Jesse Lawrence [mailto:lawrence_jesseyahoo.ca] > Sent: Wednesday, July 24, 2002 7:44 PM > To: php-generallists.php.net > Subject: [PHP] Image upload into database > > > I've setup an image upload feature on a site, which > uploads images into a mysql database. > > The uploads are working absolutely as expected on my > local computer (the server), but when someone else > tried to upload, only 1/3 of the image was uploaded. > Could it be a matter of size? I was originally using > just a Blob, and have since switched to a Long Blob. > Any thoughts or comments on this would be greatly > appreciated. > > Thanks a bunch, > > Jesse > > ______________________________________________________________________ > Post your ad for free now! http://personals.yahoo.ca > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >

    attached mail follows:


    You need to look at the differences between your server and the live one.

    The only real way to test is to have both you AND another tester (preferably on a slow computer with 56k connection) to try uploading the SAME IMAGE FILE to both servers.

    This will rule out problems with the data type (eg blob).

    Then test with larger images/files.

    Likely problems will be:

    - the file size is too big, and the PHP script is timing out before it can finish (check php.ini for differences in script timeouts)

    - there is a maximum file size for uploaded files on the server, which is different to

    - the file isn't too big, but the script is still timing out (check php.ini for differences in script timeouts)

    - the 56k connection (different to your office set-up) means that files upload way too slow, or get interrupted

    If possible you should compare your php.ini to the one of the live server, and try to match them up, which will help.

    Justin French

    on 25/07/02 9:43 AM, Jesse Lawrence (lawrence_jesseyahoo.ca) wrote:

    > I've setup an image upload feature on a site, which > uploads images into a mysql database. > > The uploads are working absolutely as expected on my > local computer (the server), but when someone else > tried to upload, only 1/3 of the image was uploaded. > Could it be a matter of size? I was originally using > just a Blob, and have since switched to a Long Blob. > Any thoughts or comments on this would be greatly > appreciated. > > Thanks a bunch, > > Jesse > > ______________________________________________________________________ > Post your ad for free now! http://personals.yahoo.ca

    attached mail follows:


    In article <1027515843.3284.11.camelarcturus.phys.utk.edu>, reubendbinnovativethought.com says... > On Wed, 2002-07-24 at 08:29, Ian Ball wrote: > > Assuming you are installing from your php-4.2.2 directory, it would appear > > the libphp4.so hasn't actually been made, which would point to a possible > > error in the configuration parameters. I am also assuming your php 4.2.1 > > made OK which would mean all necessary libraries etc are available on your > > system. What are you using for the configure? On my system it was > > ./configure --with-mysql --with-apxs=/usr/local/apache/bin/apxs > > I did have ldap in there too, but for most people this is not necessary. > > Here is my configure line. Yes, my prev php 4.2.1 made and install fine > with the same configure line. I did exactly the same steps as when I > install 4.2.1 > > /configure --with-mysql --enable-track-var --disable-debug > --prefix=/usr/local/apache/php > --with-config-file-path=/usr/local/apache/lib > --with-apxs=/usr/local/apache/bin/apxs --with-gd --with-zlib > > > > > If a fresh run from the start fails, then without further information, my > > best suggestion is to completely delete the php-4.2.2 directory and ocntents, > > and start again with the tar -zxf php-4.2.2.whatever, ./configure...... > > I did that already, deleting the php-4.2.2 and start with un-tar the > download. Many times. But still no luck. > > Thanks. > Rdb

    OK - after you do 'make' is there a file libphp4.so in the lib directory under where you unpacked the install tarball? If not, something has apparently gone wrong with the make process or the configure; you might check (I think it is) config.log in the top of the install directory for any clues.

    I'm not sure, but it might be --enable-track-vars (unless that is a typo); check with configure --help | grep track

    Cheers

    -- 
    David Robley
    Temporary Kiwi!
    

    Quod subigo farinam

    attached mail follows:


    This should work $object = new $classname;

    Martin

    -----Original Message----- From: Michiel ten Hagen [mailto:mtenhagenvirtuosys.nl] Sent: Wednesday, July 24, 2002 11:17 PM To: 'Mathieu Dumoulin' Cc: php-generallists.php.net Subject: [PHP] RE: create object from variable class.

    Thx for quick reply,

    If I use the following: $object = new {classname};

    I get this a parse error: Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `'$'' in /home/sites/projects.virtuosys.nl/web/cm/includes/class_crm.inc.php on line 29

    From that I conclude that with this method its not possible to create an object from a variable class name

    Michiel ten Hagen mtenhagenvirtuosys.nl 06-54673863

    -----Oorspronkelijk bericht----- Van: Mathieu Dumoulin [mailto:mdumoulingroupimage.com] Verzonden: Wednesday, July 24, 2002 3:11 PM Aan: mtenhagenvirtuosys.nl Onderwerp: Re: create object from variable class.

    Simple, you made an error here You are telling the new operator to look into a variable to get the classname, to specify the class name as a string do this:

    $object = new {$classname};

    InsaneCoder

    Ps: I never tried this, but I think it is actually going to work, you got nthing to lose anyway I guess, takes two seconds to try.

    "Karel De Groot" <mtenhagenvirtuosys.nl> wrote in message news:<20020724130121.64455.qmailpb1.pair.com>... > Is it possible to create an object from a clas which name is in a > variable. > > Example: (doesn't work) > $object = new ${$classname}; > > > >

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

    attached mail follows:


    Hi all,

    Thought I turned on register_globals on in the php.ini, my server didn't know the HTTP_POST_FILES.

    echo $HTTP_POST_FILES[$file]['type'] ;

    echo $HTTP_POST_FILES[$file]['name'] ;

    echo $HTTP_POST_FILES[$file]['size'] ;

    I've always get these messages:

    PHP Warning: Undefined variable: HTTP_POST_FILES in c:\inetpub\wwwroot\ohabolana\scripts\sary_vaovao.inc on line 4 PHP Warning: Undefined variable: HTTP_POST_FILES in c:\inetpub\wwwroot\ohabolana\scripts\sary_vaovao.inc on line 5 PHP Warning: Undefined variable: HTTP_POST_FILES in c:\inetpub\wwwroot\ohabolana\scripts\sary_vaovao.inc on line 6

    Any suggestions ?

    Ravelomanana Rija rijavatu.com BP 1528 Port Vila Vanuatu

    attached mail follows:


    Date: Thu, 25 Jul 2002 11:15:33 +1000 From: Tom Rogers <trogerskwikin.com> Reply-To: Tom Rogers <trogerskwikin.com> Message-ID: <4160868664.20020725111533kwikin.com> To: "Rija" <rijavatu.com> CC: "PHP-General" <php-generallists.php.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Subject: Re: [PHP] HTTP_POST_FILES undefined - What happen?

    Hi,

    Thursday, July 25, 2002, 10:39:08 AM, you wrote: R> Hi all,

    R> Thought I turned on register_globals on in the php.ini, my server didn't know the HTTP_POST_FILES.

    R> echo $HTTP_POST_FILES[$file]['type'] ;

    R> echo $HTTP_POST_FILES[$file]['name'] ;

    R> echo $HTTP_POST_FILES[$file]['size'] ;

    R> I've always get these messages:

    R> PHP Warning: Undefined variable: HTTP_POST_FILES in c:\inetpub\wwwroot\ohabolana\scripts\sary_vaovao.inc on line 4 PHP Warning: Undefined variable: HTTP_POST_FILES in R> c:\inetpub\wwwroot\ohabolana\scripts\sary_vaovao.inc on line 5 PHP Warning: Undefined variable: HTTP_POST_FILES in c:\inetpub\wwwroot\ohabolana\scripts\sary_vaovao.inc on line 6

    R> Any suggestions ?

    R> Ravelomanana Rija R> rijavatu.com R> BP 1528 Port Vila R> Vanuatu

    If they are being used in a function you will need to do: function whatever(){ global $HTTP_POST_VARS; . . . }

    Just a guess :)

    -- 
    Best regards,
    Tom
    

    attached mail follows:


    Hi,

    Thursday, July 25, 2002, 11:15:33 AM, you wrote: TR> Hi,

    TR> Thursday, July 25, 2002, 10:39:08 AM, you wrote: R>> Hi all,

    R>> Thought I turned on register_globals on in the php.ini, my server didn't know the HTTP_POST_FILES.

    R>> echo $HTTP_POST_FILES[$file]['type'] ;

    R>> echo $HTTP_POST_FILES[$file]['name'] ;

    R>> echo $HTTP_POST_FILES[$file]['size'] ;

    R>> I've always get these messages:

    R>> PHP Warning: Undefined variable: HTTP_POST_FILES in c:\inetpub\wwwroot\ohabolana\scripts\sary_vaovao.inc on line 4 PHP Warning: Undefined variable: HTTP_POST_FILES in R>> c:\inetpub\wwwroot\ohabolana\scripts\sary_vaovao.inc on line 5 PHP Warning: Undefined variable: HTTP_POST_FILES in c:\inetpub\wwwroot\ohabolana\scripts\sary_vaovao.inc on line 6

    R>> Any suggestions ?

    R>> Ravelomanana Rija R>> rijavatu.com R>> BP 1528 Port Vila R>> Vanuatu

    TR> If they are being used in a function you will need to do: TR> function whatever(){ TR> global $HTTP_POST_VARS; TR> . TR> . TR> . TR> }

    TR> Just a guess :)

    TR> -- TR> Best regards, TR> Tom

    sorry that should have been global $HTTP_POST_FILES;

    -- 
    Best regards,
    Tom
    

    attached mail follows:


    Hi.

    I've got this script that needs to take for examle 02 and increase that to 03. but when i run the script $Num++; it changes 03 to 3;

    is there not a function that adds leading zeros onto a string ?

    attached mail follows:


    you could use: printf("%02d", ++$Num); or if you want to put it back into $Num, use the sprintf() version

    -----Original Message----- From: vins [mailto:vinswebonline.co.za] Sent: Thursday, July 25, 2002 10:44 AM To: php-generallists.php.net Subject: [PHP] Numbers with leading zero...

    Hi.

    I've got this script that needs to take for examle 02 and increase that to 03. but when i run the script $Num++; it changes 03 to 3;

    is there not a function that adds leading zeros onto a string ?

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

    attached mail follows:


    Hi,

    Thursday, July 25, 2002, 10:44:00 AM, you wrote: v> Hi.

    v> I've got this script that needs to take for examle 02 and increase that to v> 03. v> but when i run the script $Num++; it changes 03 to 3;

    v> is there not a function that adds leading zeros onto a string ?

    have a look at the sprintf() function for full info:

    sprintf("value = %02d", $value);

    -- 
    Best regards,
    Tom
    

    attached mail follows:


    Thanks so much for the help you guys. problem sorted out...

    :D

    "Vins" <vinswebonline.co.za> wrote in message news:20020725004241.62777.qmailpb1.pair.com... > Hi. > > I've got this script that needs to take for examle 02 and increase that to > 03. > but when i run the script $Num++; it changes 03 to 3; > > is there not a function that adds leading zeros onto a string ? > >

    attached mail follows:


    Hi,

    what's the best way to log the bad email address' from a mail() loop?

    my guess is:

    <? $log = ''; $to = 'memy.com'; $subj = 'foo'; $msg = 'blah'; $head = 'From: memy.com';

    if(!mail($to,$sub,$msg,$head)) { $log .= "{$to}\n"; }

    // write $log to screen, or to a file ?>

    But I'm interested in people's experience with what mail() returns: From the manual: "mail() returns TRUE if the mail was successfully accepted for delivery, FALSE otherwise."

    Is the definition of "accepted for delivery" dependent on each server, or is there are general definition of what it means?

    ie, when am I likely to get a returned value of FALSE?

    Also, I'm on a shared server. Is there any way I can specify the email address that bounces return to with either an ini_set or with an email header?

    Because my assumption is that there will be email address' that return TRUE, but later bounce.

    Can't see what it might be in the php.ini file though.

    Thanks in advance,

    Justin French