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: Thu Jan 16 2003 - 20:10:10 CST

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

    php-general Digest 17 Jan 2003 02:10:10 -0000 Issue 1827

    Topics (messages 131858 through 131955):

    Re: Problem with a for loop...
            131858 by: Matt Schroebel

    Re: MIME email...
            131859 by: Manuel Lemos

    Re: intermittent session loss
            131860 by: 1LT John W. Holmes
            131873 by: Chris Shiflett
            131877 by: Justin French
            131883 by: Marek Kilimajer

    Re: File() function and require()
            131861 by: 1LT John W. Holmes

    Re: access denied
            131862 by: lastnumberone.msn.com
            131865 by: Marek Kilimajer
            131866 by: lastnumberone.msn.com
            131870 by: Marek Kilimajer
            131871 by: lastnumberone.msn.com
            131874 by: Chris Boget
            131875 by: Chris Shiflett
            131879 by: Adam Voigt
            131880 by: Chris Shiflett
            131884 by: Chris Boget

    Re: [phplib template] file does not exist
            131863 by: roel

    Warning: OCIFetchInto: ORA-01002: ????
            131864 by: ys_zhu

    Re: Php's future with Asp .NET?
            131867 by: Khalid El-Kary
            131868 by: Maxim Maletsky

    Re: Problems with require() and variables
            131869 by: Ford, Mike [LSS]

    No constants being set. HUH?
            131872 by: Mako Shark
            131876 by: Ford, Mike [LSS]

    Re: "document contained no data"
            131878 by: Justin French
            131886 by: Marek Kilimajer
            131945 by: Justin French

    nl2br too?
            131881 by: Cesar Aracena
            131885 by: Chris Shiflett
            131891 by: gamin

    experience in OOP & PHP combination needed
            131882 by: Hannes Smit

    Re: Getting a dynamic IP address
            131887 by: Danny Shepherd

    Redirecting
            131888 by: Denis L. Menezes
            131890 by: Andrew Brampton
            131892 by: Chris Shiflett

    Re: Security in included PHP files
            131889 by: Philippe Saladin
            131925 by: Jacob Copsey

    Ever complained about lousy PHP programmers?
            131893 by: Peter Hutnick
            131913 by: Leon Mergen
            131915 by: Peter Hutnick
            131946 by: Justin French

    Re: Send email when some action
            131894 by: Miguel Brás

    get the $email string
            131895 by: Miguel Brás
            131910 by: Rafael Rodrigo - NSI
            131912 by: Brian T. Allen
            131929 by: Steve Edberg

    Redirecting - here is the code
            131896 by: Denis L. Menezes
            131897 by: Jason Wong
            131901 by: Denis L. Menezes
            131903 by: Mike Morton
            131904 by: Joci
            131905 by: Marios Adamantopoulos

    Re: Images : Store in dB or disk?
            131898 by: Bobby Patel
            131899 by: Daniel Kushner

    Strange behavior on backtick operator execution environment
            131900 by: Marc Cluet
            131906 by: Jason Wong

    imageCreate() error
            131902 by: Ed

    Re: Adding HTTP URL Code
            131907 by: ELLIOTT,KATHERINE A (HP-FtCollins,ex1)

    Re: OOP
            131908 by: Jordan Elver
            131909 by: Jordan Elver

    Apache 2.0.43 and PHP 4.3.0 on Windows - Problems
            131911 by: Beauford.2002

    Any "Web Application Development Studio" available?
            131914 by: Steve Magruder

    mail via php. 2 questions...
            131916 by: Øystein Håland

    Passing Arrays Through Forms
            131917 by: . Nilaab

    Imagecreatefromjpeg()
            131918 by: Sara Keesler
            131920 by: Matt Schroebel

    Re: HTTP_REFERER work without a problem....
            131919 by: Joel Boonstra
            131924 by: Scott Fletcher

    List items in table with a hypertext link
            131921 by: Mike Tuller
            131941 by: Al
            131944 by: Hugh Danaher

    Set element closeness measure
            131922 by: typea.l-i-e.com

    session_destroy have strange effect....
            131923 by: Scott Fletcher
            131926 by: Scott Fletcher

    PHP and PDF Forms
            131927 by: ed.home.homes2see.com

    Session Length
            131928 by: Pushpinder Singh Garcha
            131947 by: Justin French

    x12 837
            131930 by: Edward Peloke
            131931 by: Rodney Green
            131932 by: Marco Tabini
            131933 by: Paul Marinas
            131934 by: Edward Peloke
            131935 by: Cal Evans
            131936 by: Edward Peloke
            131937 by: Edward Peloke
            131938 by: Cal Evans

    More OOP
            131939 by: Jordan Elver
            131940 by: Cal Evans

    REQUEST_URI, which part of $_<whatever> is it from??
            131942 by: Scott Fletcher
            131948 by: Philip Olson

    package-stats-graph.php
            131943 by: Eskil Kvalnes

    What's the PHP-equivalent of Perl's AUTOLOAD feature?
            131949 by: Chip Castle

    Display Dates in English o_O
            131950 by: Stephen
            131955 by: Justin French

    fit window to image
            131951 by: Ezequiel Sapoznik
            131952 by: Timothy Hitchens \(HiTCHO\)
            131953 by: Weston Houghton

    postfix instead of sendmail
            131954 by: HPS

    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:


    > -----Original Message-----
    > From: Davíð Örn Jóhannsson [mailto:davidatom.is]
    > Sent: 16. janúar 2003 13:59
    > Subject: RE: [PHP] Problem with a for loop...
    >
    > I only want the last inserted row in the mysql database, and each time
    > the script goes trough the loop it adds a new row into the
    > database ...

    If you only want the most recent row, why read all of the roww in the table? Why not add a auto_increment column, or a timestamp, sorting on that column with a limit of 0,1?

    attached mail follows:


    Hello,

    On 01/16/2003 11:37 AM, Brian McGarvie wrote:
    > Now... the problem I have is some people are reporting they get the
    > Multi-part stuff as the body... for others it'll work as wanted... i.e.
    > display Plaintext or render the HTML as wanted.
    >
    > Anyone had this problem?

    It looks like one of those bugs of mail() function that affect mail
    systems differently.

    You may want to try this class that has workarounds for some of the
    mail() function bugs. It also makes it simple to compose
    multipart/alternative messages:

    http://www.phpclasses.org/mimemessage

    -- 
    

    Regards, Manuel Lemos

    attached mail follows:


    Is there any kind of load balancing on your server? If you watch the session files in /tmp, are they getting erased?

    ---John Holmes...

    ----- Original Message ----- From: "Justin French" <justinindent.com.au> To: "php" <php-generallists.php.net> Sent: Thursday, January 16, 2003 2:55 AM Subject: [PHP] intermittent session loss

    > Hi, > > I think I may have made some headway with my server problems. I loaded the > site onto another account within the same machine, and I can't seem to > replicate the "document contained no data" error at all. > > BUT I did notice that once I login (it says "you are logged in as justin" > across the top of the screen), if I refresh the same page a few times, it > will MOSTLY say "you are logged in as..." but OCCASIONALLY it says "click > here to login"... > > The server does use trans-sid, but in my case, it's using cookies... the > session doesn't get LOST (because it's "back" next time I refresh), but I do > appear to be "logged out" until I refresh again. > > VERY strange. > > To investigate further, I turned off cookies, and tried again... after 5 or > so refreshes, I lost the session ID out of the URL. > > > Whilst I can't repeat the problem on the original account, I have a feeling > these two issues are related. > > > What's likely to cause this? > > > Here's the Session section of phpinfo(): > > -- > Session Support enabled > Directive Local Value Master Value > session.auto_start Off Off > session.cache_expire 180 180 > session.cache_limiter nocache nocache > session.cookie_domain no value no value > session.cookie_lifetime 0 0 > session.cookie_path / / > session.cookie_secure Off Off > session.entropy_file /dev/urandom /dev/urandom > session.entropy_length 256 256 > session.gc_maxlifetime 900 900 > session.gc_probability 1 1 > session.name PHPSID PHPSID > session.referer_check no value no value > session.save_handler mm mm > session.save_path /tmp /tmp > session.serialize_handler php php > session.use_cookies On On > session.use_trans_sid 1 1 > -- > > My LAN server's values (not compiled with trans-sid) are: > -- > Session Support enabled > Directive Local Value Master Value > session.auto_start Off Off > session.cache_expire 180 180 > session.cache_limiter nocache nocache > session.cookie_domain no value no value > session.cookie_lifetime 0 0 > session.cookie_path / / > session.cookie_secure Off Off > session.entropy_file no value no value > session.entropy_length 0 0 > session.gc_maxlifetime 1440 1440 > session.gc_probability 1 1 > session.name PHPSESSID PHPSESSID > session.referer_check no value no value > session.save_handler files files > session.save_path /tmp /tmp > session.serialize_handler php php > session.use_cookies On On > -- > > Biggest difference I can see (not that I really know what I'm looking for) > is that locally, the save_handler is 'mm' (memory?), and on the server, it's > files. And the entropy stuff, which I don't understand :) > > > So, what could cause the session to drop (then kick back in again) by simply > refreshing the page a few times? > > > Many thanks in advance, > > Justin French > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    --- Justin French <justinindent.com.au> wrote: > I did notice that once I login (it says "you are > logged in as justin" across the top of the screen), > if I refresh the same page a few times, it will > MOSTLY say "you are logged in as..." but > OCCASIONALLY it says "click here to login"...

    > What's likely to cause this?

    As I'm sure you're aware, this type of session problem can be difficult to resolve. :-)

    I am assuming that you are not using any type of load balancing? If you are, that's probably your answer.

    Short of that, can you replicate this in Mozilla? The reason I ask is that there is now a project on mozdev.org for viewing the HTTP protocol (http://livehttpheaders.mozdev.org/). Otherwise, if you have a tool to view the HTTP transactions, use that. I am particularly curious to see if the HTTP request fails to include the cookie or URL variable (depending on which method you are testing) for the instance when you lose session.

    If the browser is correctly identifying itself on each request, the requests are going to the same server, and the session file never vanishes, I can see no way you would lose session like that.

    If all else fails, try using a database for your session store instead of /tmp to see if the behavior changes.

    Good luck, and let us know what you find out.

    Chris

    attached mail follows:


    on 17/01/03 1:24 AM, 1LT John W. Holmes (holmes072000charter.net) wrote:

    > Is there any kind of load balancing on your server?

    It's a single server, so to the best of my knowledge, no.

    > If you watch the session > files in /tmp, are they getting erased?

    No, because they reappear and page or two later. I confirmed this with a simple incrementing session counter, and the results were bizarre. You would expect the number to increase in sequence:

    0,1,2,3,4,5,6,7,8,9,10...50

    But instead, I got:

    0,1,2,3,0,4,5,1,6,7,2,8,9,3,10,11,12,13,14,15,16,17,18,4

    I can see two sessions in there... one that gets to 18, the other getting to 4.

    Again, this is NOT a repeatable bug... right now, it just counted perfectly up to 25 before I got bored... :)

    Justin

    > ---John Holmes... > > ----- Original Message ----- > From: "Justin French" <justinindent.com.au> > To: "php" <php-generallists.php.net> > Sent: Thursday, January 16, 2003 2:55 AM > Subject: [PHP] intermittent session loss > > >> Hi, >> >> I think I may have made some headway with my server problems. I loaded > the >> site onto another account within the same machine, and I can't seem to >> replicate the "document contained no data" error at all. >> >> BUT I did notice that once I login (it says "you are logged in as justin" >> across the top of the screen), if I refresh the same page a few times, it >> will MOSTLY say "you are logged in as..." but OCCASIONALLY it says "click >> here to login"... >> >> The server does use trans-sid, but in my case, it's using cookies... the >> session doesn't get LOST (because it's "back" next time I refresh), but I > do >> appear to be "logged out" until I refresh again. >> >> VERY strange. >> >> To investigate further, I turned off cookies, and tried again... after 5 > or >> so refreshes, I lost the session ID out of the URL. >> >> >> Whilst I can't repeat the problem on the original account, I have a > feeling >> these two issues are related. >> >> >> What's likely to cause this? >> >> >> Here's the Session section of phpinfo(): >> >> -- >> Session Support enabled >> Directive Local Value Master Value >> session.auto_start Off Off >> session.cache_expire 180 180 >> session.cache_limiter nocache nocache >> session.cookie_domain no value no value >> session.cookie_lifetime 0 0 >> session.cookie_path / / >> session.cookie_secure Off Off >> session.entropy_file /dev/urandom /dev/urandom >> session.entropy_length 256 256 >> session.gc_maxlifetime 900 900 >> session.gc_probability 1 1 >> session.name PHPSID PHPSID >> session.referer_check no value no value >> session.save_handler mm mm >> session.save_path /tmp /tmp >> session.serialize_handler php php >> session.use_cookies On On >> session.use_trans_sid 1 1 >> -- >> >> My LAN server's values (not compiled with trans-sid) are: >> -- >> Session Support enabled >> Directive Local Value Master Value >> session.auto_start Off Off >> session.cache_expire 180 180 >> session.cache_limiter nocache nocache >> session.cookie_domain no value no value >> session.cookie_lifetime 0 0 >> session.cookie_path / / >> session.cookie_secure Off Off >> session.entropy_file no value no value >> session.entropy_length 0 0 >> session.gc_maxlifetime 1440 1440 >> session.gc_probability 1 1 >> session.name PHPSESSID PHPSESSID >> session.referer_check no value no value >> session.save_handler files files >> session.save_path /tmp /tmp >> session.serialize_handler php php >> session.use_cookies On On >> -- >> >> Biggest difference I can see (not that I really know what I'm looking for) >> is that locally, the save_handler is 'mm' (memory?), and on the server, > it's >> files. And the entropy stuff, which I don't understand :) >> >> >> So, what could cause the session to drop (then kick back in again) by > simply >> refreshing the page a few times? >> >> >> Many thanks in advance, >> >> Justin French >> >> >> >> >> >> -- >> PHP General Mailing List (http://www.php.net/) >> To unsubscribe, visit: http://www.php.net/unsub.php >> > > --- > [This E-mail scanned for viruses] > >

    attached mail follows:


    Check the cookies you have stored in your browser. I once had similar problem, when I had 2 cookies of the same name set, but different in path, one had "/directory" the other one "/directory/"

    Justin French wrote:

    >on 17/01/03 1:24 AM, 1LT John W. Holmes (holmes072000charter.net) wrote: > > > >>Is there any kind of load balancing on your server? >> >> > >It's a single server, so to the best of my knowledge, no. > > > > >>If you watch the session >>files in /tmp, are they getting erased? >> >> > >No, because they reappear and page or two later. I confirmed this with a >simple incrementing session counter, and the results were bizarre. You >would expect the number to increase in sequence: > >0,1,2,3,4,5,6,7,8,9,10...50 > >But instead, I got: > >0,1,2,3,0,4,5,1,6,7,2,8,9,3,10,11,12,13,14,15,16,17,18,4 > >I can see two sessions in there... one that gets to 18, the other getting to >4. > >Again, this is NOT a repeatable bug... right now, it just counted perfectly >up to 25 before I got bored... :) > > >Justin > > > > > >>---John Holmes... >> >>----- Original Message ----- >>From: "Justin French" <justinindent.com.au> >>To: "php" <php-generallists.php.net> >>Sent: Thursday, January 16, 2003 2:55 AM >>Subject: [PHP] intermittent session loss >> >> >> >> >>>Hi, >>> >>>I think I may have made some headway with my server problems. I loaded >>> >>> >>the >> >> >>>site onto another account within the same machine, and I can't seem to >>>replicate the "document contained no data" error at all. >>> >>>BUT I did notice that once I login (it says "you are logged in as justin" >>>across the top of the screen), if I refresh the same page a few times, it >>>will MOSTLY say "you are logged in as..." but OCCASIONALLY it says "click >>>here to login"... >>> >>>The server does use trans-sid, but in my case, it's using cookies... the >>>session doesn't get LOST (because it's "back" next time I refresh), but I >>> >>> >>do >> >> >>>appear to be "logged out" until I refresh again. >>> >>>VERY strange. >>> >>>To investigate further, I turned off cookies, and tried again... after 5 >>> >>> >>or >> >> >>>so refreshes, I lost the session ID out of the URL. >>> >>> >>>Whilst I can't repeat the problem on the original account, I have a >>> >>> >>feeling >> >> >>>these two issues are related. >>> >>> >>>What's likely to cause this? >>> >>> >>>Here's the Session section of phpinfo(): >>> >>>-- >>>Session Support enabled >>>Directive Local Value Master Value >>>session.auto_start Off Off >>>session.cache_expire 180 180 >>>session.cache_limiter nocache nocache >>>session.cookie_domain no value no value >>>session.cookie_lifetime 0 0 >>>session.cookie_path / / >>>session.cookie_secure Off Off >>>session.entropy_file /dev/urandom /dev/urandom >>>session.entropy_length 256 256 >>>session.gc_maxlifetime 900 900 >>>session.gc_probability 1 1 >>>session.name PHPSID PHPSID >>>session.referer_check no value no value >>>session.save_handler mm mm >>>session.save_path /tmp /tmp >>>session.serialize_handler php php >>>session.use_cookies On On >>>session.use_trans_sid 1 1 >>>-- >>> >>>My LAN server's values (not compiled with trans-sid) are: >>>-- >>>Session Support enabled >>>Directive Local Value Master Value >>>session.auto_start Off Off >>>session.cache_expire 180 180 >>>session.cache_limiter nocache nocache >>>session.cookie_domain no value no value >>>session.cookie_lifetime 0 0 >>>session.cookie_path / / >>>session.cookie_secure Off Off >>>session.entropy_file no value no value >>>session.entropy_length 0 0 >>>session.gc_maxlifetime 1440 1440 >>>session.gc_probability 1 1 >>>session.name PHPSESSID PHPSESSID >>>session.referer_check no value no value >>>session.save_handler files files >>>session.save_path /tmp /tmp >>>session.serialize_handler php php >>>session.use_cookies On On >>>-- >>> >>>Biggest difference I can see (not that I really know what I'm looking for) >>>is that locally, the save_handler is 'mm' (memory?), and on the server, >>> >>> >>it's >> >> >>>files. And the entropy stuff, which I don't understand :) >>> >>> >>>So, what could cause the session to drop (then kick back in again) by >>> >>> >>simply >> >> >>>refreshing the page a few times? >>> >>> >>>Many thanks in advance, >>> >>>Justin French >>> >>> >>> >>> >>> >>>-- >>>PHP General Mailing List (http://www.php.net/) >>>To unsubscribe, visit: http://www.php.net/unsub.php >>> >>> >>> >>--- >>[This E-mail scanned for viruses] >> >> >> >> > > > >

    attached mail follows:


    > OK, I have a file called page.php that has the following code in it > (example but same layout and concept). > > > <?PHP > require("membercheck.php"); > ?> > <html> > <head> > <title>Page Title</title> > </head> > <body> > This is the text in the body of the page. > </body> > </html> > > The membercheck.php file contains a login form that is used if a session > variable doesn't exist, i.e. the user is not logged in. What happens is > when I run file() to read in the contents of page.php it reads in the code > that is in the membercheck.php file, and never reads in any code that is > in the page.php file. What I would need is a way to read in the contents > of the page.php file without reading the membercheck.php file. > > Better explanation?

    Yeah, kind of, but you should show your actual code. I have a feeling your using a command like

    file('http://www.yourdomain.com/page.php');

    to read your data, instead of

    file('/path/to/file/on/system/htdocs/page.php');

    ---John Holmes...

    attached mail follows:


    Hello All, I have a script which uploads a mysqldump file into the server and use system("mysql -uroot -p < the_dump_file.sql") to restore the database. While, it does not go through and the apache error_log shows:

    Enter password: Enter password: ERROR 1045: Access denied for user: 'rootlocalhost' (Using password: YES)

    The passwords for mysql account "root" is "", but when I remove the -p from the command, everything is fine.

    The wired thing is, when I use system("mysqldump -uroot -p >the_dump_file.sql"), it is also fine.

    Anybody has experience of this? or any suggestions? Thanks a lot.

    attached mail follows:


    There is nothing wrong with it, with the -p switch, you specify you want to supply a password, but you don't give any, hence access denied

    lastnumberonemsn.com wrote:

    >Hello All, I have a script which uploads a mysqldump file into the server >and use system("mysql -uroot -p < the_dump_file.sql") to restore the >database. While, it does not go through and the apache error_log shows: > >Enter password: Enter password: ERROR 1045: Access denied for user: >'rootlocalhost' (Using password: YES) > >The passwords for mysql account "root" is "", but when I remove the -p from >the command, everything is fine. > >The wired thing is, when I use system("mysqldump -uroot -p > > >>the_dump_file.sql"), it is also fine. >> >> > >Anybody has experience of this? or any suggestions? Thanks a lot. > > > > >

    attached mail follows:


    But why it is ok when i use system("mysqldump -uroot -p >my_dump_file.sql")? thanks "Marek Kilimajer" <kilimajerwebglobe.sk> wrote in message news:3E26C62D.8070600webglobe.sk... > There is nothing wrong with it, with the -p switch, you specify you want > to supply a password, but you don't give any, hence access denied > > lastnumberonemsn.com wrote: > > >Hello All, I have a script which uploads a mysqldump file into the server > >and use system("mysql -uroot -p < the_dump_file.sql") to restore the > >database. While, it does not go through and the apache error_log shows: > > > >Enter password: Enter password: ERROR 1045: Access denied for user: > >'rootlocalhost' (Using password: YES) > > > >The passwords for mysql account "root" is "", but when I remove the -p from > >the command, everything is fine. > > > >The wired thing is, when I use system("mysqldump -uroot -p > > > > > >>the_dump_file.sql"), it is also fine. > >> > >> > > > >Anybody has experience of this? or any suggestions? Thanks a lot. > > > > > > > > > > >

    attached mail follows:


    I suppose because if you use

    mysqldump -uroot -p <my_dump_file.sql

    the password is read from my_dump_file.sql

    lastnumberonemsn.com wrote:

    >But why it is ok when i use system("mysqldump -uroot -p >my_dump_file.sql")? >thanks >"Marek Kilimajer" <kilimajerwebglobe.sk> wrote in message >news:3E26C62D.8070600webglobe.sk... > > >>There is nothing wrong with it, with the -p switch, you specify you want >>to supply a password, but you don't give any, hence access denied >> >>lastnumberonemsn.com wrote: >> >> >> >>>Hello All, I have a script which uploads a mysqldump file into the server >>>and use system("mysql -uroot -p < the_dump_file.sql") to restore the >>>database. While, it does not go through and the apache error_log shows: >>> >>>Enter password: Enter password: ERROR 1045: Access denied for user: >>>'rootlocalhost' (Using password: YES) >>> >>>The passwords for mysql account "root" is "", but when I remove the -p >>> >>> >from > > >>>the command, everything is fine. >>> >>>The wired thing is, when I use system("mysqldump -uroot -p >>> >>> >>> >>> >>>>the_dump_file.sql"), it is also fine. >>>> >>>> >>>> >>>> >>>Anybody has experience of this? or any suggestions? Thanks a lot. >>> >>> >>> >>> >>> >>> >>> > > > > >

    attached mail follows:


    no, i use mysqldump -uroot -p > my_dump_file.sql it is not '<' but '>'

    "Marek Kilimajer" <kilimajerwebglobe.sk> wrote in message news:3E26CDFC.1070805webglobe.sk... > I suppose because if you use > > mysqldump -uroot -p <my_dump_file.sql > > the password is read from my_dump_file.sql > > lastnumberonemsn.com wrote: > > >But why it is ok when i use system("mysqldump -uroot -p >my_dump_file.sql")? > >thanks > >"Marek Kilimajer" <kilimajerwebglobe.sk> wrote in message > >news:3E26C62D.8070600webglobe.sk... > > > > > >>There is nothing wrong with it, with the -p switch, you specify you want > >>to supply a password, but you don't give any, hence access denied > >> > >>lastnumberonemsn.com wrote: > >> > >> > >> > >>>Hello All, I have a script which uploads a mysqldump file into the server > >>>and use system("mysql -uroot -p < the_dump_file.sql") to restore the > >>>database. While, it does not go through and the apache error_log shows: > >>> > >>>Enter password: Enter password: ERROR 1045: Access denied for user: > >>>'rootlocalhost' (Using password: YES) > >>> > >>>The passwords for mysql account "root" is "", but when I remove the -p > >>> > >>> > >from > > > > > >>>the command, everything is fine. > >>> > >>>The wired thing is, when I use system("mysqldump -uroot -p > >>> > >>> > >>> > >>> > >>>>the_dump_file.sql"), it is also fine. > >>>> > >>>> > >>>> > >>>> > >>>Anybody has experience of this? or any suggestions? Thanks a lot. > >>> > >>> > >>> > >>> > >>> > >>> > >>> > > > > > > > > > > >

    attached mail follows:


    > But why it is ok when i use system("mysqldump -uroot -p >my_dump_file.sql")?

    As alluded to by the last user (who got the command wrong), when you do:

    system("mysql -uroot -p < the_dump_file.sql")

    it doesn't know where the command ends and the input begins. So what's going on is that the command thinks that the password is coming from the "the_dump_file.sql". So while you think that is the data you are passing to the "mysql" executable, the system call thinks it's what you are passing to the "-p" option.

    Try doing this instead and see if it doesn't work:

    system( "cat the_dump_file.sql | mysql -uroot -p" );

    Chris

    attached mail follows:


    --- lastnumberonemsn.com wrote: > no, i use mysqldump -uroot -p > my_dump_file.sql > it is not '<' but '>'

    That syntax is fine, and it should prompt you for a password.

    My suggestion is to give the root account a password and don't worry about all of this. I think I read that it is currently empty, right? Just assign it a proper password, and move on to the next problem. :-)

    Chris

    attached mail follows:


    This is infact not the case, using the < operator does not make the mysqldump program read that file and interpret the data in the file as the password, if you have a proper password set and use the -p option (even with a < operator) it will still ask you for a password.

    On Thu, 2003-01-16 at 10:33, Chris Boget wrote:

    > But why it is ok when i use system("mysqldump -uroot -p >my_dump_file.sql")? As alluded to by the last user (who got the command wrong), when you do: system("mysql -uroot -p < the_dump_file.sql") it doesn't know where the command ends and the input begins. So what's going on is that the command thinks that the password is coming from the "the_dump_file.sql". So while you think that is the data you are passing to the "mysql" executable, the system call thinks it's what you are passing to the "-p" option. Try doing this instead and see if it doesn't work: system( "cat the_dump_file.sql | mysql -uroot -p" ); Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

    -- 
    Adam Voigt (adamcryptocomm.com)
    The Cryptocomm Group
    My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc
    

    -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (GNU/Linux)

    iD8DBQA+JtHuF9k9BmZXCWYRAkzdAJ9FzGU/ty4HTvvRUTLHm4M+uNPDWACgpDVj pLNhaqwBk2NBFdueKHVh6Pg=HZ0W -----END PGP SIGNATURE-----

    attached mail follows:


    --- Chris Boget <chriswild.net> wrote: > system("mysql -uroot -p < the_dump_file.sql") > > it doesn't know where the command ends and the input > begins. So what's going on is that the command thinks > that the password is coming from the "the_dump_file.sql".

    It knows exactly where the command ends and the input begins. It is the < symbol. :-)

    Also, in your example (which strays from the poster's example), the_dump_file.sql is simply executed by mysql once you provide the password (which it prompts for). It does not try to use it for the password as you seem to be thinking.

    Anyway, the reason the poster wrote it like this:

    mysqldump -uroot -p > the_dump_file.sql

    is so that the output of mysqldump (the dump file) is sent to the_dump_file.sql rather than stdout.

    Chris

    attached mail follows:


    > > system("mysql -uroot -p < the_dump_file.sql") > > it doesn't know where the command ends and the input > > begins. So what's going on is that the command thinks > > that the password is coming from the "the_dump_file.sql". > It knows exactly where the command ends and the input > begins. It is the < symbol. :-)

    Ok, I wasn't sure. It just seemed like it could go either way. > Also, in your example (which strays from the poster's > example),

    No. They both do the same thing. They take the data from the .sql file and make mysql use it.

    > once you provide the password (which it prompts for). It > does not try to use it for the password as you seem to be > thinking.

    Again, it seemed like it could go either way. :p > Anyway, the reason the poster wrote it like this: > mysqldump -uroot -p > the_dump_file.sql > is so that the output of mysqldump (the dump file) is sent > to the_dump_file.sql rather than stdout.

    Right. And the problem the original poster had was getting mysql use that data that mysqldump dumped. This is the problmatic command:

    system("mysql -uroot -p < the_dump_file.sql")

    and that is the same thing as this:

    system( "cat the_dump_file.sql | mysql -uroot -p" );

    just doing it a different way. It just clears up any kind of ambiguity w/r/t what the "the_dump_file.sql" is being used for.

    Chris

    attached mail follows:


    Thank you, this helped me to find the problem. It seemed that i had to set the $root variable in the templated class, although i never had to do this on the other server, but it works now. Thanks!!

    "Marek Kilimajer" <kilimajerwebglobe.sk> schreef in bericht news:3E268F12.1090604webglobe.sk... > First go to the file that generates the error and find out how it knows > the template file does not exists > > roel wrote: > > > Hi, > > > >i'm having a problem. I just installed a webserver with mysql and php. I > >copied my files that i had stored on another webserver to my new. I didn't > >change anything to these files and the files worked fine on the other > >server. > > > >Now in this server i get this error with a template: > > Template Error: filename: file ./templates/nav_left_body.tpl.php does > > not exist. > > Halted > > > >But that file does exist. I can see it through ftp an i can get to it via > >http browser. > > > >What could be wrong? Could it be a config failure in my php.ini? Or in > >httpd.conf? In case it is the config, what could it be? > > > >Thanks in advance!! > > > > > > > > > > >

    attached mail follows:


    hello all:

    XP+IIS5.1+PHP4.3+ORACLE9.2(client)

    ERROR REPORT as follow:

    Warning: OCIFetchInto: ORA-01002: ???? in C:\MyPHP\test.php on line 18 Error - no rows returned!

    test.php:

    <?php if (empty($offset) || $offset < 0)

    $offset=0; } $limit = 3; $conn = OCILogon("userid", "userpasswd", "SID"); if (!$conn)

    echo "<h1>ERROR - Could not connect to Oracle</h1>"; exit; } $sql = "Select count(*) from t1"; $stmt = OCIParse($conn, $sql); if(!$stmt)

    echo "<h1>ERROR - Could not parse SQL statement.</h1>"; exit; } OCIExecute($stmt); OCIFetchInto($stmt, &$total_rows); if ( !$total_rows[0] )

    echo "<h1>Error - no rows returned!</h1>"; exit; } echo "There are $total_rows[0] results.<br>\n"; echo "Now showing results $begin to $end.<br><br>\n"; OCIFreeStatement($stmt); ?>

    please help me, thanks!

    attached mail follows:


    leave PHP, work with ASP .NET and let Microsoft gain more domination and say bye bye for your freedom, then let develpment go and work as a machine that does like Microsoft wants

    oh, i forgot, remember to submit ASP .NET bug reports to their site, to get a reply after 5 months :)

    Open-Source Regards, Khalid Al-Kary

    _________________________________________________________________ The new MSN 8: smart spam protection and 2 months FREE* http://join.msn.com/?page=features/junkmail

    attached mail follows:


    "Brian McGarvie" <brian.mcgarvieanypurposeloans.co.uk> wrote... :

    > The 'problem' with ASP is that it really requires a Windows platform...

    Depends where. C# has a Linux platform called `mono'. It is not as good as MS' native enviroment, but can work.

    > and > while Unix is still primarily the OS of choice for web-servers then ASP & > PHP will 'co-exist' there will always be a PHP and ASP camp...

    Microsoft now works hard on porting their applicaytions to Linux enviroment. Guess why? Because Linux is a better server for web while ASP has some tricks that many would like to pay and use. At that point MS decided to also work on Linux.

    > I have very little ASP experiance, but that has cost me the oppertinity to > apply for several well-paying jobs, as there is very few PHP positions > around - I'm speaking for the UK market here.

    Not that few, even in UK (as far as I know).

    --
    Maxim Maletsky
    maximphp.net
    

    attached mail follows:


    > -----Original Message----- > From: soazinepop.erols.com [mailto:soazinepop.erols.com] > Sent: 16 January 2003 14:35 > To: m.fordlmu.ac.uk

    Copying this back to the list, in case anyone else can contribute (although I think the attachments will be stripped -- can you make them available on a URL?).

    > > Ok, there they are, but they are quite large in size, I warn you. > > Basic concept is this: > > view.php: It will require display.php > display.php: It will open a file (profile.xml), perform xml > parsing into a > 3-dim array of content, $profileArray > view.php: will parse contents of $profileArray and display > flagged profile > set up by $profileArray[$index]

    Yes, I understand (although no having used the XML functions, I can't vouvh for the validity of your parsing strategy!).

    > > The problem is that $profileArray and $index both seem to vanish upon > exiting the required code of display.php unless I store them > in a session > variable.

    Well, as you're using old-style $HTTP_SESSION_VARS session variables, these should act identically to any other variables in your script vis-a-vis the include file. And I can't see any reason why your $profileArray shouldn't be exactly what you want it to be in view.php. So, let's try a bit of simple debugging: what do you see if you put

    echo '<pre>var_dump='; var_dump($index, $profileArray[$index]); echo "</pre>\n";

    as the very last bit of PHP in display.php, and the same in view.php immediately after the include statement (before the echo "4profileUserID...")? You should get identical results (even if wrong ones!) -- if not, something *very* weird is happening.

    Cheers!

    Mike

    --------------------------------------------------------------------- Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning & Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: m.fordlmu.ac.uk Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211

    attached mail follows:


    I just JUST installed PHP onto a new server (my first--kinda scary, new foray) and my pre-defined constants (HTTP_SERVER, SCRIPT_NAME, etc.) aren't being set. Any ideas? What switch do I have to flick?

    __________________________________________________ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com

    attached mail follows:


    > -----Original Message----- > From: Mako Shark [mailto:phpman2000yahoo.com] > Sent: 16 January 2003 15:26 > To: php-generallists.php.net > Subject: [PHP] No constants being set. HUH? > > > I just JUST installed PHP onto a new server (my > first--kinda scary, new foray) and my pre-defined > constants (HTTP_SERVER, SCRIPT_NAME, etc.)

    Not predefined constants, predefined *global variables* -- and there's the clue.

    > aren't > being set. Any ideas? What switch do I have to flick?

    Almost certainly register_globals -- but don't! (Unless you have legacy code that must run asap.) Much better to leave register_globals=Off and get used to using the superglobal arrays -- in this case, you will want (iirc) $_SERVER['HTTP_SERVER'] and $_SERVER['SCRIPT_NAME'].

    For more on this topic, refer to the manula page on Predefined variables: http://www.php.net/manual/en/language.variables.predefined.php

    Cheers!

    Mike

    --------------------------------------------------------------------- Mike Ford, Electronic Information Services Adviser, Learning Support Services, Learning & Information Services, JG125, James Graham Building, Leeds Metropolitan University, Beckett Park, LEEDS, LS6 3QS, United Kingdom Email: m.fordlmu.ac.uk Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211

    attached mail follows:


    on 16/01/03 11:59 PM, Marek Kilimajer (kilimajerwebglobe.sk) wrote:

    > If the server crashes, it is definetly NOT fault of your scripts, the > server/php should return errors when there is something wrong, not > crash. Remember that on multithreaded server you are taking other > requests down too. The server, php, some extenssion might have been > miscompiled, wrong versions of libraries are used, there is a bug, > anything. But you should not be able to take server down from a script > language. > Take a look at extenssions used, if any of them is unstable/experimental

    Well, I know *I* aren't using any extensions that you wouldn't find in a base install.

    Thanks for the words of encouragement though :)

    Justin

    > Justin French wrote: > >> Just as an update, the sysadmin definitely thinks it's my code... I'm not >> convinced, but I'm faced with the task of finding out :) >> >> >> >>> It appears your site is causing the webserver to segfault (crash), which is >>> why nothing comes up some times - these crashes are logged in the main >>> Apache >>> logfile, which is why you saw nothing in your site logfile when this >>> happened. >>> I don't know exactly what is causing it to crash, but it is definately >>> something in your PHP code. >>> >>> >> >> I asked for a copy of the logfiles she talked about: >> >> >> >>> [Wed Jan 15 08:23:32 2003] [notice] child pid 8153 exit signal Segmentation >>> fault (11) >>> [Wed Jan 15 08:34:57 2003] [notice] child pid 7702 exit signal Segmentation >>> fault (11) >>> [Wed Jan 15 08:34:58 2003] [notice] child pid 7366 exit signal Segmentation >>> fault (11) >>> [Wed Jan 15 08:34:59 2003] [notice] child pid 7511 exit signal Segmentation >>> fault (11) >>> [Wed Jan 15 08:35:00 2003] [notice] child pid 7512 exit signal Segmentation >>> fault (11) >>> >>> >>> >> >> Not very helpfull :) >> >> >> As far as I can tell, the error I receive (basically a "document contained >> no data" error) is the result of the server shitting itself because of >> ANOTHER script on my site, that was accessed before it. >> >> This makes debugging even worse, because I don't even know what script to >> look in! >> >> It could be in any include()'d file in my header or footer, or the guts of >> any script on my site!! Yay!! >> >> >> The other possibility is that the crash occurs on the actual script I'm >> calling, which IS a bit easier to debug... I think! >> >> >> The sysadmin has pretty much ruled out memory leaks: >> >> >> >>> I checked the httpd processes >>> to see if any memory was leaking (if the memory usage climbs constantly, >>> memory is being leaked), but it was all fine. >>> >>> >> >> >> Has any one got any suggestions on how I might track down this bug, or >> ascertain which script/include file is causing the server to segfault? >> >> >> Justin >> >> >> >> >

    attached mail follows:


    Someone else might be, you just happened to request a page from the same server process

    Justin French wrote:

    >on 16/01/03 11:59 PM, Marek Kilimajer (kilimajerwebglobe.sk) wrote: > > > >>If the server crashes, it is definetly NOT fault of your scripts, the >>server/php should return errors when there is something wrong, not >>crash. Remember that on multithreaded server you are taking other >>requests down too. The server, php, some extenssion might have been >>miscompiled, wrong versions of libraries are used, there is a bug, >>anything. But you should not be able to take server down from a script >>language. >>Take a look at extenssions used, if any of them is unstable/experimental >> >> > >Well, I know *I* aren't using any extensions that you wouldn't find in a >base install. > >Thanks for the words of encouragement though :) > >Justin > > > > > > >>Justin French wrote: >> >> >> >>>Just as an update, the sysadmin definitely thinks it's my code... I'm not >>>convinced, but I'm faced with the task of finding out :) >>> >>> >>> >>> >>> >>>>It appears your site is causing the webserver to segfault (crash), which is >>>>why nothing comes up some times - these crashes are logged in the main >>>>Apache >>>>logfile, which is why you saw nothing in your site logfile when this >>>>happened. >>>>I don't know exactly what is causing it to crash, but it is definately >>>>something in your PHP code. >>>> >>>> >>>> >>>> >>>I asked for a copy of the logfiles she talked about: >>> >>> >>> >>> >>> >>>>[Wed Jan 15 08:23:32 2003] [notice] child pid 8153 exit signal Segmentation >>>>fault (11) >>>>[Wed Jan 15 08:34:57 2003] [notice] child pid 7702 exit signal Segmentation >>>>fault (11) >>>>[Wed Jan 15 08:34:58 2003] [notice] child pid 7366 exit signal Segmentation >>>>fault (11) >>>>[Wed Jan 15 08:34:59 2003] [notice] child pid 7511 exit signal Segmentation >>>>fault (11) >>>>[Wed Jan 15 08:35:00 2003] [notice] child pid 7512 exit signal Segmentation >>>>fault (11) >>>> >>>> >>>> >>>> >>>> >>>Not very helpfull :) >>> >>> >>>As far as I can tell, the error I receive (basically a "document contained >>>no data" error) is the result of the server shitting itself because of >>>ANOTHER script on my site, that was accessed before it. >>> >>>This makes debugging even worse, because I don't even know what script to >>>look in! >>> >>>It could be in any include()'d file in my header or footer, or the guts of >>>any script on my site!! Yay!! >>> >>> >>>The other possibility is that the crash occurs on the actual script I'm >>>calling, which IS a bit easier to debug... I think! >>> >>> >>>The sysadmin has pretty much ruled out memory leaks: >>> >>> >>> >>> >>> >>>>I checked the httpd processes >>>>to see if any memory was leaking (if the memory usage climbs constantly, >>>>memory is being leaked), but it was all fine. >>>> >>>> >>>> >>>> >>>Has any one got any suggestions on how I might track down this bug, or >>>ascertain which script/include file is causing the server to segfault? >>> >>> >>>Justin >>> >>> >>> >>> >>> >>> > > > >

    attached mail follows:


    I wrote a simple test script which increments a sessions counter, as per the manual. That way they couldn't complain about having to debug mountains of code, etc etc.

    Intead of the usual 1,2,3,4,5...50 it was more like 1,2,3,0,4,5,1,6,7,2,8,9,3

    I emailed them, and they've switched the sessions over from 'mm' (memory) to 'files' for the moment... and we'll see if that works.

    I *think* one of the accounts on the server is triggering the segfaults (not me!), which in tuen is hurthing the server, sessions, etc.

    Just thought I'd let everyone know where it's at :)

    Justin

    attached mail follows:


    Hi all,

    When I make a form in a web site for a visitor to send me some comments, I use nl2br() to put things like line breaks and see what the visitor wants me to see.

    But what happens if I have a web form to input some text into a TEXT cell in MySQL and want to retrieve it like I wrote it? Should I use nl2br too? How should I use it and What's gonna end up stored in the DB?

    Thanks in advance,

    Cesar L. Aracena icaamicaam.com.ar caracenainfovia.com.ar (0299) 156-356688 Neuquén (8300) Capital Argentina

    attached mail follows:


    --- Cesar Aracena <icaamicaam.com.ar> wrote: > When I make a form in a web site for a visitor to > send me some comments, I use nl2br() to put things > like line breaks and see what the visitor wants me > to see. > > But what happens if I have a web form to input some > text into a TEXT cell in MySQL and want to retrieve > it like I wrote it?

    My advice is to store in MySQL exactly what the user types. This way, you can decide when you retrieve this data whether you want to display it on a page (in which case you would use nl2br) or display it in a text field for editing (in which case you would leave the data raw).

    Chris

    attached mail follows:


    "Chris Shiflett" <shiflettphp.net> wrote in message news:20030116155612.86000.qmailweb14306.mail.yahoo.com... > --- Cesar Aracena <icaamicaam.com.ar> wrote: > > When I make a form in a web site for a visitor to > > send me some comments, I use nl2br() to put things > > like line breaks and see what the visitor wants me > > to see. > > > > But what happens if I have a web form to input some > > text into a TEXT cell in MySQL and want to retrieve > > it like I wrote it? > > My advice is to store in MySQL exactly what the user types. > This way, you can decide when you retrieve this data > whether you want to display it on a page (in which case you > would use nl2br) or display it in a text field for editing > (in which case you would leave the data raw). > > Chris

    Condier using mysql_escape_string() before inserting into your table to protect your database server from simple attacks

    g

    attached mail follows:


    Hello,

    I want to build an object oriented application and i don't know how to do it. Should i store everything in class instances and let those object communicate with each other? I think that would be the real OOP. I need some articles, tutorials or just people with experience in building OO-applications with PHP.

    Please help!

    Hannes Smit

    attached mail follows:


    $_SERVER['SERVER_ADDR'] gives the address of the server running the php script $_SERVER['REMOTE_ADDR'] gives the client address or the proxy address. (be careful here, storing a proxy's IP is next to useless) $_SERVER[' HTTP_X_FORWARDED_FOR'] gives the client address if they're behind a proxy (if this isn't set then they probably aren't behind a proxy so you can use the remote_addr instead)

    HTH

    Danny.

    ----- Original Message ----- From: "Kyle Lampkin" <KyleTexan62netscape.net> To: <php-generallists.php.net> Sent: Wednesday, January 15, 2003 11:41 PM Subject: [PHP] Getting a dynamic IP address

    > Hello all, > Newbie here---- I need to know if there is a way I can get my dynamic IP > address for use in a php script? > -- > Your favorite stores, helpful shopping tools and great gift ideas. > Experience the convenience of buying online with ShopNetscape! > http://shopnow.netscape.com/ > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    Hello friends.

    I want ot redirect users to another page after successful login. Can someone please help me with the PHP code for redirecting? Or point me to some help page?

    thanks denis

    attached mail follows:


    php.net/header check out the examples

    Andrew ----- Original Message ----- From: "Denis L. Menezes" <menezesdsingnet.com.sg> To: "PHP general list" <php-generallists.php.net> Sent: Thursday, January 16, 2003 4:21 PM Subject: [PHP] Redirecting

    Hello friends.

    I want ot redirect users to another page after successful login. Can someone please help me with the PHP code for redirecting? Or point me to some help page?

    thanks denis

    attached mail follows:


    --- "Denis L. Menezes" <menezesdsingnet.com.sg> wrote: > I want ot redirect users to another page after successful > login. Can someone please help me with the PHP code for > redirecting?

    You have many options:

    1. After a successful login, display the proper page to the user instead of redirecting. This is my preference. 2. Use a Location header to cause a protocol-level redirect. For example, header("Location: http://www.google.com/"); 3. Use an HTML meta tag for redirecting.

    Chris

    attached mail follows:


    > directly. My main question is if all of the code inside an included PHP file > is put inside one or more functions this should prevent anyone from running > any of that code by directly calling that PHP file correct? There is no way > for them to invoke a function just from a URL assuming I have no code at all > outside the functions. Just a small tip : to be *sure* that no one runs directly my included files, they begin with

    if (basename($_ENV["SCRIPT_NAME"]) != 'index.php') { // redirection }

    So, even if the code is not in a function or class, I'm safe. Am I wrong or do you think it could be ok? Regards, Philippe

    attached mail follows:


    This should work as long as you are only including your include files from scripts named index.php.

    --Jacob

    "Philippe Saladin" <pheuhyahoo.fr> wrote in message news:20030116162456.43467.qmailpb1.pair.com... > > directly. My main question is if all of the code inside an included PHP > file > > is put inside one or more functions this should prevent anyone from > running > > any of that code by directly calling that PHP file correct? There is no > way > > for them to invoke a function just from a URL assuming I have no code at > all > > outside the functions. > Just a small tip : to be *sure* that no one runs directly my included files, > they begin with > > if (basename($_ENV["SCRIPT_NAME"]) != 'index.php') { > // redirection > } > > So, even if the code is not in a function or class, I'm safe. > Am I wrong or do you think it could be ok? > Regards, > Philippe > >

    attached mail follows:


    Well, here's your chance to criticize a newbie.

    As an exercise in learning PHP I have written a rot-13 script. It is at http://hutnick.com/rot13/index.html?show_content=1 .

    I'm soliciting comments on style, technique, etc. Be brutal, but don't get your feelings hurt if I don't take your comments as gospel. References will help me take comments to heart.

    It will be easier on me if you send or CC comments to phphutnick.com.

    Thanks a million!

    -Peter

    attached mail follows:


    "Peter Hutnick" <peter-listshutnick.com> wrote in message news:19020.170.186.97.230.1042735219.squirrelbilbo.hutnick.com... > I'm soliciting comments on style, technique, etc. Be brutal, but don't > get your feelings hurt if I don't take your comments as gospel. > References will help me take comments to heart.

    Heck, I don't have anything better to do at the moment anyway. All I can say in first, I will not judge your style - it's all up to you.

    Now, first of all, why did you this:

    <?php echo("<?xml version=\"1.0\" encoding=\"UTF-8\" ?>"); ?>

    and not just:

    <?xml version="1.0" encoding="UTF-8" ?>

    ? Less parsing for PHP :P

    But other than that, I couldn't find anything very wrong about it... only that I personally prefer to call a print() statement for everything, and don't use PHP as an embedded language but just as a normal programming language... But that's just me :P

    Hope this helps you a little bit...

    Regards,

    Leon Mergen http://www.antrophia.com/

    attached mail follows:


    Leon Mergen said:

    > Now, first of all, why did you this: > > <?php echo("<?xml version=\"1.0\" encoding=\"UTF-8\" ?>"); ?> > > and not just: > > <?xml version="1.0" encoding="UTF-8" ?>

    Because short tags are evil ;-) My provider has short tags enabled, so there is no getting around this bit of ugliness.

    > only that I personally prefer to call a print() statement for > everything

    Do you mean as opposed to echo?

    If so, would you mind saying a few word as to why?

    I read that echo is a "language construct." It seems like it would be preferable to print() for this reason. On top of that, it will take multiple strings as input. I think I will remove the parentheses, though.

    -Peter

    attached mail follows:


    on 17/01/03 5:44 AM, Peter Hutnick (peter-listshutnick.com) wrote:

    > Because short tags are evil ;-) My provider has short tags enabled, so > there is no getting around this bit of ugliness.

    Can you set the php.ini value to disallow short tags locally via a .htaccess file??

    Justin

    attached mail follows:


    thx for the replies

    Miguel "Maxim Maletsky" <maximphp.net> escreveu na mensagem news:20030115183736.5DDC.MAXIMphp.net...

    mail() function http://php.net/mail

    --
    Maxim Maletsky
    maximphp.net
    

    "Miguel Brás" <molino26netcabo.pt> wrote... :

    > Hi gents, > > i have a script to manage the registered users on my site. > have also a table with id, name, uname, passwrd, email, datejoined, level > and status > > my question is... > it there any possibility to inform a member by mail that his (let'say) > current status changed from inactive to active, or from active to inactive? > I mean, whenever a change occur on member's details, a mail is sent to him > telling what was changed. Any posssibility? > > Miguel > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    Hi,

    i made a page to display some user details and then clicking on the user name it goes to another page to send a mail via mail() function.

    here is the line of the first page <td width="20%" align="center"><b><font face="Arial" size="1" color="#808080"><a href="mail_active.php?email=$email"><? echo $row->name; ?></a></font></b></td>

    when click on user name, it goes to the mail_active.php?email=xxxxxx.com

    on the mail_active.php page, how do I get the e-mail address to send? I mean, the mail function is mail ("$to","$subject","$message","From: $sender"); How can I take the $to string to be xxxxxx.com?

    Miguel

    attached mail follows:


    I don't know how do you get this answer, but try this: <a href="email=$email"><? echo $row->name; ?></a></font></b></td>

    Rafael Rodrigo

    > Hi, > > i made a page to display some user details and then clicking on the user > name it goes to another page to send a mail via mail() function. > > here is the line of the first page > <td width="20%" align="center"><b><font face="Arial" size="1" > color="#808080"><a href="mail_active.php?email=$email"><? echo $row->name; > ?></a></font></b></td> > > when click on user name, it goes to the mail_active.php?email=xxxxxx.com > > on the mail_active.php page, how do I get the e-mail address to send? > I mean, the mail function is mail ("$to","$subject","$message","From: > $sender"); > How can I take the $to string to be xxxxxx.com? > > Miguel > >

    attached mail follows:


    Hi,

    If you have a URL like: schmoe.com">http://www.whatever.com/page.php?email=joeschmoe.com

    Then in your script $email will already be set to "joeschmoe.com".

    This depends on register_globals being on, if I remember correctly, and you'll want to be aware of the order for variable assignment (for POST, GET, cookie, and session variables).

    Thanks, Brian Allen

    > -----Original Message----- > From: Rafael Rodrigo - NSI [mailto:rafaelnsinet.com.br] > Sent: Thursday, January 16, 2003 12:03 PM > To: php-generallists.php.net > Subject: [PHP] Re: get the $email string > > > I don't know how do you get this answer, but try this: > <a href="email=$email"><? echo $row->name; > ?></a></font></b></td> > > Rafael Rodrigo > > > Hi, > > > > i made a page to display some user details and then > clicking on the user > > name it goes to another page to send a mail via mail() function. > > > > here is the line of the first page > > <td width="20%" align="center"><b><font face="Arial" size="1" > > color="#808080"><a href="mail_active.php?email=$email"><? > echo $row->name; > > ?></a></font></b></td> > > > > when click on user name, it goes to the > mail_active.php?email=xxxxxx.com > > > > on the mail_active.php page, how do I get the e-mail > address to send? > > I mean, the mail function is mail > ("$to","$subject","$message","From: > > $sender"); > > How can I take the $to string to be xxxxxx.com? > > > > Miguel > > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > >

    attached mail follows:


    At 5:04 PM +0000 1/16/03, Miguel Br·s wrote: >Hi, > >i made a page to display some user details and then clicking on the user >name it goes to another page to send a mail via mail() function. > >here is the line of the first page ><td width="20%" align="center"><b><font face="Arial" size="1" >color="#808080"><a href="mail_active.php?email=$email"><? echo $row->name; >?></a></font></b></td> > >when click on user name, it goes to the mail_active.php?email=xxxxxx.com > >on the mail_active.php page, how do I get the e-mail address to send? >I mean, the mail function is mail ("$to","$subject","$message","From: >$sender"); >How can I take the $to string to be xxxxxx.com?

    IN this case you could use

    mail ($_GET['email'],"$subject","$message","From:$sender"); or mail ($_REQUEST['email'],"$subject","$message","From:$sender");

    See http://www.php.net/manual/en/language.variables.external.php

    for more information on variable handling.

    Also keep in mind that the script as you've shown it is looks very insecure; anybody, including joe-spammer, could send mails to people simply by calling your URL

    zzz.com">http://your.domain/mail_active.php?email=random_personzzz.com

    It's best to pass some sort of obscure ID instead of the data. I would check out the use of sessions here:

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

    -steve

    -- 
    +------------------------------------------------------------------------+
    | Steve Edberg                                      sbedbergucdavis.edu |
    | University of California, Davis                          (530)754-9127 |
    | Programming/Database/SysAdmin               http://pgfsun.ucdavis.edu/ |
    +------------------------------------------------------------------------+
    | SETIHome: 1001 Work units on 23 oct 2002                              |
    | 3.152 years CPU time, 3.142 years SETI user... and STILL no aliens...  |
    +------------------------------------------------------------------------+
    

    attached mail follows:


    I tried. But I get an error as follows :

    Warning: Cannot add header information - headers already sent by (output started at /usr/local/www/virtual2/66/175/19/84/html/maintenance.php:11) in /usr/local/www/virtual2/66/175/19/84/html/maintenance.php on line 30

    My code is as follows:

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body bgcolor="#FFFFCC"> <table width="70%" border="0"> <tr> <td height="67" colspan="3" bgcolor="#330066"> <div align="center"><font color="#FFFF00" face="Arial, Helvetica, sans-serif"><strong><font size="5">Site maintenance page<?php //connecting to the database $link = mysql_connect("localhost","mydomain","somepass"); if ($link){ Print ""; } else { Print "No connection to the database"; } if (!mysql_select_db("mydomain_com")){ Print "Couldn't connect database"; } else { Print ""."<br>\n"; } $sql="SELECT AdminFirstName,AdminLoginId,AdminPassword FROM Administrators where AdminLoginId = '$AdminLoginId' and AdminPassword ='$AdminPassword'"; if ($result=mysql_query($sql)) { $numofrows=mysql_num_rows($result); if ($numofrows==0){ header("Location: http://www.php-faq.com/"); Print "<STRONG><font color=\"#FF0000\"size=\"3\">We are sorry.</STRONG></FONT>"; } if ($numofrows==1){ Print "<font size=\"3\" color=\#ff0000\">Welcome ".$AdminFirstName."<Font>"; } if ($numofrows>1){ Print "<STRONG>Something wrong</STRONG>"; } while($row=mysql_fetch_array($result)){ Print"<Font size=\"3\">$row[AdminFirstName]</font>"; }

    } ?></font></strong></font></div></td> </tr> </table> </body> </html>

    Unquote.

    Line no. 30 is the one with the line : header("Location: http://www.php-faq.com/");

    Can you please tell me what is wrong?

    thanks denis

    attached mail follows:


    On Friday 17 January 2003 01:07, Denis L. Menezes wrote: > I tried. But I get an error as follows : > > Warning: Cannot add header information - headers already sent by (output

    Try searching the archives on the above error.

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

    /* Stenderup's Law: The sooner you fall behind, the more time you will have to catch up. */

    attached mail follows:


    I ahve tried everything jason. It says that there should be no output before the header().

    I cannot still find the error. Can you please help in locating the error?

    thanks Denis ----- Original Message ----- From: "Jason Wong" <php-generalgremlins.biz> To: <php-generallists.php.net> Sent: Friday, January 17, 2003 1:10 AM Subject: Re: [PHP] Redirecting - here is the code

    > On Friday 17 January 2003 01:07, Denis L. Menezes wrote: > > I tried. But I get an error as follows : > > > > Warning: Cannot add header information - headers already sent by (output > > Try searching the archives on the above error. > > -- > Jason Wong -> Gremlins Associates -> www.gremlins.biz > Open Source Software Systems Integrators > * Web Design & Hosting * Internet & Intranet Applications Development * > > /* > Stenderup's Law: > The sooner you fall behind, the more time you will have to catch up. > */ > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php

    attached mail follows:


    You cannot have ANY output b4 sending a header unless you are buffering your output. In your example you are sending HTML before your redirect - the redirect has to happen before you do any kind of HTML or any characters that would get output to the browser.

    On 1/16/03 12:40 PM, "Denis L. Menezes" <menezesdsingnet.com.sg> wrote:

    > I ahve tried everything jason. It says that there should be no output before > the header(). > > I cannot still find the error. Can you please help in locating the error? > > thanks > Denis > ----- Original Message ----- > From: "Jason Wong" <php-generalgremlins.biz> > To: <php-generallists.php.net> > Sent: Friday, January 17, 2003 1:10 AM > Subject: Re: [PHP] Redirecting - here is the code > > >> On Friday 17 January 2003 01:07, Denis L. Menezes wrote: >>> I tried. But I get an error as follows : >>> >>> Warning: Cannot add header information - headers already sent by (output >> >> Try searching the archives on the above error. >> >> -- >> Jason Wong -> Gremlins Associates -> www.gremlins.biz >> Open Source Software Systems Integrators >> * Web Design & Hosting * Internet & Intranet Applications Development * >> >> /* >> Stenderup's Law: >> The sooner you fall behind, the more time you will have to catch up. >> */ >> >> >> -- >> PHP General Mailing List (http://www.php.net/) >> To unsubscribe, visit: http://www.php.net/unsub.php >

    --
    Cheers
    

    Mike Morton

    **************************************************** * * E-Commerce for Small Business * http://www.dxstorm.com * * DXSTORM.COM * 824 Winston Churchill Blvd, * Oakville, ON, CA L6J 7X2 * Tel: 905-842-8262 * Fax: 905-842-3255 * Toll Free: 1-877-397-8676 * ****************************************************

    "Indeed, it would not be an exaggeration to describe the history of the computer industry for the past decade as a massive effort to keep up with Apple." - Byte Magazine

    Given infinite time, 100 monkeys could type out the complete works of Shakespeare. Win 98 source code? Eight monkeys, five minutes. -- NullGrey

    attached mail follows:


    Hi!

    From manual (http://www.php.net/manual/en/function.header.php): Remember that header() must be called before any actual output is sent, either by normal HTML tags, blank linek in a file, or from PHP. You need to start with header()...

    Example: <?php header('Location: http://www.example.com/'); ?> <html>

    or you can use ob_start and ob_end_flush();

    Best Regards

    ----- Original Message ----- From: "Denis L. Menezes" <menezesdsingnet.com.sg> To: "PHP general list" <php-generallists.php.net> Sent: Thursday, January 16, 2003 6:07 PM Subject: [PHP] Redirecting - here is the code

    I tried. But I get an error as follows :

    Warning: Cannot add header information - headers already sent by (output started at /usr/local/www/virtual2/66/175/19/84/html/maintenance.php:11) in /usr/local/www/virtual2/66/175/19/84/html/maintenance.php on line 30

    My code is as follows:

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body bgcolor="#FFFFCC"> <table width="70%" border="0"> <tr> <td height="67" colspan="3" bgcolor="#330066"> <div align="center"><font color="#FFFF00" face="Arial, Helvetica, sans-serif"><strong><font size="5">Site maintenance page<?php //connecting to the database $link = mysql_connect("localhost","mydomain","somepass"); if ($link){ Print ""; } else { Print "No connection to the database"; } if (!mysql_select_db("mydomain_com")){ Print "Couldn't connect database"; } else { Print ""."<br>\n"; } $sql="SELECT AdminFirstName,AdminLoginId,AdminPassword FROM Administrators where AdminLoginId = '$AdminLoginId' and AdminPassword ='$AdminPassword'"; if ($result=mysql_query($sql)) { $numofrows=mysql_num_rows($result); if ($numofrows==0){ header("Location: http://www.php-faq.com/"); Print "<STRONG><font color=\"#FF0000\"size=\"3\">We are sorry.</STRONG></FONT>"; } if ($numofrows==1){ Print "<font size=\"3\" color=\#ff0000\">Welcome ".$AdminFirstName."<Font>"; } if ($numofrows>1){ Print "<STRONG>Something wrong</STRONG>"; } while($row=mysql_fetch_array($result)){ Print"<Font size=\"3\">$row[AdminFirstName]</font>"; }

    } ?></font></strong></font></div></td> </tr> </table> </body> </html>

    Unquote.

    Line no. 30 is the one with the line : header("Location: http://www.php-faq.com/");

    Can you please tell me what is wrong?

    thanks denis

    attached mail follows:


    I think your problem is with the <meta> tag <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <-- header

    Also I'm not sure but the <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> might cause problems too

    Try the if statement at the top of the document.

    One more thing. I think that you can't add header info after <head>, but I'm not sure about this.

    What I usually use for redirection is something like: (a page after the LOGIN page that check for correct/incorrect logins) <?php // IF LOGIN SUCCESSFUL if ($enter == "1") { echo" <script> top.location=\"cms_home.php\" </script> "; // IF NOT (you can display HTML here instead of redirecting) } else { echo" <script> top.location=\"cms_index.php\" </script> "; } ?>

    I hope that helps

    Mario _________________________ Marios Adamantopoulos Senior Developer

    Tonic +44 (0)20 7691 2227 +44 (0)7970 428 372 www.tonic.co.uk

    Recent projects www.polydor.co.uk www.adcecreative.org www.sony-europe.com/pocketlife ............................................................................ .................................... Opinions, conclusions and other information in this message that do not relate to the official business of Tonic Design Limited shall be understood as neither given nor endorsed by them. ............................................................................ ....................................

    -----Original Message----- From: Denis L. Menezes [mailto:menezesdsingnet.com.sg] Sent: 16 January 2003 17:07 To: PHP general list Subject: [PHP] Redirecting - here is the code

    I tried. But I get an error as follows :

    Warning: Cannot add header information - headers already sent by (output started at /usr/local/www/virtual2/66/175/19/84/html/maintenance.php:11) in /usr/local/www/virtual2/66/175/19/84/html/maintenance.php on line 30

    My code is as follows:

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body bgcolor="#FFFFCC"> <table width="70%" border="0"> <tr> <td height="67" colspan="3" bgcolor="#330066"> <div align="center"><font color="#FFFF00" face="Arial, Helvetica, sans-serif"><strong><font size="5">Site maintenance page<?php //connecting to the database $link = mysql_connect("localhost","mydomain","somepass"); if ($link){ Print ""; } else { Print "No connection to the database"; } if (!mysql_select_db("mydomain_com")){ Print "Couldn't connect database"; } else { Print ""."<br>\n"; } $sql="SELECT AdminFirstName,AdminLoginId,AdminPassword FROM Administrators where AdminLoginId = '$AdminLoginId' and AdminPassword ='$AdminPassword'"; if ($result=mysql_query($sql)) { $numofrows=mysql_num_rows($result); if ($numofrows==0){ header("Location: http://www.php-faq.com/"); Print "<STRONG><font color=\"#FF0000\"size=\"3\">We are sorry.</STRONG></FONT>"; } if ($numofrows==1){ Print "<font size=\"3\" color=\#ff0000\">Welcome ".$AdminFirstName."<Font>"; } if ($numofrows>1){ Print "<STRONG>Something wrong</STRONG>"; } while($row=mysql_fetch_array($result)){ Print"<Font size=\"3\">$row[AdminFirstName]</font>"; }

    } ?></font></strong></font></div></td> </tr> </table> </body> </html>

    Unquote.

    Line no. 30 is the one with the line : header("Location: http://www.php-faq.com/");

    Can you please tell me what is wrong?

    thanks denis

    attached mail follows:


    With regards to Marek, I don't see how there would be two queries, because there row conisists of image properties and image data. So when i select the required row(s), I will have properties and images. So it will be 1 query, of course it is a big (size-wise) query.

    With regards to Jason, Your approach is reasonable. I guess I will have to judge for myself!

    "Bobby Patel" <anup_patelrogers.com> wrote in message news:20030116051912.28848.qmailpb1.pair.com... > Hello, > I have the Images table setup with columns (width, height, size, type, > etc...) the question is should I have the image data stored in this table or > disk? > > I know, alot of people have said it is faster in disk, which is 1 page I/O. > But I need these images for displaying product pages, and I believe that it > would be faster to just pluck the properties from the dB (including the > image file) . > > Usually I will need to pull 6 or 10 images per page, this is my rational for > this situation: > > If all stored on db: > One query - will take about 4-5 page I/O (assumiing index on filename) > > If just properties stored on dB and image on disk: > One query to grab the rows of properties - 2-3 page I/O > to grab 6 or 10 images - 6 or 10 page I/O > Total - 8 - 13 Page I/O's > > If all images stored on disk, no dB whatso ever: > to grab 6 or 10 images - 6 or 10 page I/O > cpu time to run getimagesize() for each image - CPU time unknown? > > I assume that "page I/O" is that same as "disk access". > > I AGREE that storing images strored on disk is a valid approach PROVIDED > that you only need 1 image per page, but if you need to grab a bunch at a > time, I do beleieve that storing the actual file on the dB is faster. > > I would like to hear from the list, of people that have worked with images > and PHP. I just started with images, so I just want to take the right path. > >

    attached mail follows:


    You must remember that Images are embedded in HTML using the <img> tag. Each image displayed on a Webpage is a result of a seperate HTTP request to the server; i.e. a PHP call in this case. Unless you are cache the SQL result, at least one query is needed per image.

    Regards, Daniel Kushner _________________________________________ Need hosting? http://thehostingcompany.us

    > -----Original Message----- > From: Bobby Patel [mailto:anup_patelrogers.com] > Sent: Thursday, January 16, 2003 12:34 PM > To: php-generallists.php.net > Subject: [PHP] Re: Images : Store in dB or disk? > > > With regards to Marek, > I don't see how there would be two queries, because there row conisists of > image properties and image data. So when i select the required row(s), I > will have properties and images. So it will be 1 query, of course it is a > big (size-wise) query. > > With regards to Jason, > Your approach is reasonable. I guess I will have to judge for myself! > > > > "Bobby Patel" <anup_patelrogers.com> wrote in message > news:20030116051912.28848.qmailpb1.pair.com... > > Hello, > > I have the Images table setup with columns (width, height, size, type, > > etc...) the question is should I have the image data stored in > this table > or > > disk? > > > > I know, alot of people have said it is faster in disk, which is 1 page > I/O. > > But I need these images for displaying product pages, and I believe that > it > > would be faster to just pluck the properties from the dB (including the > > image file) . > > > > Usually I will need to pull 6 or 10 images per page, this is my rational > for > > this situation: > > > > If all stored on db: > > One query - will take about 4-5 page I/O (assumiing index on filename) > > > > If just properties stored on dB and image on disk: > > One query to grab the rows of properties - 2-3 page I/O > > to grab 6 or 10 images - 6 or 10 page I/O > > Total - 8 - 13 Page I/O's > > > > If all images stored on disk, no dB whatso ever: > > to grab 6 or 10 images - 6 or 10 page I/O > > cpu time to run getimagesize() for each image - CPU time unknown? > > > > I assume that "page I/O" is that same as "disk access". > > > > I AGREE that storing images strored on disk is a valid approach PROVIDED > > that you only need 1 image per page, but if you need to grab a > bunch at a > > time, I do beleieve that storing the actual file on the dB is faster. > > > > I would like to hear from the list, of people that have worked > with images > > and PHP. I just started with images, so I just want to take the right > path. > > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php

    attached mail follows:


    Hi guys I have upgraded from PHP 4.2.2 to PHP 4.3.0 and some of my php script got broken due to that. This scripts use backticks to execute functions, the problem is the environment where that functions are executed.

    I have this test code: <?php $dir=`pwd`; echo "I am on directory: $dir"; ?>

    If I execute this code using PHP 4.2.2 I get this result:

    roottest:/root# php /var/www/html/test.php I am on directory: /var/www/html

    If I execute this code using PHP 4.3.0 I get this different result: roottest:/root# php /var/www/html/test.php I am on directory: /root

    I have not touched php.ini from one version to the other (I'm still using my one), I'm with safe_mode = Off so it should not affect this.

    Anybody have a clue about if this is a bug or is a feature of the new version? I'm really confused about it.

    Best Regards

    attached mail follows:


    On Friday 17 January 2003 01:37, Marc Cluet wrote: > Hi guys > I have upgraded from PHP 4.2.2 to PHP 4.3.0 and some of my php script > got broken due to that. > This scripts use backticks to execute functions, the problem is the > environment where that functions are executed. > > I have this test code: > <?php > $dir=`pwd`; > echo "I am on directory: $dir"; > ?> > > If I execute this code using PHP 4.2.2 I get this result: > > roottest:/root# php /var/www/html/test.php > I am on directory: /var/www/html > > If I execute this code using PHP 4.3.0 I get this different result: > roottest:/root# php /var/www/html/test.php > I am on directory: /root > > I have not touched php.ini from one version to the other (I'm still > using my one), I'm with safe_mode = Off so it should not affect this. > > Anybody have a clue about if this is a bug or is a feature of the new > version? I'm really confused about it.

    You're probably using the CLI version of PHP (which is built by default starting with 4.3) as opposed to the earlier CGI versions.

    manual > "Using PHP from the command line"

    tells you the differences between CLI and CGI, one of them being "it does not change the working directory to that of the script".

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

    /* Can you buy friendship? You not only can, you must. It's the only way to obtain friends. Everything worthwhile has a price. -- Robert J. Ringer */

    attached mail follows:


    I'm running PHP 4.3 and W2k with IIS 5.0. I have enabled php_gd and it does show up when I do a phpinfo. The php_gd.dll is in the winnt/system32 directory (I've also tried it in almost every other directory too) and I get these error messages:

    Cannot add header information - headers already sent by (output started at C:\Inetpub\wwwroot\template\index.php:1) in C:\Inetpub\wwwroot\template\index.php</b> on line 3

    Fatal error: Call to undefined function: imagecreate() in C:\Inetpub\wwwroot\template\index.php on line 4

    Here's the code: <?php

    header("Content-type: image/png"); $im = imagecreate(100, 20);

    $red = imagecolorallocate($im, 255, 0, 0); $white = imagecolorallocate($im, 255, 255, 255);

    $ImageString($im, 3, 3, 3, "Home", $white); imagepng($im);

    ImagegDestroy($im);

    ?> Any help would be appreciated.

    attached mail follows:


    Thanks for all your help with my URL code problem!

    I have come up with a solution that seems to half work and I can't figure out what I need to do to get it fully functional. Given my data string (text) from my database, this is what I do to replace the URL text with a functioning link. I am asking folks that, if they include a URL in their results to surround it by [] so that I can search for the brackets. This is what my text replace line looks like:

    $data_str = eregi_replace ("(\[http://)([^]]*)", "<a href \"http=\\0\">\\0</a>", $data_str);

    So, if the URL is (for example) [http://www.cleanrun.com] (in plain text), it will show up for viewing in my browser as http://www.cleanrun.com but the URL associated with it will be that of the directory in the browser "Location" (i.e. http://wrong.url.com/Test_Results).

    I've tried all sorts of things with the call to eregi_replace but can't figure out what is going on.

    What the hec??? Can someone help?

    Many thanks!!

    Katherine Elliott

    -----Original Message----- From: Jason Wong [mailto:php-generalgremlins.biz] Sent: Wednesday, January 08, 2003 2:05 PM To: php-generallists.php.net Subject: Re: [PHP] Adding HTTP URL Code

    On Thursday 09 January 2003 04:07, ELLIOTT,KATHERINE A (HP-FtCollins,ex1) wrote: > OK, so I've gotten NO responses to my query below so I > thought I'd ask for something slightly different and see what > I get.

    With regards to your original query, the answer is in the archives. Try searching for something like "regex url" or "regex hyperlink" etc.

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

    /* NOTICE: alloc: /dev/null: filesystem full */

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

    attached mail follows:


    Thanks Greg, I know a bit of PHP but the OOP is a bit harder to understand I think :) I'll check out the PEAR classes.

    Cheers, Jordan

    On Thursday 16 Jan 2003 12:25 am, Greg Beaver wrote: > Hi Jordan, > > If you are doing this to learn PHP, that is great, keep plugging. If you > want to see working examples of the things you've described, there are a > number of scripts out there, both in pear (pear.php.net) and at other > repositories like phpbuilder.com and phpclasses.org. You would benefit > from examining how other authors have solved the same problems even if you > are simply trying to learn php > > Take care, > Greg

    -- 
    Jordan Elver
    Statistics are like a lamp-post to a drunken man - more for leaning on than 
    illumination. -- David Brent (The Office)
    

    attached mail follows:


    Thanks John,

    > Inheriting would probably be the most modular.

    I thought this would be the way to go. Ill need to read up on this.

    > > I haven't found any clear examples of this kind of OOP, only the real > > basics > > (which I still need help with by the way :) ). > > Use google. Do some more studying before you try to tackle this, or look > on phpclasses.org for some examples. > > ---John W. Holmes... > > PHP Architect - A monthly magazine for PHP Professionals. Get your copy > today. http://www.phparch.com/

    Nice work on php archittect by the way :) Thanks again, Jordan

    -- 
    Jordan Elver
    The office is like an army, and I'm the field general. You're my footsoldiers 
    and customer quality is the WAR!!! -- David Brent (The Office)
    

    attached mail follows:


    Here we go again.

    I installed Apache and it works fine, I then installed PHP and all tests show it works fine - but when I try to get the PHP modules loaded for Apache in httpd.conf, the Apache server won't start again. The only error I get is a Windows error box that says "The requested operation has failed". The event viewer shows:

    The Apache service named reported the following error: >>> Cannot load E:/Apache2/bin/php4apache.dll into server. The specified module could not be found.

    Well, the file(s) are in the appropriate place(s) as outlined in the PHP install guide (below). So I'm at a loss as to where to go next. This is a perfect testement as to why not to use Windows.....I guess I am just a sucker for punishment. Any help is appreciated.

    TIA

    Installing PHP for Apache as module ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    Now that version 4.1 introduces a safer sapi module, we recommend that you configure PHP as a module in Apache.

    To accomplish this, you have to load the php4apache.dll in your Apache httpd.conf.

    !! NOTE !! Whereever you load php4apache.dll from, php4apache.dll also needs the php4ts.dll also included in the PHP4 distribution. php4apache.dll depends on php4ts.dll which is loaded as soon as Apache loads php4apache.dll. If php4ts.dll can't be found, you usually get an error like (also see the "Problems?" section at the end of the file):

    Cannot load c:/php/sapi/php4apache.dll into server

    So where does php4ts.dll has to be to be properly loaded ? php4ts.dll is searched in the following order:

    1) in the directory where apache.exe is start from 2) in the directory where php4apache.dll is loaded from 3) in your %SYSTEMROOT%\System32, %SYSTEMROOT%\system and %SYSTEMROOT% directory. Note: %SYSTEMROOT%\System32 only applies to Windows NT/2000/XP) 4) in your whole %PATH%

    Note: What is %SYSTEMROOT% ? Depending on your Windows installation this may be for example c:\winnt or C:\windows

    Usually you would just copy it over to %SYSTEMROOT%\System32. But if you want to have multiple PHP installations (for whatever reason) this is a bad idea. For this circumstance the safest thing is to let php4ts.dll reside in the same directory where php4apache.dll is loaded from (see point 2 above).

    After you've set up the file layout properly, you're ready to finally configure Apache to load the PHP4 module. Just add the following lines to your httpd.conf:

    LoadModule php4_module c:/php/sapi/php4apache.dll AddModule mod_php4.c AddType application/x-httpd-php .php

    Note: Especially newer versions of Apache do not need the AddModule directive anymore, your milage may vary.

    Where do I have to put the php.ini ? The php.ini files is only searched in two places: 1) in your Apache installation directory (e.g. c:\apache\apache) 2) in your %SYSTEMROOT% directory.

    attached mail follows:


    I realize that Zend produces a PHP development studio, but I'm looking for something that helps the programmer use PHP (along with Javascript, CSS, "web GUI" languages, etc.) to develop enterprise web _applications_ (like for production data entry). I'd also like this studio to make available a set of UI widgets like that found in common Windows IDEs, and further make it easy to utilize J2EE objects (including EJB's) within an application design. As an added bonus, I'd like something that produces apps that work across many different "brands" of browsers, although that's probably not absolutely necessary for my requirements.

    Any ideas?

    Regards, Steve

    attached mail follows:


    The first problem I cannot solve on my own: I get the mail content from a cookie. Quite a big cookie since it is a collection of 30 - 40 form values from another page. When recieving the mail, the content come in ONE long string, and in some places with a \<BR\>. Of course, i dont want this to be printed (but I want the function, a line break). So, how can I get a line break in my javascript cookie (yeah, I have already tried \n). The second problem: I want the mail to be sent automatically when the visitor have filled in all the forms in the document and goes to the next document.

    attached mail follows:


    Hello Everyone,

    I've attempted this many times, but have failed to understand it each time. I want to make it easier for myself to deal with passing variables through a form. So I thought, why not use a single array variable to do that. If I do such a thing, what steps do I need to take to ensure that the values in the array are intact just as the user entered it? How do I serialize array data from an initial form? Here's a simple example of what I might have:

    <form method="post" action="some_page.php"> <input type="text" name="form_vars['firstname']"></input> <input type="text" name="form_vars['lastname']"></input> <input type="text" name="form_vars['address']"></input> <input type="text" name="form_vars['city']"></input> <input type="text" name="form_vars['state']"></input> <input type="text" name="form_vars['zip']"></input> </form>

    Now, how do I ensure that the values in the associated array, that will be sent over to some_page.php, are the values entered by the user? How do I serialize this array from this form? Or if I cannot do that, what other steps do I need to take to ensure the preservation of the values passed to another page as an array?

    attached mail follows:


    Hi,

    I've seen this bounced around on the archives a bit, but none of the advice on there is working for me. I'm trying to do something very simple:

    <? Header("Content-type: image/jpeg"); $im = ImageCreateFromJpeg('1234_1.jpg'); ImageJpeg($im);?>

    The file is in the folder, it has execute and write permissions set, and the error given is "The image cannot be displayed, because it contains errors.", which is not very useful. Anyone have any suggestions?

    Thanks, Sara Keesler

    attached mail follows:


    > > <? > Header("Content-type: image/jpeg"); > $im = ImageCreateFromJpeg('1234_1.jpg'); > ImageJpeg($im);?> > > The file is in the folder, it has execute and write > permissions set, and the error given is "The image > cannot be displayed, because it contains errors.", > which is not very useful. Anyone have any suggestions?

    Comment out the header statement and see if gd tells you anything.

    attached mail follows:


    On Wed, 15 Jan 2003, Kevin Stone wrote: > Chris I appreciate your response but please read my post again. I did not > suggest using the IP for user identification. I suggested using it as a > temporary id. I went on further to suggest to use sessions to identify > individual users behind a proxy server.

    But he also mentioned a round-robin proxy messing things up. I've had personal experience with IP addresses from AOL clients changing with each new connection. If your AOL users click through your site a few times, it's possible that their IP address will change between those clicks, thus making even a temporary id based on the IP address unreliable, and perhaps frustrating if your site keeps 'forgetting' things about the user.

    Joel

    -- 
    [ joel boonstra | jboonstragospelcom.net ]
    

    attached mail follows:


    IP address is not an effective solution. Anyone can use a 2nd browser on the same machine. Also, if for a company with 1000 machine behind the firewall, they all get one and the same IP address outside the firewall.

    "Kevin Stone" <kevinhelpelf.com> wrote in message news:00a701c2bcdd$316349a0$6601a8c0kevin... > You can never fully rely on any information given to you by the browser. > You can't rely it being accurate or even being there at all. What I suggest > to you is code a solution around the IP address. The IP address of course, > like any information coming from the client, can be tampered with but more > than likely it's not going to change while the user is browsing your > website. Right? So you just use it as a temporary ID. Log the IP to the > database, track the IP's movements on your website, log those actions to a > database. That's the best way to do it without having to force the user to > login. If you're concerned about people browsing from network IP then code > a solution using Sessions and track the session id. And finally if you need > to know that a client has 'returned' to your website set a cookie on their > computer. I'm sure you'll find ways to elaborate from there. You can do > all of this without requiring the user to "login". > -Kevin > > ----- Original Message ----- > From: "Scott Fletcher" <scottabcoa.com> > To: <php-generallists.php.net> > Sent: Wednesday, January 15, 2003 2:07 PM > Subject: Re: [PHP] HTTP_REFERER work without a problem.... > > > > It's not a PHP bug. Many PHP programmer tried to their best to use > > HTTP_REFERER so they can keep track of which webpages on the current > website > > did the user last visited. That way, they can keep out the unauthorized > > access to the website without first logging in to the website. > > > > Well, my company's website use both SSL and Session ID. They are good for > > starter but they aren't any secure if anyone can make a direct access > > without logging in. That's where I use HTTP_REFERER to see what last page > > did he or she visited, if the last page being visited is outside of my > > company's website then php moved the end user to the login page. It is > > pretty effective. > > > > The common problem with the browsers is that they aren't compactible so > > HTTP_REFERER don't alway work right and sometime return a blank if those > > three are being used. I had been observing it for a few years. Those > three > > are 1) HierMenus, 2) location.replace('') and 3) location.href=''. When > > either one of these are in use, some browsers return with a blank in > > HTTP_REFERER. > > > > Cheers.... > > > > "Chris Shiflett" <shiflettphp.net> wrote in message > > news:20030115205307.15329.qmailweb14302.mail.yahoo.com... > > > --- Scott Fletcher <scottabcoa.com> wrote: > > > > Here's what I found so interesting.... > > > > > > > > This code, $_SERVER['HTTP_REFERER'] have worked without a > > > > problem when I use the latest Mozilla build. It even work > > > > with the HierMenus, > > > location.replace('http://whatever.com'), > > > > and location.href = http://whatever.com... > > > > > > > > This is a good news for PHP everywhere. > > > > > > > > Unfortunately, Internet Explorer still have this > > > > bug....... > > > > > > What bug is that? > > > > > > Is there a question here somewhere? I think I am having a > > > hard time interpreting it. > > > > > > Chris > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > >

    attached mail follows:


    I have been looking for an example of how to create a listing of items in a table where you have the first item in the list have a link so that when you click on it, it will open a page for editing the contents of that item. So for instance you have a list of employees, and you want to change their phone number you could go to the list and click on the employee id number and it would open a page where you can edit the employee information.

    I haven't been able to find a good example of this, so if anyone knows where I could find one, please let me know.

    Mike

    attached mail follows:


    This may be a bit more than you are looking for.

    http://sourceforge.net/projects/phpmyedit/

    Mike Tuller wrote: > I have been looking for an example of how to create a listing of items > in a table where you have the first item in the list have a link so that > when you click on it, it will open a page for editing the contents of > that item. So for instance you have a list of employees, and you want to > change their phone number you could go to the list and click on the > employee id number and it would open a page where you can edit the > employee information. > > I haven't been able to find a good example of this, so if anyone knows > where I could find one, please let me know. > > Mike >

    attached mail follows:


    Al, Something like the following should enable you to display a list of whatever, then click on the record id to edit the record. This is a portion of code which does the display, you'll need another portion to display the record for editing.

    Hugh snip from street.php <?php // view list

    $table="table"; $db="database"; $pass="password"; $user="user"; $link=mysql_connect("localhost","$user","$pass"); if (! $link) die("couldn't connect mysql"); mysql_select_db($db,$link) or die ("couldn't open $db ".mysql_error()); $query="select * from $table order by scientific_name"; $result=mysql_query($query); print "<h3> <br>Click on an ID number to edit the information of that record.</h3>"; print "<table align=center width=95% cellpadding=3 cellspacing=0 border=1 bgcolor=silver bordercolor=gray> <tr><td align=center><h5>ID</h5></td> <td align=center><h5>Scientific Name (Common Name)</h5></td> <td align=center><h5>Address</h5></td> <td align=center><h5>District</h5></td> </tr>"; while ($array_result=mysql_fetch_array($result)) { print "<tr><td><h4><a href=street.php?database=1&id_number=$array_result[id] title=\"click here to edit this record\">".stripslashes($array_result[id])."</a></h4></td> <td><h4>".stripslashes($array_result[scientific_name])." (".stripslashes($array_result[common_name]).")</h4></td> <td><h4>".stripslashes($array_result[address])." ".stripslashes($array_result[comments])."&nbsp;</h4></td>

    <td><h4>".stripslashes($array_result[district])."&nbsp;</h4></td></tr>"; } print "</table>";

    ?> ----- Original Message ----- From: "Al" <newsridersite.org> To: <php-generallists.php.net> Sent: Thursday, January 16, 2003 2:14 PM Subject: [PHP] Re: List items in table with a hypertext link

    > This may be a bit more than you are looking for. > > http://sourceforge.net/projects/phpmyedit/ > > > > Mike Tuller wrote: > > I have been looking for an example of how to create a listing of items > > in a table where you have the first item in the list have a link so that > > when you click on it, it will open a page for editing the contents of > > that item. So for instance you have a list of employees, and you want to > > change their phone number you could go to the list and click on the > > employee id number and it would open a page where you can edit the > > employee information. > > > > I haven't been able to find a good example of this, so if anyone knows > > where I could find one, please let me know. > > > > Mike > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    Give about 1 MILLION sets of 1 to ~20 integers such as:

    (15, 42, 57, 314, 1024)

    I need to be able to compare any two sets and determine if any of their elements are within, say, 20 of each other.

    Example:

    (10, 100, 1000) CLOSETO (50, 150, 1050) ==> FALSE (10, 100, 1000) CLOSETO (15, 150, 1050) ==> TRUE [abs(15 - 10) < 20] (10, 100, 1000) CLOSETO (115, 1050) ==> TRUE [abs(115 - 110) < 20]

    The sets are actually ordered sets, monotonicly increasing, if that helps.

    Each set has another 36 bytes of associated data, of which 32 (two int4) can be composed for a unique ID. Or I could just assign an ID to each one.

    I could, of course, create a table of about 10 MILLION rows and be searching through that... But my gut says there should be an easier way.

    I've look at the ~/contrib/array and even considered converting each set to a built-in "path" datatype -- But neither of those seems to provide a "any_vertex_near" function for comparing two objects.

    Any ideas?...

    attached mail follows:


    session_destroy() do work when I logged out of the website. But if I'm logged in and open a 2nd browser and try to log in. This where the script I use to detect exisitng session and destroy it before generating a new one. Problem is that session_destroy does not work on the 2nd browser...

    So, my question is what is the workaround to using session_destroy() ???? How do I unset it???? Etc....

    I tried this one but it had no effect if I'm the 2nd user...

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

    $_SESSION = array(); session_destroy();

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

    attached mail follows:


    Oh never mind. I found a work around to it. I can use the passthru command. Like this...

    --clip-- passthru("rm -f /tmp/sess_*****") --clip--

    "Scott Fletcher" <scottabcoa.com> wrote in message news:20030116193348.95052.qmailpb1.pair.com... > session_destroy() do work when I logged out of the website. But if I'm > logged in and open a 2nd browser and try to log in. This where the script I > use to detect exisitng session and destroy it before generating a new one. > Problem is that session_destroy does not work on the 2nd browser... > > So, my question is what is the workaround to using session_destroy() ???? > How do I unset it???? Etc.... > > I tried this one but it had no effect if I'm the 2nd user... > > --------------- > > $_SESSION = array(); > session_destroy(); > > --------------- > >

    attached mail follows:


    Anyone have some good examples of using PDF forms and parsing the form using PHP? I've done some searching (ala google and manual) but all they seem to mention is parsing a .fdf file. Seemingly when you use a PDF form and set the action to a php script a file is still generated on the client machine in the temp directory that inserts the context of the action taken by the script it's sending the form data to.

    For instance, I set a pdf form to pass the form data to a file called pdfform.php on my server. The pdfform.php file parses the data then stores it in a database. This works. From there the pdfform.php script sends the user to my homepage. What happens from here is the page comes up but is being called by a file on the local machine. The file po3426.html located in my temp directory is actually made up of the source code for my homepage. All I really want to do is yuse the data from the form and continue on with my script. How do I go about that?

    TIA,

    Ed

    attached mail follows:


    Hello Everyone:

    I am using Sessions to secure parts of my website. I need to know if there is a way to set a lifetime for these sessions , so that they are automatically destroyed when say the user is inactive for 30 minutes.

    Any help will be greatly appreciated. Thanks in advance

    Pushpinder Singh

    attached mail follows:


    Check out the 'max lifetime' session settings in the sessions part of php.ini

    Justin

    on 17/01/03 7:11 AM, Pushpinder Singh Garcha (pgarchaadelphia.net) wrote:

    > Hello Everyone: > > I am using Sessions to secure parts of my website. I need to know if > there is a way to set a lifetime for these sessions , so that they are > automatically destroyed when say the user is inactive for 30 minutes. > > Any help will be greatly appreciated. Thanks in advance > > Pushpinder Singh >

    attached mail follows:


    Ok, I know this is a longshot but does anyone on this list work in the healthcare industry and have created an 837 with php? I am thinking of attempting to create one in php and didn't want to reinvent the wheel.

    Thanks, Eddie

    attached mail follows:


    : Ok, I know this is a longshot but does anyone on this list work in the : healthcare industry and have created an 837 with php? I am thinking of : attempting to create one in php and didn't want to reinvent the wheel.

    Just curious. What is an 837?

    attached mail follows:


    On Thu, 2003-01-16 at 16:10, Rodney Green wrote: > Just curious. What is an 837?

    I'm curious, too... what is it?

    Not a good start, if you were hoping to get an answer eh? :-)))

    Marco

    -- 
    ----------------
    php|architect - The Monthly Magazine for PHP Professionals
    Come check us out on the web at http://www.phparch.com!
    

    attached mail follows:


    :)))

    Paul Marinas Technical Support RDS Craiova

    Phone: +402-51-410-194 Mobile: +407-22-451-439 Fax: +402-51-416-579 www.rdsnet.ro .....................................................

    Privileged/Confidential Information may be contained in this message. If you are not the addressee indicated in this message (or responsible for delivery of the message to such person), you may not copy or deliver this message to anyone. In such a case, you should destroy this message and kindly notify the sender by reply e-mail.

    On Thu, 16 Jan 2003, Marco Tabini wrote:

    > On Thu, 2003-01-16 at 16:10, Rodney Green wrote: > > Just curious. What is an 837? > > I'm curious, too... what is it? > > Not a good start, if you were hoping to get an answer eh? :-))) > > Marco > -- > ---------------- > php|architect - The Monthly Magazine for PHP Professionals > Come check us out on the web at http://www.phparch.com! > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    I apologize, an 837 is a 'Professional Health Care Claim'. Basically what the healthcare organizations use to submit to the state to get money. It pulls in all sorts of data and generates a claim that is then submitted to the state.

    Eddie

    -----Original Message----- From: Marco Tabini [mailto:marcottabini.ca] Sent: Thursday, January 16, 2003 4:03 PM To: Rodney Green Cc: Edward Peloke; Php-GeneralLists. Php. Net Subject: Re: [PHP] x12 837

    On Thu, 2003-01-16 at 16:10, Rodney Green wrote: > Just curious. What is an 837?

    I'm curious, too... what is it?

    Not a good start, if you were hoping to get an answer eh? :-)))

    Marco

    --
    ----------------
    php|architect - The Monthly Magazine for PHP Professionals
    Come check us out on the web at http://www.phparch.com!
    

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

    attached mail follows:


    I've created an 850 and a base class x12. It's not terribly hard. I did not find much in the way of useful classes already built though.

    =C=

    * * Cal Evans * Stay plugged into your audience. * http://www.christianperformer.com *

    -----Original Message----- From: Edward Peloke [mailto:epelokeechoman.com] Sent: Thursday, January 16, 2003 3:39 PM To: Php-GeneralLists. Php. Net Subject: [PHP] x12 837

    Ok, I know this is a longshot but does anyone on this list work in the healthcare industry and have created an 837 with php? I am thinking of attempting to create one in php and didn't want to reinvent the wheel.

    Thanks, Eddie

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

    attached mail follows:


    My company currently uses a tool that we wrote to do things like this although we are looking for other options now to create the 837 claim so I was thinking of attempting to create one using php. The end result is just a text file but it has tons of logic and loops when processing the data.

    Eddie

    -----Original Message----- From: Edward Peloke [mailto:epelokeechoman.com] Sent: Thursday, January 16, 2003 4:51 PM To: Php-GeneralLists. Php. Net Subject: RE: [PHP] x12 837

    I apologize, an 837 is a 'Professional Health Care Claim'. Basically what the healthcare organizations use to submit to the state to get money. It pulls in all sorts of data and generates a claim that is then submitted to the state.

    Eddie

    -----Original Message----- From: Marco Tabini [mailto:marcottabini.ca] Sent: Thursday, January 16, 2003 4:03 PM To: Rodney Green Cc: Edward Peloke; Php-GeneralLists. Php. Net Subject: Re: [PHP] x12 837

    On Thu, 2003-01-16 at 16:10, Rodney Green wrote: > Just curious. What is an 837?

    I'm curious, too... what is it?

    Not a good start, if you were hoping to get an answer eh? :-)))

    Marco

    --
    ----------------
    php|architect - The Monthly Magazine for PHP Professionals
    Come check us out on the web at http://www.phparch.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:


    Cal,

    You used php for this? I am pretty sure that an 850 is on our list of things to do somewhere.

    Eddie

    -----Original Message----- From: Cal Evans [mailto:calcalevans.com] Sent: Thursday, January 16, 2003 4:22 PM To: Edward Peloke; Php-GeneralLists. Php. Net Subject: RE: [PHP] x12 837

    I've created an 850 and a base class x12. It's not terribly hard. I did not find much in the way of useful classes already built though.

    =C=

    * * Cal Evans * Stay plugged into your audience. * http://www.christianperformer.com *

    -----Original Message----- From: Edward Peloke [mailto:epelokeechoman.com] Sent: Thursday, January 16, 2003 3:39 PM To: Php-GeneralLists. Php. Net Subject: [PHP] x12 837

    Ok, I know this is a longshot but does anyone on this list work in the healthcare industry and have created an 837 with php? I am thinking of attempting to create one in php and didn't want to reinvent the wheel.

    Thanks, Eddie

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


    yea, mine is all array based. I pull the data from a FoxPro table via XML (and jump through several hoops.) Then I have a main loop that spins through the data (which is ordered) and

    * creates a new PO if the PO number has changes (PO Object) * Create a PoLineItem for each line in the PO (POLineItemObject) * repeat.

    * PO's own POLineItems * All PO's are owned by the X12_850 object.

    Once everything is nicely sliced and diced into objects I call X12_850->generateX12(). This spits out all the necessary headers and then calls generateX12() on each PO. Each PO spits out all the necessary headers and then calls generateX12() on each POLine Item. Then it spits out the necessary trailers and bumps control back up the line.

    Once it's finished, I have a (honkin' big) string that represents the 850 document. Currently, I dump this out to a file for ftping but you could just as easily use CURL to call a SOAP process somewhere if your X12 partner had a brain. (mine does not, the company I was a consultant for in the medical insurance industry did not either)

    Anyhow, I'm happy to share what I know if you have questions.

    HTH, =C=

    * * Cal Evans * Stay plugged into your audience. * http://www.christianperformer.com * http://www.calevans.com *

    -----Original Message----- From: Edward Peloke [mailto:epelokeechoman.com] Sent: Thursday, January 16, 2003 3:55 PM To: Php-GeneralLists. Php. Net Subject: RE: [PHP] x12 837

    Cal,

    You used php for this? I am pretty sure that an 850 is on our list of things to do somewhere.

    Eddie

    -----Original Message----- From: Cal Evans [mailto:calcalevans.com] Sent: Thursday, January 16, 2003 4:22 PM To: Edward Peloke; Php-GeneralLists. Php. Net Subject: RE: [PHP] x12 837

    I've created an 850 and a base class x12. It's not terribly hard. I did not find much in the way of useful classes already built though.

    =C=

    * * Cal Evans * Stay plugged into your audience. * http://www.christianperformer.com *

    -----Original Message----- From: Edward Peloke [mailto:epelokeechoman.com] Sent: Thursday, January 16, 2003 3:39 PM To: Php-GeneralLists. Php. Net Subject: [PHP] x12 837

    Ok, I know this is a longshot but does anyone on this list work in the healthcare industry and have created an 837 with php? I am thinking of attempting to create one in php and didn't want to reinvent the wheel.

    Thanks, Eddie

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


    Hi guys, After your previous advice. I have been looking at some more OOP for my application. Is this the sort of way a proper OOP application should be constructed?

    I want to use smarty as my template language as well, how could I integrate that?

    <?php class Base {

    function test_base() {

    echo 'Some other functions in here maybe?'; } }

    class Error extends Base {

    function raise_error() {

    echo 'I am raising an error'; } }

    class Database extends Error {

    function connect($details = '') {

    echo "Connecting to the database<br />";

    // get connections details list($host, $username, $password, $type) = $details;

    // connect to the database if($connection = mysql_connect($host, $username, $password)) {

    $this->raise_error(); } } }

    class Login extends Database {

    function Login() {

    echo "Hello, I'm the Login class<br />";

    // connect to the database $this->connect(); } }

    $c = new Database; $c->connect();

    Any pointers would be great :)

    Cheers, Jord

    -- 
    Jordan Elver
    You don't have to be mad to work here, but you do have to be on time, well 
    presented, a team player, customer service focused and sober!! -- David Brent 
    (The Office)
    

    attached mail follows:


    personally, I would ditch the Error class and put raise_error in Base.

    =C=

    * * Cal Evans * Stay plugged into your audience. * http://www.christianperformer.com *

    -----Original Message----- From: Jordan Elver [mailto:jordan.elverdsl.pipex.com] Sent: Thursday, January 16, 2003 3:52 PM To: php-generallists.php.net Subject: [PHP] More OOP

    Hi guys, After your previous advice. I have been looking at some more OOP for my application. Is this the sort of way a proper OOP application should be constructed?

    I want to use smarty as my template language as well, how could I integrate that?

    <?php class Base {

    function test_base() {

    echo 'Some other functions in here maybe?'; } }

    class Error extends Base {

    function raise_error() {

    echo 'I am raising an error'; } }

    class Database extends Error {

    function connect($details = '') {

    echo "Connecting to the database<br />";

    // get connections details list($host, $username, $password, $type) = $details;

    // connect to the database if($connection = mysql_connect($host, $username, $password)) {

    $this->raise_error(); } } }

    class Login extends Database {

    function Login() {

    echo "Hello, I'm the Login class<br />";

    // connect to the database $this->connect(); } }

    $c = new Database; $c->connect();

    Any pointers would be great :)

    Cheers, Jord

    --
    Jordan Elver
    You don't have to be mad to work here, but you do have to be on time, well
    presented, a team player, customer service focused and sober!! -- David
    Brent
    (The Office)
    

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

    attached mail follows:


    Hi!

    Which part of $_<whatever> is the REQUEST_URI be found from?

    I did the print_r on GLOBALS and found that it is part of $_GET. I'm sure it will work on $_POST also. So, it meant it shoudl work on $_REQUEST["REQUEST_URI"] also.... Can this also be part of $_SERVER["....."]???

    Thanks for your input....

    Scott F.

    attached mail follows:


    > Which part of $_<whatever> is the REQUEST_URI be found from?

    It's a web server predefined variable so only lives in $_SERVER.

    http://www.php.net/variables.predefined

    Regards, Philip

    attached mail follows:


    Hey,

    I'm trying to get package-stats-graph.php to work (got it off of pear cvs), but no matter what date I insert in my downloads table (mysql), it all ends up in one bar on the graph.

    Here's my two relevant tables:

    # # Table structure for table `downloads` #

    CREATE TABLE downloads ( downloadId int(4) NOT NULL auto_increment, downloadDate int(10) default NULL, downloadName varchar(100) default NULL, downloadPackageId int(10) default NULL, PRIMARY KEY (downloadId) ) TYPE=MyISAM;

    # # Dumping data for table `downloads` #

    INSERT INTO downloads VALUES (1, 1042681964, 'shoutBOX', 3); # Date is in January 2003 INSERT INTO downloads VALUES (2, 1025559732, 'shoutBOX', 3); # Date is in July 2002

    # # Table structure for table `scripts` #

    CREATE TABLE scripts ( scriptId int(4) NOT NULL default '0', scriptKey int(4) default NULL, scriptDate int(10) default NULL, scriptName varchar(255) default NULL, scriptRequirements varchar(100) default NULL, scriptFeatures text, scriptDescription text, scriptVersion varchar(4) default NULL, scriptLocation varchar(255) default NULL, scriptViews int(10) default NULL, scriptDownloads int(10) default '0', PRIMARY KEY (scriptId) ) TYPE=MyISAM;

    # # Dumping data for table `scripts` #

    INSERT INTO scripts VALUES (3, 1, 1004398159, 'shoutBOX', 'PHP/MySQL', '..', '2.6', 'scripts/shoutBOX-2.6.zip', 652, 849);

    and this is my code wich won't work: $statsSql = 'SELECT UNIX_TIMESTAMP(d.downloadDate) AS date, COUNT(*) AS downloads FROM scripts s, downloads d WHERE d.downloadPackageId = s.scriptId AND s.scriptId = '.$_GET['id'].' GROUP BY MONTH(d.downloadDate) ORDER BY YEAR(d.downloadDate) DESC, MONTH(d.downloadDate) DESC'; if($statsResult = $db->query($statsSql)) { if (DB::isError($statsResult)) { die($statsResult->getDebugInfo()); }

    while ($statsRow = $statsResult->fetchRow(DB_FETCHMODE_ASSOC)) { $y_axis[date('n', $statsRow['date'])] = $statsRow['downloads']; } }

    An example is available here: http://www.phpnetwork.net/package-stats-graph.php?id=3

    I've searched mysql.com for documentation on group by but I couldn't fix it... Also tried several irc chans... :/ I would appreciate any help I can get.

    --------------- Sincerely, Eskil Kvalnes eskiluten.net

    attached mail follows:


    Hello -

    I just read an interesting article in The Perl Journal (TPJ) about using AUTOLOAD as a layer of abstraction for accessing database columns and I would like to write something similar in PHP. Is this possible?

    I have written a number of PHP/MySQL applications, but do not consider myself an expert. I cannot find anything on various PHP-related websites and was hoping someone with more in depth knowledge would be able to make a few suggestions.

    Thanks!

    Chip Castle chip (at) chipcastle (dot) com

    attached mail follows:


    I have a PHP driven site that as a time schedule. Since the site isn't exactly filled with very intellagent people who just LOVE to translate times and dates from a weird format (Such as the format used in MySQL), I'd like to take these from a MySQL table (the table's types are DATE and TIME) and translate the date to something like "Thrusday, January 16th, 2003" when the date strate from the table is "2003-01-16." Then with time, I'd like it to read something like "8:00 PM" when it reads straight from the table "20:00:00." Another feature I'd like to have it timezones but that's not the point of this message. If you don't mind, though, could you also tell me how to configure the times according the the timezone a user has chosen?

    Thanks, Stephen Craton http://www.melchior.us

    "What's the point in appearance if your true love, doesn't care about it?" -- http://www.melchior.us

    attached mail follows:


    start with http://php.net/strtotime and http://php.net/date

    <? // many lines $d = '2003-01-16'; // from mysql $ds = strtotime($d); // unix stamp $df = date('l, F dS, Y',$ds); // formatted echo $df; ?>

    OR

    <? //one line echo date('l, F dS, Y',strtotime('2003-01-16')); ?>

    For the 24hr time to 12hr time conversion, something like:

    <? $t = '22:17:48'; list($h,$m,$s) = explode(':',$t); if($h >= 12) { $suffix = 'pm'; } else { $suffix = 'am'; } if($h > 12) { $h = $h - 12; } echo "{$h}:{$m}{$suffix}"; ?>

    Untested code of course, but it should do the job, and would be easy to wrap into a re-useable function :)

    Timezones: I haven't looked into them too much, but you should consider storing every date in GMT, rather than 'picking' a timezone to suit everyone, which is of course impossible. I think you can add the keyword GMT to strtotime to achieve this.

    strtotime() gives you a number of seconds since 1970... It's pretty convenient to work with (but not for a human to read), because to add an hour to the date, you just add 3600 (60s * 60m) to the number. There must be a way of finding out how many hours ahead/behind the GMT the user is, and using that figure (3 hours = 3 x 3600) to alter the stamp to reflect their time.

    And then let's talk about daylight savings :)

    If I were you, I'd just implement everything in GMT, unless you want to spend a little while sorting all this out.

    Justin

    on 17/01/03 12:16 PM, Stephen (webmastermelchior.us) wrote:

    > I have a PHP driven site that as a time schedule. Since the site isn't exactly > filled with very intellagent people who just LOVE to translate times and dates > from a weird format (Such as the format used in MySQL), I'd like to take these > from a MySQL table (the table's types are DATE and TIME) and translate the > date to something like "Thrusday, January 16th, 2003" when the date strate > from the table is "2003-01-16." Then with time, I'd like it to read something > like "8:00 PM" when it reads straight from the table "20:00:00." Another > feature I'd like to have it timezones but that's not the point of this > message. If you don't mind, though, could you also tell me how to configure > the times according the the timezone a user has chosen? > > Thanks, > Stephen Craton > http://www.melchior.us > > "What's the point in appearance if your true love, doesn't care about it?" -- > http://www.melchior.us

    attached mail follows:


    Hi!

    Is there anyway in php to fit the window to the size of an image?

    Thanks!

    Ezequiel

    attached mail follows:


    This can be achieved by using image features of php to get the size then rewrite your html or use JavaScript to do the same.

    Timothy Hitchens (HiTCHO) Open Source Consulting e-mail: timhitcho.com.au

    > -----Original Message----- > From: Ezequiel Sapoznik [mailto:ezequielmibbva.com.ar] > Sent: Friday, 17 January 2003 11:38 AM > To: php-generallists.php.net > Subject: [PHP] fit window to image > > > Hi! > > Is there anyway in php to fit the window to the size of an image? > > Thanks! > > Ezequiel > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    This wouldn't really be done in PHP. This is a Javascript element, as it requires work to be done on the client side. You could easily make a combination of PHP and Javascript to do this with any set of images though.

    Wes

    On Thursday, January 16, 2003, at 08:37 PM, Ezequiel Sapoznik wrote:

    > Hi! > > Is there anyway in php to fit the window to the size of an image? > > Thanks! > > Ezequiel > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >

    attached mail follows:


    what should i do if i want to use PostFix in the php, but not SendMail?

    thx very much HPS