OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
php-general-digest-help_at_lists.php.net
Date: Wed Jan 08 2003 - 17:19:13 CST

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

    php-general Digest 8 Jan 2003 23:19:13 -0000 Issue 1811

    Topics (messages 130753 through 130820):

    compiling php
            130753 by: info.t-host.com

    Re: custom error handling
            130754 by: electroteque

    PHP 4.3.0 and multibytestrings?
            130755 by: Simon Dedeyne

    Warning: Unlink failed (Permission denied) in
            130756 by: Kevin Meredith
            130758 by: Timothy Hitchens \(HiTCHO\)

    PHP mySQL Syntax problem
            130757 by: Jo Ann Comito
            130759 by: Marek Kilimajer

    Re: Img src
            130760 by: Robert Fisher
            130761 by: Robert Fisher
            130798 by: Sean Burlington
            130799 by: Martin Hudec

    How do I get the entire data sended to the web server?
            130762 by: Heiko Mundle
            130764 by: Marek Kilimajer

    Re: How to detect a PHP script time-out?
            130763 by: Robert Fisher
            130766 by: Tamas Arpad

    Re: graph libs
            130765 by: rosie storey
            130767 by: Marek Kilimajer
            130773 by: Larry Brown
            130775 by: Larry Brown

    Re: unlink ($files);
            130768 by: Adam Voigt
            130803 by: Jason Sheets

    Re: how to generate one in a string
            130769 by: Matt Vos

    Looping through directories?
            130770 by: Jeff Lewis
            130776 by: Chris Wesley

    stripslashes and quoted material
            130771 by: Gerard Samuel
            130774 by: Chris Wesley
            130777 by: Gerard Samuel

    Re: confirm unsubscribe from php-generallists.php.net
            130772 by: Turbo Fredriksson

    Re: Sessions error
            130778 by: Mike Tuller

    Terminal text objects (PHP CDK NCURSES)
            130779 by: Nikolai Vladychevski

    Re: Upgrade help!
            130780 by: PHP List

    Re: Zend IDE vs. PhpEd
            130781 by: Lumpkin, Buddy

    Strange file upload problem in php 4.2.3
            130782 by: Submission.org.ru Team

    PHP 4.3.0 with Oracle
            130783 by: José Manuel Valente

    ftp_put: permission denied
            130784 by: Oliver Witt
            130785 by: Timothy Hitchens \(HiTCHO\)
            130792 by: Oliver Witt
            130793 by: Timothy Hitchens \(HiTCHO\)
            130795 by: Oliver Witt
            130805 by: Thomas Seifert

    Re: Rookie mail() q's .. can't find answer after RTFM...
            130786 by: -<[ Rene Brehmer ]>-

    fletcher's checksum
            130787 by: Dave Gervais

    apache + mod_php question
            130788 by: Hugh Beaumont
            130789 by: Timothy Hitchens \(HiTCHO\)

    Re: anyway to do a 'whos online' from session variable?
            130790 by: Jeff Bluemel
            130791 by: Timothy Hitchens \(HiTCHO\)

    Re: Need a suggestion on developing a php-related system
            130794 by: Kelvin Poon

    Re: Adding HTTP URL Code
            130796 by: ELLIOTT,KATHERINE A (HP-FtCollins,ex1)
            130806 by: Jason Wong
            130809 by: Chris Wesley

    How can I redirect to another php page
            130797 by: Teo Petralia
            130801 by: Kevin Stone
            130802 by: Tom Ray
            130804 by: Rick Emery

    Re: Img src CORRECTION
            130800 by: Martin Hudec

    fast template over xsl
            130807 by: electroteque

    HTML email that generates "!"s - any ideas?
            130808 by: Philipp Hartmann

    Re: Double entry into MySQL..
            130810 by: Altug Sahin

    Submit Form
            130811 by: Stephen

    How Do I Return Values Across Servers
            130812 by: Bill Arbuckle, Jr.
            130815 by: Timothy Hitchens \(HiTCHO\)

    read javascript variable php?????
            130813 by: Ysrael Guzmán
            130818 by: Bill Arbuckle, Jr.

    strange problem (user poll)
            130814 by: - \[ Paul Ferrie \] -
            130816 by: Martin Hudec
            130817 by: Timothy Hitchens \(HiTCHO\)
            130819 by: - \[ Paul Ferrie \] -
            130820 by: Kevin Stone

    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:


    Hello list,

    just a simple question regarding php - compiling:

    when I compile php --with-gd="/usr..."

    How can I get the exact directory of gd (or gd-libs)???

    Qualified answers are welcome.

    Oliver Etzel

    attached mail follows:


    actually its getting there

    $backtrace = debug_backtrace();

      foreach ($backtrace as $val) {
       if (eregi($val['function'],'query')){
       echo $val['file']."<br>";
       echo $vale['line']."<br>";
       }
      }

    "Michael Sims" <mhsimsmidsouth.rr.com> wrote in message
    news:eglm1v00o46c0jv3dv02opsf5eof0ag4dl4ax.com...
    On Wed, 8 Jan 2003 08:28:58 +1100, you wrote:

    >> hi there i am trying to build a ustom error handler for the pear db
    aswell
    >> as catch fatal and parse errors , unfortunatly the pear db error message
    >> wont give me back the file and the line where the error is, how can i
    >> determine the line and file where the error is caused ufortunatly the
    >> callback funtion with the params $errfile and $errline return the file
    >that
    >> contains the trigger not the script itself !

    If you're running PHP 4.3.0 use debug_backtrace() inside your custom
    error handler to trace the error. If you're not running PHP 4.3.0
    consider upgrading, because debug_backtrace() is a lifesaver.

    attached mail follows:


    I got a simple question. What do you have to do when you want to use
    multibytestring functions under
    PHP 4.3.0 assuming you're using the windows binaries and you're running
    on XP?
    Is it standard or do you have to adjust some things?

    Cheers,
    Simon

    attached mail follows:


    Please could someone let me know the cause of this error message
    "Warning: Unlink failed (Permission denied) in ...".

    Regards
    Kevin

    attached mail follows:


    You are trying to delete/unlink a file with a php script.

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

    > -----Original Message-----
    > From: Kevin Meredith [mailto:kevinatom.co.za]
    > Sent: Wednesday, 8 January 2003 9:54 PM
    > To: PHP
    > Subject: [PHP] Warning: Unlink failed (Permission denied) in
    >
    >
    > Please could someone let me know the cause of this error message
    > "Warning: Unlink failed (Permission denied) in ...".
    >
    > Regards
    > Kevin
    >
    > --
    > PHP General Mailing List (http://www.php.net/)
    > To unsubscribe, visit: http://www.php.net/unsub.php
    >

    attached mail follows:


    I'm working in PHP4 and have suceeded in creating a mySQL table. I can
    fill the table using the INSERT command as follows:

    <?
    //some code here to establish connection, define and create table, etc.
    .....
    MYSQL($Dbname, "INSERT INTO $Tbname_1 VALUES(1, 'John Doe', 'red')");
    MYSQL($Dbname, "INSERT INTO $Tbname_1 VALUES(2, 'Jane Smith', 'green')");
    ......
    ?>

    The above works fine. Here is the problem: Instead of specifying the
    color, red, green, etc. I would like to generate a random color and
    store it in a variable, then use the variable in the INSERT command. To
    simplify the code in this example, I have just assigned a color to the
    varialble.

    $color = "red";
    MYSQL($Dbname, "INSERT INTO $Tbname_1 VALUES(1, 'John Doe', $color)");
    $color="green"
    MYSQL($Dbname, "INSERT INTO $Tbname_1 VALUES(2, 'Jane Smith', $color)");

    This syntax does not work. The table is created, but it has 0 rows. I
    have tried a multitude of variations, including
    ECHO $color
    '$color'
    \'$color\'
    {$color}
    etc.

    No combination I have tried works. Could some kind person please point
    me in the right direction?
    Thanks,
    Jo Ann

    attached mail follows:


    MYSQL($Dbname, "INSERT INTO $Tbname_1 VALUES(1, 'John Doe', '$color')");

    - single quotes around $color

    Jo Ann Comito wrote:

    > I'm working in PHP4 and have suceeded in creating a mySQL table. I can
    > fill the table using the INSERT command as follows:
    >
    > <?
    > //some code here to establish connection, define and create table, etc.
    > .....
    > MYSQL($Dbname, "INSERT INTO $Tbname_1 VALUES(1, 'John Doe', 'red')");
    > MYSQL($Dbname, "INSERT INTO $Tbname_1 VALUES(2, 'Jane Smith', 'green')");
    > ......
    > ?>
    >
    > The above works fine. Here is the problem: Instead of specifying the
    > color, red, green, etc. I would like to generate a random color and
    > store it in a variable, then use the variable in the INSERT command. To
    > simplify the code in this example, I have just assigned a color to the
    > varialble.
    >
    > $color = "red";
    > MYSQL($Dbname, "INSERT INTO $Tbname_1 VALUES(1, 'John Doe', $color)");
    > $color="green"
    > MYSQL($Dbname, "INSERT INTO $Tbname_1 VALUES(2, 'Jane Smith', $color)");
    >
    > This syntax does not work. The table is created, but it has 0 rows. I
    > have tried a multitude of variations, including
    > ECHO $color
    > '$color'
    > \'$color\'
    > {$color}
    > etc.
    >
    > No combination I have tried works. Could some kind person please point
    > me in the right direction?
    > Thanks,
    > Jo Ann
    >
    >
    >

    attached mail follows:


    Try using single quotes inside your double quotes,
    just like you did with the width and haight values. he
    following line:

    print "<img src='" . $row["foto"] . "' width='104'
    height='137'>";

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

    attached mail follows:


    Try using single quotes inside your double quotes,
    just like you did with the width and haight values.

    The following line should work:

    print "<img src='" . $row["foto"] . "' width='104'
    height='137'>";

    Robert Fisher
    Axis Solutions, Inc.

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

    attached mail follows:


    Ezequiel Sapoznik wrote:
    > I am having a parse error in the following sentence:
    >
    > print "<img src=\"" . $row["foto"] . "" width='104' height='137'\">";
    >

    it would help if you posted the actual error message !

    but try this ...

    print '<img src="' . $row["foto"] . '" width="104" height="137">';

    or

    print "<img src=\"" . $row["foto"] . "\" width='104' height='137'\">";

    -- 
    

    Sean

    attached mail follows:


    Hello Sean,

    or try to use this: print "<img src=\"".$row["foto"]."\" width=\"104\" height=\"137\">"; or just print "<img src=\"".$row["foto"]."\" width=104 height='37\>";

    looks like u have error here: print "<img src=\"" . $row["foto"] . "" width='104' height='137'\">"; ^ ^^ ^ - use \ before " ^^- no need to use both \ and " remove those two characters

    or try this

    your php ?> <img src="<? echo $row["foto"];?>" width=104 height=137> <? your php

    -- 
    Best regards,
     Martin                          mail   corwincorwin.sk
                                     mobile +421.907.303.393
                                     icq    34358414
                                     www    http://www.corwin.sk
    

    PGP key fingerprint 21365ca05ecfd8aeb1cf19c838fff033

    "In those days spirits were brave, the stakes were high, men were real men, women were real women and small furry creatures from Alpha Centauri were real small furry creatures from Alpha Centauri."

    by Douglas Adams

    Wednesday, January 8, 2003, 8:55:08 PM, you wrote:

    SB> Ezequiel Sapoznik wrote: >> I am having a parse error in the following sentence: >> >> print "<img src=\"" . $row["foto"] . "" width='104' height='137'\">"; >>

    SB> it would help if you posted the actual error message !

    SB> but try this ...

    SB> print '<img src="' . $row["foto"] . '" width="104" height="137">';

    SB> or

    SB> print "<img src=\"" . $row["foto"] . "\" width='104' height='137'\">";

    SB> --

    SB> Sean

    attached mail follows:


    Is it possible with php to print the http header and the attached data for a transmitted http request? How can I do this?

    an example of what I want to see:

    POST /cgi-bin/CgiMfc1?MyQuery%3dQData HTTP/1.1 Accept: text/* User-Agent: HttpCall Accept-Language: en-us Host: localhost:680 Content-Length: 98

    000629EF2656+vs+%0d%0a143%2e114%2e37%2e22+vs+%0d%0aDEKGKIEG+vs+ %0d%0a000629ef2656+vs+%0d%0a2051586

    Thanks Heiko

    attached mail follows:


    I don't think there is a single variable, but you can build it from various variables and functions: $_SERVER array: REQUEST_METHOD REQUEST_URI SERVER_PROTOCOL function getallheaders() |$HTTP_RAW_POST_DATA| |||| |this should be all you need|

    Heiko Mundle wrote:

    > Is it possible with php to print the http header and the attached data > for a transmitted http request? How can I do this? > > an example of what I want to see: > > POST /cgi-bin/CgiMfc1?MyQuery%3dQData HTTP/1.1 > Accept: text/* > User-Agent: HttpCall > Accept-Language: en-us > Host: localhost:680 > Content-Length: 98 > > 000629EF2656+vs+%0d%0a143%2e114%2e37%2e22+vs+%0d%0aDEKGKIEG+vs+ > %0d%0a000629ef2656+vs+%0d%0a2051586 > > Thanks Heiko > >

    attached mail follows:


    If you are willing to do a rewrite, then have your main script start a fork, or child process. The child process would run your script while the parent would do nothing else but wait for the child. if the child times out the parent will know and you can then print out a error message.

    See the following on how to implement forks (process controls). It is kind of confusing and could be fatal to your system load if done incorrectly.

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

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

    attached mail follows:


    On Wednesday 08 January 2003 06:42, Jean-Christian Imbeault wrote: > Timothy Hitchens ) wrote: > > Issue... as I said before the register shutdown won't work because: > > > > - output from the shutdown is not visible nor do you have access to some > > variables > > You are right. From the manual: > > http://www.php.net/manual/en/function.register-shutdown-function.php > > " The registered shutdown functions are called after the request has > been completed (including sending any output buffers), so it is not > possible to send output to the browser using echo() or print(), or > retrieve the contents of any output buffers using ob_get_contents()." That's not right now. The manual is outdated. See this bug report http://bugs.php.net/bug.php?id=15209. This behavior was changed from 4.06 to 4.1. In newer versions of php the registered functions will run before the connection is closed so ouptput can be done from there as well. So Jean you can make it as it is suggested on this page: http://www.php.net/manual/en/features.connection-handling.php

    Arpi

    attached mail follows:


    I use chartDirector (http://www.advsofteng.com) for generating graphs and reports with PHP. chartDirector charts look really good and the license is cheap.

    There's also jpGraph: http://www.aditus.nu/jpgraph/

    -Rosie

    attached mail follows:


    http://www.aditus.nu/jpgraph/

    Larry Brown wrote:

    >Can anyone give any suggestions on the best/most intuitive tools or >libraries for generating graphs with PHP? > >Larry S. Brown >Dimension Networks, Inc. >(727) 723-8388 > > > > > >

    attached mail follows:


    This is by no means an advertisement, just one of the results I got looking around for charts. The following link lists a few viable solutions.

    http://www.hotscripts.com/PHP/Scripts_and_Programs/Graphs_and_Charts/

    Jpgraph renders an excellent image from the examples but the prerequisite packages were many and ultimately the install/readme didn't work for compiling the package. I could have looked further and found a solution, but with the number of prerequisites I dropped it looking for a faster install. The next one I came across that gave a reasonable looking chart was phplot which only requires GD which is stock on my RH distro. I got it up and working without any installation (not to mention dependencies). So I am up and running quickly and smoothly with phplot. It's a shame jpgraphs' dependencies aren't packaged with the distro. The transparent option on the colors is really smooth and I just don't have the time. Thanks to all for suggestions, I still want to look at one other site that was recommended here on the list.

    Larry S. Brown Dimension Networks, Inc. (727) 723-8388

    -----Original Message----- From: Marek Kilimajer [mailto:kilimajerwebglobe.sk] Sent: Wednesday, January 08, 2003 9:10 AM To: Larry Brown Cc: PHP List Subject: Re: [PHP] graph libs

    http://www.aditus.nu/jpgraph/

    Larry Brown wrote:

    >Can anyone give any suggestions on the best/most intuitive tools or >libraries for generating graphs with PHP? > >Larry S. Brown >Dimension Networks, Inc. >(727) 723-8388 > > > > > >

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

    attached mail follows:


    My extreme apologies to jpgraphs. They are more in line with phplot. I might even end up using them instead. Vagarant is the more difficult package. Again, their graph examples are pretty smooth but required a lot of package/dependency updates to RH.

    >This is by no means an advertisement, just one of the results I got looking around for charts. The following link lists a few viable > solutions.

    >http://www.hotscripts.com/PHP/Scripts_and_Programs/Graphs_and_Charts/

    >Jpgraph renders an excellent image from the examples but the prerequisite packages were many and ultimately the install/readme didn't work >for compiling the package. I could have looked further and found a solution, but with the number of prerequisites I dropped it looking for a >faster install. The next one I came across that gave a reasonable looking chart was phplot which only requires GD which is stock on my RH >distro. I got it up and working without any installation (not to mention dependencies). So I am up and running quickly and smoothly with >phplot. It's a shame jpgraphs' dependencies aren't packaged with the distro. The transparent option on the colors is really smooth and I just >don't have the time. Thanks to all for suggestions, I still want to look at one other site that was recommended here on the list.

    Larry S. Brown Dimension Networks, Inc. (727) 723-8388

    attached mail follows:


    Can't do wildcards like * because thats something that as I found out a few days ago, is expanded by the shell into a full command, so because your not running a shell, it can't be expanded and the raw unlink call to *.* fails because the unlink function doesn't understand wildcards. If you really want to do a recursive deletion (i.e., remove both a directory and everything under it) you could use:

    exec("/bin/rm -rf path/$name-of-dir-to-be-erased");

    Just be very sure about what your doing (multiple checks on the variable's value to make sure your not erasing anything you don't want to) cause this command, when executed with the proper permissions, will kill any directory and everything under it.

    On Wed, 2003-01-08 at 00:29, rwxend.net wrote:

    Ok, Jason, here's another one! I think I've read how to delete a file. I need to delete 25 files, then do a rmdir(blah); Line 16: $directory = "path/*.*"; Warning: Unlink failed (No such file or directory) in /mnt/ls6/17/169/00000000/htdocs/2003/_admin/del_listing_action.php on line 16 Warning: RmDir failed (File exists) in /mnt/ls6/17/169/00000000/htdocs/2003/_admin/del_listing_action.php on line 17 Thanks -- 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+HDSJF9k9BmZXCWYRAsqaAKCBDcoiBCfjIyECy9+deo9/RTfg6QCgixS5 KPJnqQpGv/d2JiFz4lrggsg=T/T6 -----END PGP SIGNATURE-----

    attached mail follows:


    That will usually work on Unix but will not work on Windows. Rather than executing an external program you can use PHP itself to do a recursive delete.

    There are examples at http://www.php.net/manual/en/function.rmdir.php if you read the user notes you will see several posts about doing this.

    Jason

    2003-01-08 at 07:24, Adam Voigt wrote: > Can't do wildcards like * because thats something that as I found out a > few > days ago, is expanded by the shell into a full command, so because your > not > running a shell, it can't be expanded and the raw unlink call to *.* > fails because > the unlink function doesn't understand wildcards. If you really want to > do a > recursive deletion (i.e., remove both a directory and everything under > it) you > could use: > > exec("/bin/rm -rf path/$name-of-dir-to-be-erased"); > > Just be very sure about what your doing (multiple checks on the > variable's > value to make sure your not erasing anything you don't want to) cause > this > command, when executed with the proper permissions, will kill any > directory > and everything under it. > > On Wed, 2003-01-08 at 00:29, rwxend.net wrote: > > Ok, Jason, here's another one! > > I think I've read how to delete a file. > I need to delete 25 files, then do a rmdir(blah); > > Line 16: $directory = "path/*.*"; > Warning: Unlink failed (No such file or directory) in > /mnt/ls6/17/169/00000000/htdocs/2003/_admin/del_listing_action.php > on line 16 > > Warning: RmDir failed (File exists) in > /mnt/ls6/17/169/00000000/htdocs/2003/_admin/del_listing_action.php > on line 17 > > Thanks > > -- > 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

    attached mail follows:


    What is the ASCII value of an EOF? Find that and use <? echo chr($eof_ascii_value); ?>

    Matt ----- Original Message ----- From: Jean-Christian Imbeault <jcmega-bucks.co.jp> To: <php-generallists.php.net> Sent: Wednesday, January 08, 2003 5:24 AM Subject: [PHP] Re: EOF: how to generate one in a string

    > I'm at wits end ... I've tried everything from system(), shell_exec(), > bacticks, popen() and still no go ... > > I even tried writing the data to file first and then doing a > system("./prog 2>&1 < ./datafile") and that didn't work either. > > I know that it shoudl work b/c if from the command line I issue the same > command (using the file created by PHP) it works fine. > > Can anyone offer advice on why I can't get PHP to execute this external > program? > > Thanks! > > Jc > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    Currently I have a script that reads an index file and from that index file it then loops through all files in that directory based on the index.

    Instead of one directory now I have several and I want to loop through each directory and go to each directory's index file. Since there is no pattern for the name if the indexes, I assume I need to create an array holding the directory name and the associated index file name like so $dirs = array("Sports" => "spindex.xml", "Business News" => "business.xml") etc

    Now, I need help with the loop to whip through each directory. Would I do a foreach on the array I just created? Any help would be greatly appreciated. I need to be able to access both the directory name and index name.

    Jeff

    attached mail follows:


    On Wed, 8 Jan 2003, Jeff Lewis wrote:

    > pattern for the name if the indexes, I assume I need to create an array > holding the directory name and the associated index file name like so > $dirs = array("Sports" => "spindex.xml", "Business News" => > "business.xml") etc > > Now, I need help with the loop to whip through each directory. Would I > do a foreach on the array I just created? Any help would be greatly > appreciated. I need to be able to access both the directory name and > index name.

    foreach() would work for you ...

    foreach( $dirs as $dirName => $indexName ){ $indexPath = "${dirName}/${indexName}"; $fh = fopen( $indexPath, "r" ); // ... fclose( $fh ); // I'm just guessing; do whatever you want in this loop }

    hth, ~Chris

    attached mail follows:


    Hey all. I noticed a string containing slashes was breaking some code of mine on an w2k/IIS box running php 4.2.3. For example ->

    <a href=\"http://www.apache.org/\" target=\"_blank\">

    When trying to apply stripslashes, the slashes remained. So I applied str_replace('\"', '', $var) and that worked. Any idea as to why stripslashes would not remove the slashes in the string?

    Thanks for any input.

    -- 
    Gerard Samuel
    http://www.trini0.org:81/
    http://dev.trini0.org:81/
    

    attached mail follows:


    On Wed, 8 Jan 2003, Gerard Samuel wrote:

    > <a href=\"http://www.apache.org/\" target=\"_blank\"> > > When trying to apply stripslashes, the slashes remained. So I applied > str_replace('\"', '', $var) and that worked. > Any idea as to why stripslashes would not remove the slashes in the string?

    stripslashes() will unescape single-quotes if magic_quotes_runtime = Off in your php.ini. If you have magic_quotes_runtime = On, then it will also unescape double-quotes (and backslashes and NULLs).

    ~Chris

    attached mail follows:


    I figured out the problem. magic_quotes_sybase was turned on, on the IIS box. All is well with stripslashes() again.

    Chris Wesley wrote:

    >On Wed, 8 Jan 2003, Gerard Samuel wrote: > > > >><a href=\"http://www.apache.org/\" target=\"_blank\"> >> >>When trying to apply stripslashes, the slashes remained. So I applied >>str_replace('\"', '', $var) and that worked. >>Any idea as to why stripslashes would not remove the slashes in the string? >> >> > >stripslashes() will unescape single-quotes if magic_quotes_runtime = Off >in your php.ini. If you have magic_quotes_runtime = On, then it will also >unescape double-quotes (and backslashes and NULLs). > > ~Chris > > > > >

    -- 
    Gerard Samuel
    http://www.trini0.org:81/
    http://dev.trini0.org:81/
    

    attached mail follows:


    -- 
    Ft. Meade cryptographic KGB munitions jihad nitrate class struggle
    Semtex radar spy Iran supercomputer Treasury FSF nuclear
    [See http://www.aclu.org/echelonwatch/index.html for more about this]
    

    attached mail follows:


    That did it! Thanks.

    On Wednesday, January 8, 2003, at 05:16 AM, Ford, Mike [LSS] wrote:

    >> -----Original Message----- >> From: Mike Tuller [mailto:phpce.anoka.k12.mn.us] >> Sent: 08 January 2003 01:23 >> >> I am working with sessions, and following an example in a book and am >> getting an error that I am not sure of. I have an html doc >> that has the >> fields for username and password and the information entered goes to >> this script. >> >> <? >> session_start(); > [...] >> if ($num > 0 ) >> { >> $valid_user = $_POST[username]; >> session_register("valid_user"); >> } >> >> // PHP script to create the html for the login page >> if (session_is_registered("valid_user")) > [...] >> >> Warning : Unknown(): Your script possibly relies on a session >> side-effect which existed until PHP 4.2.3. Please be advised that the >> session extension does not consider global variables as a source of >> data, unless register_globals is enabled. You can disable this >> functionality and this warning by setting session.bug_compat_42 or >> session.bug_compat_warn to off, respectively. in Unknown on line 0 >> >> What does this mean, and what am I doing wrong? > > Well, you're not necessarily doing anything wrong -- as the warning > says, your script *possibly* relies on... > > What's happened is that in version 4.3.0, a bug in session variable > handling was fixed -- but the fix changes the way session variables > behave in certain situations, and PHP has detected that you *may* have > coded in a way that is sensitive to those changes. If you understand > the issues (and I'm not 100% sure I do!) and are *sure* you're not > relying on them, then you can set the session.bug_compat_* values in > php.ini as specified. > > The best way of avoiding this error, however, is to drop the use of > session_register() and friends, and switch to using the $_SESSION[] > array -- so the fragment of code I've left in above would become: > > if ($num > 0 ) > { > $_SESSION['valid_user'] = $_POST['username']; > } > > // PHP script to create the html for the login page > if (isset($_SESSION["valid_user"])) > > 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:


    Hello,

    I want to share the code (php-extension) I have included into php-4.2.2 to support CDK widgets (http://gd.tuwien.ac.at/hci/cdk/?file=cdk.tar.gz&type=listing) to enable PHP to use text based "GUI" in terminal environment.

    CDK supports: -Alphalist (list with alphanumeric search) -Calendar dialog box -Dialog -Entry field with type masking -Scale field -2 dimension graphics (text mode) -Histogram display -Item list field -Label -Marque (text box in movement) -Matrix field -Menu -Scroll -Selection field -Slider field -Radio button -Template field

    CDK is very complete library to handle text based objects with ncurses.

    What I have included from it to php is: -Entry field -Alphalist -Menu -Label

    Right now we use it at Agua y Saneamiento de Toluca (a Mexican Government Office) and it has been very usefull. The code is located in ext/cdk directory , it doesn't include all the CDK features, it is like 10% of it right now, but the interface is already there and open to developers who want to extend it:

    ftp://www.ayst.gob.mx/pub/php-with-cdk-widgets/

    Best regards Nikolai

    attached mail follows:


    In case any one else needs to know: I had to erase the rpm version of gd, gd-devel and libpng, libpng-devel The rpm versions were 1.0.12. For some reason the configure option -with-png-dir=../libpng-1.2.1 was using the headers from the right dir, but somehow used the rpm version for compiling instead. Is this a bug? Shouldn't it use libpng-1.2.1 for everything? Once I got rid of the rpm versions, I know longer had a problem.

    ----- Original Message ----- From: "PHP List" <php_listibcnetwork.net> To: "php" <php-generallists.php.net> Sent: Tuesday, January 07, 2003 4:34 PM Subject: [PHP] Upgrade help!

    Hi, I am trying to upgrade to php4.3.0, everything works, but when I try to use any gd image functions I get the following error:

    libpng warning: Application was compiled with png.h from libpng-1.2.1 libpng warning: Application is running with png.c from libpng-1.0.12 gd-png: fatal libpng error: Incompatible libpng version in application and library [Tue Jan 7 16:30:21 2003] [notice] child pid 14014 exit signal Segmentation fault (11)

    I downloaded and installed libpng-1.2.1 I configured php with: ./configure' '--with-jpeg-dir=../jpeg-6b' '--with-mysql=/usr/' '--with-apxs=/usr/local/apache/bin/apxs' '--with-gd' '--with-mcrypt=../libmcrypt-2.4.22' '--with-png-dir=../libpng-1.2.1' '--with-zlib-dir=../zlib-1.1.3' '--enable-exif' '--with-freetype-dir=../freetype-2.1.3'

    Where is is getting the libpng-1.0.12 from? I can't find it anywhere on the server. I am using apache 1.3.27 on redhat 7

    Thanks for any help.

    attached mail follows:


    I thought autocompletion would help you _avoid_ silly mistakes. For example, defining $varName then trying to use $varname when you really meant to use $varName.

    In php I would say it's a tossup because if you reference a variable that doesn't exist it will contain a NULL or FALSE value but php will not warn you. But in something like C I would have to agree that autocompletion can lead to much more difficult problems to track down. Because in C, if you never assign the variable the compiler (depending on the compiler of course) will warn you. If you accidentially assign a subtilly different variable that can be hard to track down, and the compiler will only warn you if it's a different datatype.

    --Buddy

    attached mail follows:


    Hello php-general, I'm trying to figure out why I can't upload any file in php.

    Form code ======== <form name="photoform" action="photos.php" method="post" enctype="multipart/form-data"> <input type="hidden" name="MAX_FILE_SIZE" value="40960"> <table border="0" cellspacing="0" cellpadding="2"> <tr> <td colspan="2" class="emphasis">Use this form to upload your new photographs. Note: only JPEG (.jpg) and PNG (.png) files allowed. Maximimum allowed file size is 40KB.</td> </tr> <tr> <td>Photograph: </td> <td><input type="file" name="photo" /></td> </tr> <tr> <td>Description: </td> <td> <textarea name="photodesc" rows="3" cols="30"><?php echo $_POST["photodesc"] ?></textarea> </td> </tr> <tr> <td colspan="2" align="center"><input type="submit" name="fileupload" value="Upload" /></td> </tr> </table> </form>

    PHP code ======= <?php if ($_POST["fileupload"] == "Upload") { $errormsg = ""; $photospath ="/home/freeman/upload"; $filename = $_FILES['photo']['name']; $filetype = $_FILES['photo']['type']; $filesize = (int) $_FILES['photo']['size'];

    if ($filetype == "image/jpeg" || $filetype == "image/pjpeg" || $filetype == "image/png" || $filetype == "image/x-png") { if ($filesize < 40960 && $filesize > 0) { $storename = $uniqueid = md5 (uniqid (rand)); if ($filetype == "image/jpeg" || $filetype == "image/pjpeg") $storename .= ".jpg"; if ($filename == "image/png" || $filetype == "image/x-png") $storename .= ".png"; $desc = $_POST["photodesc"];

    // Store the file in the photos folder and add record to database if (is_uploaded_file ($_FILES['photo']['tmp_name'])) { if (!move_uploaded_file ($_FILES['photo']['tmp_name'], $photospath.$storename)) { $errormsg .= " Problem uploading the file. Please try again. If the problem persists please email supporthuntclubservices.com to report the error."; } else { chmod ($photospath.$storename, 0644); $sql = "INSERT INTO hcs_photos (clientID,photoName,photoTitle,uploadTimeStamp) VALUES ('". $_SESSION["clientID"] ."','$storename','$desc','$timestamp')"; $db->Query ($sql, $conn); }

    } else { $errormsg .= "Possible file upload attack. Filename: ". $_FILES['photo']['name']; } } else { $errormsg .= "Invalid file size. Maximum of 40KB allowed"; } } else { $errormsg .= "Invalid file type. Only JPEG and PNG files allowed"; } if (strlen ($errormsg) < 5) { header ("Location: ". $baseurl ."photos.php"); } } ?>

    When I upload a file I get $filesize equal to 0.

    In my php.ini i got the following section: ; Whether to allow HTTP file uploads. file_uploads = On

    ; Temporary directory for HTTP uploaded files (will use system default if not ; specified). upload_tmp_dir = "/tmp"

    ; Maximum allowed size for uploaded files. upload_max_filesize = 2M

    Please help. PHP even does not create a temp file in a temp directory. /tmp got permission 777

    I'm running Apache 2.0.43 and RedHat Linux

    -- 
    Best regards,
     Submission.org.ru                          mailto:freemansubmission.org.ru
    

    attached mail follows:


    Hy Guys,

    I´m a newby here.

    I´am trying to compile PHP 4.3.0 with Oracle support. When it compiles oci8.c , it returns an error, like follows:

    /bin/sh libtool --silent --mode=compile gcc -Iext/oci8/ -I/usr/src/php-4.3.0/ext/oci8/ -DPHP_ATOM_INC -I/usr/src/ph p-4.3.0/include -I/usr/src/php-4.3.0/main -I/usr/src/php-4.3.0 -I/usr/src/ph p-4.3.0/Zend -I/usr/include/imap -I/opt/oracle/product/8.1.5/rdbms/demo -I/o pt/oracle/product/8.1.5/network/public -I/opt/oracle/product/8.1.5/plsql/pub lic -I/usr/src/php-4.3.0/ext/xml/expat -DLINUX=22 -DMOD_SSL=208111 -DUSE_HS REGEX -DEAPI -DUSE_EXPAT -I/usr/src/php-4.3.0/TSRM -g -O2 -prefer-pic -c /usr/src/php-4.3.0/ext/oci8/oci8.c -o ext/oci8/oci8.lo /usr/src/php-4.3.0/ext/oci8/oci8.c: In function `zif_ocierror': /usr/src/php-4.3.0/ext/oci8/oci8.c:4271: `OCI_ATTR_STATEMENT' undeclared (first use in this function) /usr/src/php-4.3.0/ext/oci8/oci8.c:4271: (Each undeclared identifier is reported only once /usr/src/php-4.3.0/ext/oci8/oci8.c:4271: for each function it appears in.) make: *** [ext/oci8/oci8.lo] Error 1

    With PHP 4.2.3 and belower, it worked fine. Anyone has any ideas?

    Thanks very much, José Manuel Valente

    attached mail follows:


    Hi, I am running a really simple php script to upload files on my server via ftp. But it always return this warning: ftp_put(): Permission denied I can't have to do anything with CHMOD can it? I mean it's ftp!! I don't know what else it is but I guess it's a pretty common problem. Thx for any help, Olli

    attached mail follows:


    I am assuming you have testing from a desktop client.

    Are you sure that the PHP script has been logged in??

    Can you see via a log file of the successful authentication??

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

    > -----Original Message----- > From: Oliver Witt [mailto:oliverwittt-online.de] > Sent: Thursday, 9 January 2003 4:53 AM > To: php-generallists.php.net > Subject: [PHP] ftp_put: permission denied > > > Hi, > I am running a really simple php script to upload files on my > server via ftp. But it always return this warning: ftp_put(): > Permission denied I can't have to do anything with CHMOD can > it? I mean it's ftp!! I don't know what else it is but I > guess it's a pretty common problem. Thx for any help, Olli > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    "Timothy Hitchens )" schrieb:

    > I am assuming you have testing from a desktop client. > > Are you sure that the PHP script has been logged in?? > > Can you see via a log file of the successful authentication?? >

    I logged in using the same information as I used to upload that script.

    if ((!$conn_id) || (!$login_result)) { echo "Not logged in"; die; } else { echo "Logged in"; }

    That script returned Logged in. Olli

    attached mail follows:


    Using ftp_login() ??

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

    > -----Original Message----- > From: Oliver Witt [mailto:oliverwittt-online.de] > Sent: Thursday, 9 January 2003 5:30 AM > To: php-generallists.php.net; Timothy Hitchens ) > Subject: Re: [PHP] ftp_put: permission denied > > > "Timothy Hitchens )" schrieb: > > > I am assuming you have testing from a desktop client. > > > > Are you sure that the PHP script has been logged in?? > > > > Can you see via a log file of the successful authentication?? > > > > I logged in using the same information as I used to upload > that script. > > if ((!$conn_id) || (!$login_result)) { > echo "Not logged in"; > die; > } else { > echo "Logged in"; > } > > That script returned Logged in. > Olli > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    I uploaded that script with a common ftp program on my server in the internet. FOr the host, user and pw, I use the same data as I use to log in with my ftp program. So the mistake can't be there. This is how that script basically works:

    <?php if(isset($destiny)){ $ftp_server = "host"; $benutzername = "user"; $passwort = "pw"; $connection_id = ftp_connect("$ftp_server"); $login_result = ftp_login($connection_id, "$benutzername", "$passwort");

    $upload = ftp_put($connection_id, $destiny, $local_file, FTP_ASCII); if (!$upload) { echo "<p>It didn't work</p>";} else { echo "<p>It did work</p>";} ftp_quit($connection_id);} ?>

    <html> <head> <title></title> </head> <body bgcolor="#FFFFFF" text="#000000"> <form action="upload.php" enctype="multipart/form-data" method="POST"> <input name="local_file" type="file" size="50"> <br> <input type="text" name="destiny"> <br> <input type="submit" value="Submit"> </form> </body> </html>

    "Timothy Hitchens )" schrieb:

    > Using ftp_login() ?? > > Timothy Hitchens (HiTCHO) > Open Platform Consulting > e-mail: timhitcho.com.au > > > -----Original Message----- > > From: Oliver Witt [mailto:oliverwittt-online.de] > > Sent: Thursday, 9 January 2003 5:30 AM > > To: php-generallists.php.net; Timothy Hitchens ) > > Subject: Re: [PHP] ftp_put: permission denied > > > > > > "Timothy Hitchens )" schrieb: > > > > > I am assuming you have testing from a desktop client. > > > > > > Are you sure that the PHP script has been logged in?? > > > > > > Can you see via a log file of the successful authentication?? > > > > > > > I logged in using the same information as I used to upload > > that script. > > > > if ((!$conn_id) || (!$login_result)) { > > echo "Not logged in"; > > die; > > } else { > > echo "Logged in"; > > } > > > > That script returned Logged in. > > Olli > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > >

    attached mail follows:


    it may be, that destiny is wrong. the error-message tells that you don't have access to where you are trying to upload the file to.

    Thomas

    On Wed, 08 Jan 2003 20:59:02 +0100 oliverwittt-online.de (Oliver Witt) wrote:

    > I uploaded that script with a common ftp program on my server in the > internet. > FOr the host, user and pw, I use the same data as I use to log in with > my ftp program. So the mistake can't be there. > This is how that script basically works: > > <?php > if(isset($destiny)){ > $ftp_server = "host"; > $benutzername = "user"; > $passwort = "pw"; > $connection_id = ftp_connect("$ftp_server"); > $login_result = ftp_login($connection_id, "$benutzername", "$passwort"); > > $upload = ftp_put($connection_id, $destiny, $local_file, FTP_ASCII); > if (!$upload) { > echo "<p>It didn't work</p>";} > else { > echo "<p>It did work</p>";} > ftp_quit($connection_id);} > ?> > > <html> > <head> > <title></title> > </head> > <body bgcolor="#FFFFFF" text="#000000"> > <form action="upload.php" enctype="multipart/form-data" method="POST"> > <input name="local_file" type="file" size="50"> > <br> > <input type="text" name="destiny"> > <br> > <input type="submit" value="Submit"> > </form> > </body> > </html> > > > > "Timothy Hitchens )" schrieb: > > > Using ftp_login() ?? > > > > Timothy Hitchens (HiTCHO) > > Open Platform Consulting > > e-mail: timhitcho.com.au > > > > > -----Original Message----- > > > From: Oliver Witt [mailto:oliverwittt-online.de] > > > Sent: Thursday, 9 January 2003 5:30 AM > > > To: php-generallists.php.net; Timothy Hitchens ) > > > Subject: Re: [PHP] ftp_put: permission denied > > > > > > > > > "Timothy Hitchens )" schrieb: > > > > > > > I am assuming you have testing from a desktop client. > > > > > > > > Are you sure that the PHP script has been logged in?? > > > > > > > > Can you see via a log file of the successful authentication?? > > > > > > > > > > I logged in using the same information as I used to upload > > > that script. > > > > > > if ((!$conn_id) || (!$login_result)) { > > > echo "Not logged in"; > > > die; > > > } else { > > > echo "Logged in"; > > > } > > > > > > That script returned Logged in. > > > Olli > > > > > > > > > > > > -- > > > PHP General Mailing List (http://www.php.net/) > > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > >

    attached mail follows:


    Hi Sean Burlington, et al ...

    Sorry for the slow response, been really sick lately ...

    Just wanted to thank y'all for offering h & s. Ended up doing it with hidden fields ... also made it a bit easier to make the validation script put the info back into the form ...

    After testing things out I actually got the answer to all my questions ... just had to change some of the fields so that my mailserver would actually delier the mail...

    thx

    Rene

    On Mon, 30 Dec 2002 00:40:53 +0000, you wrote about "Re: [PHP] Rookie mail() q's .. can't find answer after RTFM..." something that looked like this: >> Q 1: >> >> Well, building the form and making the page preview the message is the >> easy part. But how do I make the page retain the message so that I can 1. >> actually send the thing after the second submit, and 2. make it fill out >> the form when user wish to alter message (or there's an error) ??? > >either put the fields you want as hidden fields in the preview page > >or > >store them as session variables > >> Q 2: >> >> The manual doesn't really say it that clearly, but do I need to have the >> content-type field when the message is plain text already? > >plain text is the default > >> And should I be adding a Date: field, or does the mail() function figure >> that out itself? > >I'm not sure - have you tried it ? > >> My incoming mail server does not accept messages without a date field, so >> if I need to add it, I'd really like to know. It also doesn't like >> messages with more than 1 of each field...(except received-by). >> > >just look at an email in your inbox and copy the format of the date field. > >-- > >Sean :)

    -- 
    Rene Brehmer
    

    This message was written on 100% recycled spam.

    Come see! My brand new site is now online! http://www.metalbunny.net

    attached mail follows:


    Does anybody know how to implement the 8 and 16 bit versions of Fletcher's checksum using PHP? I hit google and came up dry. It's easy enough to find how to do it in C, but PHP if a different story.

    I know there are plenty of perfectly good checksum options that are standard in PHP, but I'm forced to used Fletcher's for work.

    If anybody can point me to a URL or give a code example, it would be greatly apreciated.

    Best Regards,

    David Gervais

    attached mail follows:


    Hello,

    I have searched the archives and not been able to find the solution to the following problem. I would be very grateful if someone here could help or provide some pointers.

    The basic problem is this:

    Our apache server will not start if there are system processes running that were spawned from apache's last invocation (ie. spawned from cgi's, mod_php system() calls, etc.). It dies with "cannot bind to ip_address_here port 80", etc.

    Example:

    We restart our servers every so often via crontab in order to reload modified conf files, etc. However it appears that if a user has spawned a process from mod_php, cgi, etc. that the server will not restart until those processes are killed off manually.

    The worst cases are when badly wrote user scripts allow an attacker to upload scripts that bind to a port and attempt to make network access, etc. (I would love to disallow users from having uploads to the server but that is not currently an option).

    Does anyone have any suggestion on how to automagically kill these processes?

    Does anyone have their own favorite recipe for stopping/starting apache in an automated fashion.

    Right now these situations result in downtime for users and a pager in the middle of the night to me! I would very much like to stop this :)

    Thanks much!

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

    attached mail follows:


    use: apachectl graceful

    It will reload the config's and allow operation to continue!!

    See apachectl (help)

    start - start httpd stop - stop httpd restart - restart httpd if running by sending a SIGHUP or start if not running fullstatus - dump a full status screen; requires lynx and mod_status enabled status - dump a short status screen; requires lynx and mod_status enabled graceful - do a graceful restart by sending a SIGUSR1 or start if not running configtest - do a configuration syntax test help - this screen

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

    > -----Original Message----- > From: Hugh Beaumont [mailto:hbeaumontyahoo.com] > Sent: Thursday, 9 January 2003 5:14 AM > To: php-generallists.php.net > Subject: [PHP] apache + mod_php question > > > Hello, > > I have searched the archives and not been able to find the > solution to > the following problem. I would be very grateful if someone > here could help or provide some pointers. > > The basic problem is this: > > Our apache server will not start if there are system > processes running that were spawned from apache's last > invocation (ie. spawned from cgi's, mod_php system() calls, > etc.). It dies with "cannot bind to ip_address_here port 80", etc. > > > Example: > > We restart our servers every so often via crontab in order to > reload modified conf files, etc. However it appears that if > a user has spawned a process from mod_php, cgi, etc. that the > server will not restart until those processes are killed off > manually. > > The worst cases are when badly wrote user scripts allow an > attacker to upload scripts that bind to a port and attempt to > make network access, etc. (I would love to disallow users > from having uploads to the server but > that is not currently an option). > > Does anyone have any suggestion on how to automagically kill > these processes? > > Does anyone have their own favorite recipe for > stopping/starting apache in an automated fashion. > > Right now these situations result in downtime for users and a > pager in the middle of the night to me! I would very much > like to stop this :) > > Thanks much! > > > __________________________________________________ > Do you Yahoo!? > Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com

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

    attached mail follows:


    ok - let me take that a step further - if I store the SID in the table also are the files in the /tmp directory stored with the SID? if they are this may be a way I can delete out inactive session, but be able to allow extended inactive sessions for users who may be pulling lengthy reports...

    "Timothy Hitchens )" <phplistshitcho.com.au> wrote in message news:007e01c2b6c4$4612d600$0500a8c0bambino... > Arr the garbage collection is based on a probability > (session.gc_probability) and therefore it will clean > up if you get enough hits to the server. Check the documentation for > config of sessions. > > I use db for sessions with a check to ensure db is available. (you can > then cleanup whatever you want) > > > > Timothy Hitchens (HiTCHO) > Open Platform Consulting > e-mail: timhitcho.com.au > > > -----Original Message----- > > From: edhome.homes2see.com [mailto:edhome.homes2see.com] > > Sent: Wednesday, 8 January 2003 1:11 PM > > To: Timothy Hitchens (HiTCHO) > > Cc: 'Jeff Bluemel'; php-generallists.php.net > > Subject: RE: [PHP] anyway to do a 'whos online' from session variable? > > > > > > > > > > On Wed, 8 Jan 2003, Timothy Hitchens (HiTCHO) wrote: > > > > > Hmm... yes you could create an array of the files then > > check the last > > > mod stamp using stat (remember to reset stat). > > > > > > Sessions are also cleaned up via the garbage collection system > > > controlled via php.ini > > > > How do you force garbage collection? I've written an > > application using sessions for storage and there's been a > > session sitting in my /tmp directory for 2 days now, well > > over the 1440 seconds expiration. > > > > Ed > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > >

    attached mail follows:


    If you use a database for session management you have total control over when and what is garbage collected and therefore extend / delete whatever anytime you want.

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

    > -----Original Message----- > From: Jeff Bluemel [mailto:jeffdomintcom.com] > Sent: Thursday, 9 January 2003 5:24 AM > To: php-generallists.php.net > Subject: Re: [PHP] anyway to do a 'whos online' from session variable? > > > ok - let me take that a step further - if I store the SID in > the table also are the files in the /tmp directory stored > with the SID? if they are this may be a way I can delete out > inactive session, but be able to allow extended inactive > sessions for users who may be pulling lengthy reports... > > > "Timothy Hitchens )" <phplistshitcho.com.au> wrote in > message news:007e01c2b6c4$4612d600$0500a8c0bambino... > > Arr the garbage collection is based on a probability > > (session.gc_probability) and therefore it will clean > > up if you get enough hits to the server. Check the > documentation for > > config of sessions. > > > > I use db for sessions with a check to ensure db is > available. (you can > > then cleanup whatever you want) > > > > > > > > Timothy Hitchens (HiTCHO) > > Open Platform Consulting > > e-mail: timhitcho.com.au > > > > > -----Original Message----- > > > From: edhome.homes2see.com [mailto:edhome.homes2see.com] > > > Sent: Wednesday, 8 January 2003 1:11 PM > > > To: Timothy Hitchens (HiTCHO) > > > Cc: 'Jeff Bluemel'; php-generallists.php.net > > > Subject: RE: [PHP] anyway to do a 'whos online' from session > > > variable? > > > > > > > > > > > > > > > On Wed, 8 Jan 2003, Timothy Hitchens (HiTCHO) wrote: > > > > > > > Hmm... yes you could create an array of the files then > > > check the last > > > > mod stamp using stat (remember to reset stat). > > > > > > > > Sessions are also cleaned up via the garbage collection system > > > > controlled via php.ini > > > > > > How do you force garbage collection? I've written an application > > > using sessions for storage and there's been a session > sitting in my > > > /tmp directory for 2 days now, well over the 1440 seconds > > > expiration. > > > > > > Ed > > > > > > > > > > > > -- > > > 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,

    Thanks for all the suggestions. I guess I should have given a more detail description. My employer have just provided me with some background information of the setup:

    Our data come in mostly automatically by FTP on to our Vax, then eventually moved on to our R30 (RS6000/AIX) and then H80 (RS6000/AIX). The databases are running on the 2 RS6000's. Although we have numerous scripts processing the data along the route, my employer would prefer to have this system checking independently the situation/condition of the upload. Besides, if the original data processing script crashes before any error message can be sent, we might still don't know if there is a problem.

    There are files on various machines to look for that indicate the status of the update. So this program may go to look for these signs in order to collect the update status. For making the information available to our staff, the most convenient way for them is via a web page. Although the information is not as confidential as such, it would be nice to be able to password protect the contents. There is also a need for selected staff to manually update certain fields of a record (publication), e.g. Reason for Delay. So the web page should be able to capture manual text input from authorized staff and updated to the status information.

    Anyways thanks a lot for all your suggestions. All your kind suggestions would help me to have a head start on this project.

    Kelvin

    >From: "Larry Brown" <larry.browndimensionnetworks.com> >To: "PHP List" <php-generallists.php.net> >Subject: RE: [PHP] Re: Need a suggestion on developing a php-related system >Date: Wed, 8 Jan 2003 02:52:11 -0500 > >From the remark about the arrival and departure time scenario, it sounds >like you want to show whether the updates occurred and when they >began/ended. If this is accurate, you should find out whether the scripts >used to populate those databases record that information for the database >it >is updating. If so you need to create a script that opens each database >and >queries that data. If they do not record these things you could either >modify them to do so or you could have them also connect to a central db >that you create to store this collection of data to show beginning and >ending of the scripts. I think either way you should store this in your >own >db. Is this along the lines of what you had in mind? > >Larry S. Brown >Dimension Networks, Inc. >(727) 723-8388 > > > > >On 01/08/2003 03:40 AM, Kelvin Poon wrote: > > HI, I am new to PHP and I am just wondering if anyone could give me some > > help. > > > > I am currently working for infomart.ca, it is basically a company that > > sells articles (news/business). MY employer require me to develop a > > system using Perl and PHP, and the assignment is as follow: > > > > To develop a system that collects, stores, processes and disseminates > > internally the updating status of our databases. > > > > We currently have over 200 databases from various daily newspapers, > > magazines, TV transcripts and other periodicals. Most of them are > > updated every weekday between 4a.m. and 7a.m.. Others are updated on a > > weekly or monthly basis. THe update schedule Tv. the actual status need > > to be captured and made available to internal staff. This is similar to > > the flight departure/arrival information in an airport. > > > > > > > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php

    _________________________________________________________________ MSN 8: advanced junk mail protection and 2 months FREE*. http://join.msn.com/?page=features/junkmail

    attached mail follows:


    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.

    If I have a bunch of plain text data, how can I pull out the strings containing "http". I've tried several different things but what I end up with is more or less than what I want. Once I have this, I can add the URL code and replace the string but I haven't figured out how to do this.

    For example, what would I do if my text looks like this (not including the astrices):

    ****************************************************** This is a test. It is only a test. What happens when I include a URL in my results text?

    http://not.a.real.url/programs

    This is only a test ******************************************************

    Anyone? Anyone?

    Thanks,

    Katherine

    -----Original Message----- From: ELLIOTT,KATHERINE A (HP-FtCollins,ex1) [mailto:katherine.elliotthp.com] Sent: Tuesday, January 07, 2003 2:36 PM To: php-generallists.php.net Subject: [PHP] Adding HTTP URL Code

    Hello,

    I have a string of data that can be anywhere from one line (a single URL) to many, many lines. The data is in plain text but, as I alluded, may contain one or more URLs (or none). I then take this data and put it on a web page so I would like to make any URLs in the data live. Has anyone on the list done this? If so, can you tell me how? I'm stumped.

    Thanks,

    Katherine

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

    attached mail follows:


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

    attached mail follows:


    On Wed, 8 Jan 2003, 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.

    The follow-up inquery makes much more sense than the original ;)

    > If I have a bunch of plain text data, how can I pull out the > strings containing "http". I've tried several different things > but what I end up with is more or less than what I want. > Once I have this, I can add the URL code and replace the > string but I haven't figured out how to do this.

    Say that the paragraph you gave is a string in a variable, $TEXT ...

    $allowedChars = "/:\w.#~?%+=&!-"; preg_match_all( "{\bhttp:[$allowedChars]+?(?=[$.:?\-]*[^$allowedChars]|$)}x", $TEXT, $URLS ); foreach( $URLS[0] as $link ){ print( "<a href=\"${link}\">${link}</a>\n" ); }

    That should get ya started. Read up on regular expressions, and the regexp functions in PHP to make heads & tails out of the code, other than "it works." (So far it works well for my intentionally limited purposes ... I wouldn't be surprised that someone finds a case where my code breaks, or someone can/does easily extend the regexp to grok more stuff.)

    http://www.oreilly.com/catalog/regex2/ http://www.php.net/manual/en/ref.pcre.php http://www.php.net/manual/en/ref.regex.php

    g.luck, ~Chris

    attached mail follows:


    Hi All! I would like to redirect the user to another php page accordingly to his/her chosen options, example: if ($Color == "Yellow") { go to page .... else if ($Color == "Green") go to page .... }

    Does anyone knows how to achieve the goal??

    Thanks

    Teo

    attached mail follows:


    http://groups.google.com/groups?num=30&hl=en&lr=&ie=UTF-8&oe=UTF-8&safe=off& q=url+redirect+php -Kevin

    ----- Original Message ----- From: "Teo Petralia" <t.mattiozziauckland.ac.nz> To: <php-generallists.php.net> Sent: Wednesday, January 08, 2003 1:46 PM Subject: [PHP] How can I redirect to another php page

    > Hi All! > I would like to redirect the user to another php page accordingly to > his/her chosen options, example: > if ($Color == "Yellow") { > go to page .... > else if ($Color == "Green") > go to page .... > } > > Does anyone knows how to achieve the goal?? > > Thanks > > Teo > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >

    attached mail follows:


    You could use an include statement in one of two ways. 1) you can just include the page that you want to show, however the url doesn't change it will still be select.php 2) if you want to sent them to yellow.php or green.php you could include an html page that had a meta-refresh in it set for 0 seconds to move them to the seperate pages.

    -----Original Message----- From: Teo Petralia <t.mattiozziauckland.ac.nz> To: php-generallists.php.net Date: Thu, 9 Jan 2003 09:46:30 +1300 Subject: [PHP] How can I redirect to another php page

    > Hi All! > I would like to redirect the user to another php page accordingly to > his/her chosen options, example: > if ($Color == "Yellow") { > go to page .... > else if ($Color == "Green") > go to page .... > } > > Does anyone knows how to achieve the goal?? > > Thanks > > Teo > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php

    attached mail follows:


    header("location: nextpage.php");

    the above must be sent before any other text is output

    ----- Original Message ----- From: "Teo Petralia" <t.mattiozziauckland.ac.nz> To: <php-generallists.php.net> Sent: Wednesday, January 08, 2003 2:46 PM Subject: [PHP] How can I redirect to another php page

    Hi All! I would like to redirect the user to another php page accordingly to his/her chosen options, example: if ($Color == "Yellow") { go to page .... else if ($Color == "Green") go to page .... }

    Does anyone knows how to achieve the goal??

    Thanks

    Teo

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

    attached mail follows:


    Hello Sean,

    oh i must correct myself ;)) .....

    or try to use this: print "<img src=\"".$row["foto"]."\" width=\"104\" height=\"137\">"; or just print "<img src=\"".$row["foto"]."\" width=104 height=137>";

    looks like u have error here: print "<img src=\"" . $row["foto"] . "" width='104' height='137'\">"; ^ ^^ ^ - use \ before " ^^- no need to use both \ and " remove those two characters

    or try this

    your php ?> <img src="<? echo $row["foto"];?>" width=104 height=137> <? your php

    -- 
    Best regards,
     Martin                          mail   corwincorwin.sk
                                     mobile +421.907.303.393
                                     icq    34358414
                                     www    http://www.corwin.sk
    

    PGP key fingerprint 21365ca05ecfd8aeb1cf19c838fff033

    "In those days spirits were brave, the stakes were high, men were real men, women were real women and small furry creatures from Alpha Centauri were real small furry creatures from Alpha Centauri."

    by Douglas Adams

    Wednesday, January 8, 2003, 8:55:08 PM, you wrote:

    SB> Ezequiel Sapoznik wrote: >> I am having a parse error in the following sentence: >> >> print "<img src=\"" . $row["foto"] . "" width='104' height='137'\">"; >>

    SB> it would help if you posted the actual error message !

    SB> but try this ...

    SB> print '<img src="' . $row["foto"] . '" width="104" height="137">';

    SB> or

    SB> print "<img src=\"" . $row["foto"] . "\" width='104' height='137'\">";

    SB> --

    SB> Sean

    attached mail follows:


    hi i am considering the move from fast template to xslt , is there any benifits for this ? also is there a way to intergrate xsl like fast template ie parse rows in the php script

    attached mail follows:


    Hi everyone, I am new to this list, so this is my first post.

    I am trying to sen dan HTML email, and so far I got everything running, except for one very odd problem.

    1.) I am setting up all my variables within the .php Script. 2.) I generate my HTML email 3.) I am outputting the email to the browser and send it to myself

    --> Now here comes the problem:

    In the browseroutput the text looks like I want it to be. In the email however, there are several EXCLAMATION MARKS ("!") added to the code (and therefore the body). How can this happen?? Is there some trick I have missed? The exclamation marks are positioned within the email according to the amaount of characters I submit with the email.

    I have set up a simple page where you can view the .php file, the output and the email.

    http://www.gsdh.org/pleasehelp/index.html

    If anyone of you could spare the time, I would be really gratefull as I have to finish this but am stuck! :(

    Thans again, Philipp

    attached mail follows:


    Is this a php.ini or apache setting?

    "Marek Kilimajer" <kilimajerwebglobe.sk> wrote in message news:3E1BEF6B.6000407webglobe.sk... > You should be able to get around it also by checking > if $_SERVER[REQUEST_METHOD]=='HEAD' > > Timothy Hitchens (HiTCHO) wrote: > > >When they first click on the file their browser will make a request for > >type, size etc > >then when it display's the dialog box on the screen of the client it > >will make another > >request to start the download. > > > >I get around this by putting the session id into the database and if it > >is double requested within > >5 seconds to discard. So you will need to do a select, num_rows then if > >below 1 insert. > > > > > >Timothy Hitchens (HiTCHO) > >Open Platform Consulting > >e-mail: timhitcho.com.au > > > > > > > >>-----Original Message----- > >>From: Altug Sahin [mailto:altugbonsai-apart.com] > >>Sent: Wednesday, 8 January 2003 2:07 PM > >>To: php-generallists.php.net > >>Subject: [PHP] Re: Double entry into MySQL.. > >> > >> > >>Another strange behaviour... When I send the name of the file > >>to be downloaded to this script, it works (still makes a > >>double entry into MySQL > >>though) with GET method but it doesn't work if the file's > >>name is sent with the POST method. > >> > >>Why? I am pulling my hair out here!!! > >> > >>Please help... > >> > >>Thanks again > >> > >>"Altug Sahin" <altugbonsai-apart.com> wrote in message > >>news:20030107000217.7493.qmailpb1.pair.com... > >> > >> > >>>Hi here, > >>> > >>> > >>> > >>> > >>I am sending a file to user's browser and logging the downloaded file > >> > >> > >>>into MySQL but everytime this script works, I see double > >>> > >>> > >>entry in the > >> > >> > >>>MySQL table... Why is this happening? > >>> > >>>Any ideas? > >>> > >>>Thanks > >>> > >>><? > >>> $today = date("Y-m-d"); > >>> > >>> $conn = db_connect(); > >>> > >>> if(!$conn) > >>> echo "Can't connect to database..."; > >>> > >>> $query = "INSERT INTO track_dl (dldate, email, file) > >>> VALUES ('$today', 'useremail.com', 'file.ext')"; > >>> > >>> $result = mysql_query($query); > >>> > >>> if(!$result) > >>> echo "Can't execute query: " . mysql_error(); > >>> > >>>header("Content-type: application/pdf"); readfile("file.pdf"); > >>>exit(); > >>>?> > >>> > >>> > >>> > >>> > >> > >>-- > >>PHP General Mailing List (http://www.php.net/) > >>To unsubscribe, visit: http://www.php.net/unsub.php > >> > >> > >> > > > > > > > > >

    attached mail follows:


    Hello,

    I have a question. First of all, I want to save the data a user has typed in a form into a MySQL database so they can load it up for later use but, I need to first submit all the form vars on the current page from a link. This may be Javascript, but either way, I'm not sure how to do it. Any ideas? Here's a graph kinda...

    -User enters form and submits the first page --User taken to second form ---User fills out the first two fields ----User clicks a "Save Progress" link and all form fields submitted (I can do beyond this part but just so you get the idea of what I mean) -----PHP saves current form vars to a MySQL database ------User told information saved and he leaves -------User comes back next day, clicks load --------User select his current project ---------User taken to the last form he was on, fields filled in

    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:


    This may be a no-brainer for everyone but me but ... I have several php scripts residing on a web site on Server A. In a library file on Server A are misc. functions, some of which query an underlying database and return a text string as the result. On another web site on Server B I would like to call these functions to get the result without reinventing the wheel so to speak. So my question is ... How can I call a function that returns a text string from Server A in a script requiring that text during the processing of a web page on Server B ... all in php? Thanks in advance.

    Bill

    attached mail follows:


    If I understand you want to be able to get a value from a script on another server.

    Well I would suggest a really each way would be to do have the calling server call a script on the supplying server using include(); which is supported but please see this page regarding URL fopen wrappers:

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

    Requests for includes and on the supplying server simply output the value like:

    <?php

    $answer = 'no';

    ?>

    If you do it this way it will be simply included and be available as a variable instantly.

    (**subject to security issues and speed)

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

    > -----Original Message----- > From: Bill Arbuckle, Jr. [mailto:billwingshooter.net] > Sent: Thursday, 9 January 2003 8:17 AM > To: php-generallists.php.net > Subject: [PHP] How Do I Return Values Across Servers > > > This may be a no-brainer for everyone but me but ... I have > several php scripts residing on a web site on Server A. In a > library file on Server A are misc. functions, some of which > query an underlying database and return a text string as the > result. On another web site on Server B I would like to call > these functions to get the result without reinventing the > wheel so to speak. So my question is ... How can I call a > function that returns a text string from Server A in a script > requiring that text during the processing of a web page on > Server B ... all in php? Thanks in advance. > > Bill >

    attached mail follows:


    example: location.href="$destination";

    or

    location.href="<?php $destination; >";

    or

    echo "location.href='", $destino, "';";

    PLEASE GIVE A IDEA

    Ysrael Guzmán Meza

    attached mail follows:


    location.href="<?= $destination ?>"

    should work ... hth ... Bill

    -----Original Message----- From: Ysrael Guzmán [mailto:yguzmanlayconsa.com.pe] Sent: Wednesday, January 08, 2003 4:30 PM To: php-generallists.php.net Subject: [PHP] read javascript variable php?????

    example:

    location.href="$destination";

    or

    location.href="<?php $destination; >";

    or

    echo "location.href='", $destino, "';";

    PLEASE GIVE A IDEA

    Ysrael Guzmán Meza

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

    attached mail follows:


    Can anyone see a problem in this? When i run the script i am getting this error "Notice: Undefined variable: action in C:\www\Apache2\htdocs\user_poll\2\addpoll.php on line 13"

    <? // addpoll.php // Case Study 1: User Poll - Foundation PHP for Flash

    // If the form has been submitted... (line 13) if ($action == "add") { // Include config file include('common.php');

    // Connect to database $link = dbConnect();

    // Get date for new poll $posted = time();

    // Build query to insert new poll $query = "INSERT INTO polls (question, option1, option2, option3, posted) VALUES('$question', '$option1', '$option2', '$option3', $posted)";

    // Execute query $result = mysql_query($query);

    // If query failed... if (!$result) { // Display error print "<font color=\"#ff0000\">Could not insert poll</font><br>\n"; } else { print "<font color=\"#0000ff\">Poll added</font><br>\n"; }

    mysql_close($link); } ?> please anyone

    attached mail follows:


    Hello Paul,

    well problem is this: you don't have defined variable $action....maybe you are not posting it correctly from form...what is on first 12 lines?

    try to add $action="value"; on line 12...just define any suitable value...

    -- 
    Best regards,
     Martin                          mail   corwincorwin.sk
                                     mobile +421.907.303.393
                                     icq    34358414
                                     www    http://www.corwin.sk
    

    PGP key fingerprint 21365ca05ecfd8aeb1cf19c838fff033

    "In those days spirits were brave, the stakes were high, men were real men, women were real women and small furry creatures from Alpha Centauri were real small furry creatures from Alpha Centauri."

    by Douglas Adams

    Wednesday, January 8, 2003, 11:43:12 PM, you wrote:

    PF> Can anyone see a problem in this? When i run the script i am getting this PF> error "Notice: Undefined variable: action in PF> C:\www\Apache2\htdocs\user_poll\2\addpoll.php on line 13"

    PF> <? PF> // addpoll.php PF> // Case Study 1: User Poll - Foundation PHP for Flash

    PF> // If the form has been submitted... PF> (line 13) if ($action == "add") { PF> // Include config file PF> include('common.php');

    PF> // Connect to database PF> $link = dbConnect();

    PF> // Get date for new poll PF> $posted = time();

    PF> // Build query to insert new poll PF> $query = "INSERT INTO polls (question, option1, option2, option3, PF> posted) PF> VALUES('$question', '$option1', '$option2', '$option3', PF> $posted)";

    PF> // Execute query PF> $result = mysql_query($query);

    PF> // If query failed... PF> if (!$result) { PF> // Display error PF> print "<font color=\"#ff0000\">Could not insert poll</font><br>\n"; PF> } else { PF> print "<font color=\"#0000ff\">Poll added</font><br>\n"; PF> }

    PF> mysql_close($link); PF> } ?>> PF> please anyone

    attached mail follows:


    You need to check like this:

    if (isset($action) && $action == 'add')

    AND if it is 4.1 + and global vars are turned off??

    if (isset($_GET['action']) && $_GET['action'] == 'add')

    ** The above will need to changed if it is POST in the above example!!

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

    > -----Original Message----- > From: - [ Paul Ferrie ] - [mailto:infoinnovativedesigns.org.uk] > Sent: Thursday, 9 January 2003 8:43 AM > To: php-generallists.php.net > Subject: [PHP] strange problem (user poll) > > > Can anyone see a problem in this? When i run the script i am > getting this error "Notice: Undefined variable: action in > C:\www\Apache2\htdocs\user_poll\2\addpoll.php on line 13" > > <? > // addpoll.php > // Case Study 1: User Poll - Foundation PHP for Flash > > // If the form has been submitted... > (line 13) if ($action == "add") { > // Include config file > include('common.php'); > > // Connect to database > $link = dbConnect(); > > // Get date for new poll > $posted = time(); > > // Build query to insert new poll > $query = "INSERT INTO polls (question, option1, option2, option3, > posted) > VALUES('$question', '$option1', '$option2', > '$option3', $posted)"; > > // Execute query > $result = mysql_query($query); > > // If query failed... > if (!$result) { > // Display error > print "<font color=\"#ff0000\">Could not insert > poll</font><br>\n"; > } else { > print "<font color=\"#0000ff\">Poll added</font><br>\n"; > } > > mysql_close($link); > } > ?> > please anyone > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    Sorry guys ingore the post, i have narrowed the problem down to a problem with posting the vairables from flash. cheers

    "- -" <infoinnovativedesigns.org.uk> wrote in message news:20030108224305.26860.qmailpb1.pair.com... > Can anyone see a problem in this? When i run the script i am getting this > error "Notice: Undefined variable: action in > C:\www\Apache2\htdocs\user_poll\2\addpoll.php on line 13" > > <? > // addpoll.php > // Case Study 1: User Poll - Foundation PHP for Flash > > // If the form has been submitted... > (line 13) if ($action == "add") { > // Include config file > include('common.php'); > > // Connect to database > $link = dbConnect(); > > // Get date for new poll > $posted = time(); > > // Build query to insert new poll > $query = "INSERT INTO polls (question, option1, option2, option3, > posted) > VALUES('$question', '$option1', '$option2', '$option3', > $posted)"; > > // Execute query > $result = mysql_query($query); > > // If query failed... > if (!$result) { > // Display error > print "<font color=\"#ff0000\">Could not insert poll</font><br>\n"; > } else { > print "<font color=\"#0000ff\">Poll added</font><br>\n"; > } > > mysql_close($link); > } > ?> > please anyone > >

    attached mail follows:


    vanwayvanwaytrophy.com

    It would help to know where $action is being defined. ----- Original Message ----- From: "- [ Paul Ferrie ] -" <infoinnovativedesigns.org.uk> To: <php-generallists.php.net> Sent: Wednesday, January 08, 2003 3:43 PM Subject: [PHP] strange problem (user poll)

    > Can anyone see a problem in this? When i run the script i am getting this > error "Notice: Undefined variable: action in > C:\www\Apache2\htdocs\user_poll\2\addpoll.php on line 13" > > <? > // addpoll.php > // Case Study 1: User Poll - Foundation PHP for Flash > > // If the form has been submitted... > (line 13) if ($action == "add") { > // Include config file > include('common.php'); > > // Connect to database > $link = dbConnect(); > > // Get date for new poll > $posted = time(); > > // Build query to insert new poll > $query = "INSERT INTO polls (question, option1, option2, option3, > posted) > VALUES('$question', '$option1', '$option2', '$option3', > $posted)"; > > // Execute query > $result = mysql_query($query); > > // If query failed... > if (!$result) { > // Display error > print "<font color=\"#ff0000\">Could not insert poll</font><br>\n"; > } else { > print "<font color=\"#0000ff\">Poll added</font><br>\n"; > } > > mysql_close($link); > } > ?> > please anyone > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >