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: Fri Jan 31 2003 - 05:51:40 CST

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

    php-general Digest 31 Jan 2003 11:51:40 -0000 Issue 1855

    Topics (messages 133706 through 133756):

    php question - query string
            133706 by: Anthony Ritter
            133708 by: Philip Hallstrom
            133709 by: Lowell Allen

    php as shell script
            133707 by: David H
            133710 by: Khalid El-Kary

    PHP Compile Error
            133711 by: Robert Fitzpatrick
            133716 by: Johannes Schlueter

    Re: Context
            133712 by: Justin French

    Re: mysq_connect()
            133713 by: Khalid El-Kary
            133721 by: Philip Olson

    Re: XML PHP question
            133714 by: Chris McCluskey

    POST without a form
            133715 by: arthur.chereau

    iCal parser and importing iCal to database
            133717 by: Reuben D. Budiardja
            133719 by: Dan Harrington
            133724 by: Richard Baskett

    Re: [PHP-WIN] Register globals on and off
            133718 by: Davy Obdam
            133726 by: Tom Rogers
            133740 by: Jason Wong
            133741 by: Jason Wong

    Re: Adding HTTP URL Code
            133720 by: Tom Rogers

    Re: Encryption using MMCrypt - whats the point?
            133722 by: Jason Sheets

    Re: PHP - mysql_info question
            133723 by: John W. Holmes

    Change MySQL from Socket to TCP
            133725 by: Stephen
            133735 by: Chris Shiflett

    Re:[PHP] POST without a form
            133727 by: Daniel Leighton

    Introduction
            133728 by: Julie Williams

    Money format
            133729 by: Ben Edwards
            133731 by: V Dub
            133734 by: Ben Edwards

    Trying to understand an error
            133730 by: Lynn
            133738 by: Jason Wong

    Re: Money format--concatenate?
            133732 by: Leonard Burton

    Sending plain text data in a table with mail()
            133733 by: Leonard Burton

    Using CVS through PHP
            133736 by: Weston Houghton

    How to check for refresh in PHP
            133737 by: Pag
            133739 by: Justin French
            133756 by: adrian murphy.2020tourism.com

    .php extensions versus .html
            133742 by: Guru Geek
            133746 by: Justin French

    need some guidance
            133743 by: Seth Hopkins
            133744 by: Timothy Hitchens \(HiTCHO\)
            133747 by: Justin French

    LOGOUT - Reset Session
            133745 by: Keith Spiller
            133750 by: Jason Wong

    rename failes if file name contains single quotes
            133748 by: $B%X!<%s(B $B%H!<%^%9(B
            133749 by: Jason Wong
            133751 by: Ernest E Vogelsinger

    Re: PHP & Apache
            133752 by: Aaron Stephan William Boeren
            133753 by: Justin French

    query on indexserver via php ado
            133754 by: Florian Grabke

    reading attachmentsl
            133755 by: Bartosz Matosiuk

    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:


    The following script is from Kevin Yank's book on page 59-60. (Sitepoint)

    I'd like to get some clarification about the line: (almost next to last line
    in the script)

    ...................
    echo("<p><a href='$PHP_SELF?addjoke=1'>Add a Joke!</a></p>");
    ................

    He has a link called "Add a Joke!".

    When the user clicks on the link, the same page loads - with the form this
    time - and the query string passes the value -1 - to the variable $addjoke.

    Am I on the right track?

    If so, why does 1 - as opposed to 2 or something else - have to be the
    name/value pair if the user is adding another joke?

    Thank you.
    TR
    ......................................

    <html>
    <head>
    <title> The Internet Joke Database </title>
    </head>
    <body>
    <?php
      if (isset($addjoke)): // If the user wants to add a joke
    ?>

    <form action="<?=$PHP_SELF?>" method="post">
    <p>Type your joke here:<br />
    <textarea name="joketext" rows="10" cols="40" wrap></textarea><br />
    <input type="submit" name="submitjoke" value="SUBMIT" /></p>
    </form>

    <?php
      else: // Default page display

        // Connect to the database server
        $dbcnx = mysql_connect("localhost", "root", "mypasswd");
        if (!$dbcnx) {
          echo( "<p>Unable to connect to the " .
                "database server at this time.</p>" );
          exit();
        }

        // Select the jokes database
        if (! mysql_select_db("jokes") ) {
          echo( "<p>Unable to locate the joke " .
                "database at this time.</p>" );
          exit();
        }

        // If a joke has been submitted,
        // add it to the database.
        if ($submitjoke == "SUBMIT") {
          $sql = "INSERT INTO Jokes SET
                  JokeText='$joketext',
                  JokeDate=CURDATE()";
          if (mysql_query($sql)) {
            echo("<p>Your joke has been added.</p>");
          } else {
            echo("<p>Error adding submitted joke: " .
                 mysql_error() . "</p>");
          }
        }

        echo("<p> Here are all the jokes in our database: </p>");

        // Request the text of all the jokes
        $result = mysql_query("SELECT JokeText FROM Jokes");
        if (!$result) {
          echo("<p>Error performing query: " . mysql_error() . "</p>");
          exit();
        }

        // Display the text of each joke in a paragraph
        while ( $row = mysql_fetch_array($result) ) {
          echo("<p>" . $row["JokeText"] . "</p>");
        }

        // When clicked, this link will load this page
        // with the joke submission form displayed.
        echo("<p><a href='$PHP_SELF?addjoke=1'>Add a Joke!</a></p>");

      endif;

    ?>
    </body>
    </html>

    --
    

    attached mail follows:


    You've got it right... look at the man page for parse_str() for more info on the QUERY_STRING stuff as well as the register_globals configuration option.

    Looking at the script below, there is nothing special about setting $addjoke to 1. It's just important that it is set to *something* (because of the isset($addjoke) call. You could set it to whatever you want, but setting it to 1 is commonly done to indicate "trueness" or "it's on".

    You could set it to "yes" if you wanted and the script would work the same.

    Hope this helps.

    -philip

    On Thu, 30 Jan 2003, Anthony Ritter wrote:

    > The following script is from Kevin Yank's book on page 59-60. (Sitepoint) > > I'd like to get some clarification about the line: (almost next to last line > in the script) > > ................... > echo("<p><a href='$PHP_SELF?addjoke=1'>Add a Joke!</a></p>"); > ................ > > > He has a link called "Add a Joke!". > > When the user clicks on the link, the same page loads - with the form this > time - and the query string passes the value -1 - to the variable $addjoke. > > Am I on the right track? > > If so, why does 1 - as opposed to 2 or something else - have to be the > name/value pair if the user is adding another joke? > > Thank you. > TR > ...................................... > > <html> > <head> > <title> The Internet Joke Database </title> > </head> > <body> > <?php > if (isset($addjoke)): // If the user wants to add a joke > ?> > > <form action="<?=$PHP_SELF?>" method="post"> > <p>Type your joke here:<br /> > <textarea name="joketext" rows="10" cols="40" wrap></textarea><br /> > <input type="submit" name="submitjoke" value="SUBMIT" /></p> > </form> > > <?php > else: // Default page display > > // Connect to the database server > $dbcnx = mysql_connect("localhost", "root", "mypasswd"); > if (!$dbcnx) { > echo( "<p>Unable to connect to the " . > "database server at this time.</p>" ); > exit(); > } > > // Select the jokes database > if (! mysql_select_db("jokes") ) { > echo( "<p>Unable to locate the joke " . > "database at this time.</p>" ); > exit(); > } > > // If a joke has been submitted, > // add it to the database. > if ($submitjoke == "SUBMIT") { > $sql = "INSERT INTO Jokes SET > JokeText='$joketext', > JokeDate=CURDATE()"; > if (mysql_query($sql)) { > echo("<p>Your joke has been added.</p>"); > } else { > echo("<p>Error adding submitted joke: " . > mysql_error() . "</p>"); > } > } > > echo("<p> Here are all the jokes in our database: </p>"); > > // Request the text of all the jokes > $result = mysql_query("SELECT JokeText FROM Jokes"); > if (!$result) { > echo("<p>Error performing query: " . mysql_error() . "</p>"); > exit(); > } > > // Display the text of each joke in a paragraph > while ( $row = mysql_fetch_array($result) ) { > echo("<p>" . $row["JokeText"] . "</p>"); > } > > // When clicked, this link will load this page > // with the joke submission form displayed. > echo("<p><a href='$PHP_SELF?addjoke=1'>Add a Joke!</a></p>"); > > endif; > > ?> > </body> > </html> > > -- > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    Although you don't show it in your snippet of code, the script in question starts with:

    if (isset($addjoke)): // If the user wants to add a joke

    So all he's doing is setting the variable $addjoke. It could have been set to 2 or something else, although 1 kind of makes more sense because it's associated with "true" (as 0 is associated with "false").

    --
    Lowell Allen
    

    > From: "Anthony Ritter" <tonygonefishingguideservice.com> > Date: Thu, 30 Jan 2003 18:30:28 -0500 > To: php-generallists.php.net > Subject: [PHP] php question - query string > > The following script is from Kevin Yank's book on page 59-60. (Sitepoint) > > I'd like to get some clarification about the line: (almost next to last line > in the script) > > .................... > echo("<p><a href='$PHP_SELF?addjoke=1'>Add a Joke!</a></p>"); > ................. > > > He has a link called "Add a Joke!". > > When the user clicks on the link, the same page loads - with the form this > time - and the query string passes the value -1 - to the variable $addjoke. > > Am I on the right track? > > If so, why does 1 - as opposed to 2 or something else - have to be the > name/value pair if the user is adding another joke? > > Thank you. > TR > ....................................... > > <html> > <head> > <title> The Internet Joke Database </title> > </head> > <body> > <?php > if (isset($addjoke)): // If the user wants to add a joke > ?> > > <form action="<?=$PHP_SELF?>" method="post"> > <p>Type your joke here:<br /> > <textarea name="joketext" rows="10" cols="40" wrap></textarea><br /> > <input type="submit" name="submitjoke" value="SUBMIT" /></p> > </form> > > <?php > else: // Default page display > > // Connect to the database server > $dbcnx = mysql_connect("localhost", "root", "mypasswd"); > if (!$dbcnx) { > echo( "<p>Unable to connect to the " . > "database server at this time.</p>" ); > exit(); > } > > // Select the jokes database > if (! mysql_select_db("jokes") ) { > echo( "<p>Unable to locate the joke " . > "database at this time.</p>" ); > exit(); > } > > // If a joke has been submitted, > // add it to the database. > if ($submitjoke == "SUBMIT") { > $sql = "INSERT INTO Jokes SET > JokeText='$joketext', > JokeDate=CURDATE()"; > if (mysql_query($sql)) { > echo("<p>Your joke has been added.</p>"); > } else { > echo("<p>Error adding submitted joke: " . > mysql_error() . "</p>"); > } > } > > echo("<p> Here are all the jokes in our database: </p>"); > > // Request the text of all the jokes > $result = mysql_query("SELECT JokeText FROM Jokes"); > if (!$result) { > echo("<p>Error performing query: " . mysql_error() . "</p>"); > exit(); > } > > // Display the text of each joke in a paragraph > while ( $row = mysql_fetch_array($result) ) { > echo("<p>" . $row["JokeText"] . "</p>"); > } > > // When clicked, this link will load this page > // with the joke submission form displayed. > echo("<p><a href='$PHP_SELF?addjoke=1'>Add a Joke!</a></p>"); > > endif; > > ?> > </body> > </html> > > -- > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    Hi,

    I am trying to run php as shell script. I have this:

    helloworld.php:

    <? echo "Hello World."; ?>

    I run

    php helloworld.php

    then I got this:

    Hello World. Fatal error: Nesting level too deep - recursive dependency? in Unknown on line 0

    I am using Redhat 8, anyone knows what is the problem is?

    Thanks, David

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

    attached mail follows:


    maybe, but not sure, you need to replace "<?" with "<?php", just try it! maybe it works

    >Hi, > >I am trying to run php as shell script. I have this: > >helloworld.php: > ><? >echo "Hello World."; >?> > >I run > >php helloworld.php > >then I got this: > >Hello World. >Fatal error: Nesting level too deep - recursive >dependency? in Unknown on line 0 > >I am using Redhat 8, anyone knows what is the problem >is? > >Thanks, >David > >__________________________________________________ >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

    _________________________________________________________________ Tired of spam? Get advanced junk mail protection with MSN 8. http://join.msn.com/?page=features/junkmail

    attached mail follows:


    Running Redhat 8.0 PHP 4.3.0

    When I try to configure with the following: ./configure --with-apxs=/web_root/bin/apxs --enable-track-vars --enable-versioning --with-mysql=/usr/mysql --with-gd=/usr/local --with-jpeg-dir=/usr/local/bin/ --with-png-dir=/usr/lib --with-zlib-dir=/usr/lib --with-zlib --enable-xslt --enable-cli --disable-debug --with-xslt-sablot

    I get the following error: ... configure: error: libjpeg.(a|so) not found.

    Any ideas?

    attached mail follows:


    Hi,

    On Friday 31 January 2003 01:10, Robert Fitzpatrick wrote: > Running Redhat 8.0 > PHP 4.3.0 > > When I try to configure with the following: > ./configure --with-apxs=/web_root/bin/apxs --enable-track-vars > --enable-versioning --with-mysql=/usr/mysql --with-gd=/usr/local

    Are you sure you told the correct path: > --with-jpeg-dir=/usr/local/bin/ Try just /usr/local

    > --with-png-dir=/usr/lib > --with-zlib-dir=/usr/lib --with-zlib --enable-xslt --enable-cli > --disable-debug --with-xslt-sablot

    johannes

    attached mail follows:


    AFAIK, PHP "skips" over anything out side the <? and ?>... so yes, technically, it would be a little faster.

    End of the day, such a small gain could probably be made up elsewhere by optimising a function you use on every page, or something else like that.

    It's been said on the list many times before: Just do whicher you're more comfortable with, and whichever makes it easier for you to read/write/modify the code.

    I tend to run major blocks of straight HTML outside of php, and little bits inside PHP using echo.

    Justin

    on 30/01/03 7:01 PM, Boaz Yahav (berbernetvision.net.il) wrote:

    > HI > > I was reading this article : http://www.devarticles.com/art/1/397/2 > And am a bit confused now. > > If I understand correctly, the author claims that : > > <?php $php_tags = "PHP Tags" ?> > Combining HTML output and > <?php echo $php_tags; ?> > tags really wastes my time. > > Runs "slightly" faster than > > <?php > $php_tags = "PHP Tags"; > echo "Never breaking out of $php_tags is much less irritating."; > ?> > > > IS this true? > Is echo more consuming than entering and exiting in and out of context? > > berber > > > > -- > 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:


    is PHP configured with --with-mysql ?

    >Hi there, my name is Cesar Rodriguez and I am trying to upgrade from >Caldera >Linux Server 2.3 into RedHat Server 8.0. The problem I encounter is that >after testing different scripts, php is working, except when I make an >MySQL >call like mysql_connect() or mysql_pconnect(). >The call is as follows: > >$link = mysql_connect('localhost', 'user1', 'passwd') > or exit(); > >mysql_select_db ('mydb') > or exit (); > >$result = mysql_query ('SELECT COUNT(*) FROM clients') > or exit (); > >if ($row = mysql_fetch_array ($result)) >..... etc ...... > >The message I get is: > >"Fatal error: Call to undefined function: mysql_pconnect() in >var/www/html/lesson/firsta.php" > >Seems that PHP4 does not find the MySQL library. I checked php.ini and >httpd.conf files and everything is in its place apparently. I re-installed >everything from scratch with no positive result. I would appreciate advice >on this issue. > >Thanks >Cesar Rodriguez > > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php

    _________________________________________________________________ Help STOP SPAM with the new MSN 8 and get 2 months FREE* http://join.msn.com/?page=features/junkmail

    attached mail follows:


    On Thu, 30 Jan 2003, Cesar Rodriguez wrote:

    > Hi there, my name is Cesar Rodriguez and I am trying to upgrade from Caldera > Linux Server 2.3 into RedHat Server 8.0. The problem I encounter is that > after testing different scripts, php is working, except when I make an MySQL > call like mysql_connect() or mysql_pconnect(). > The call is as follows: > > $link = mysql_connect('localhost', 'user1', 'passwd') > or exit(); > > mysql_select_db ('mydb') > or exit (); > > $result = mysql_query ('SELECT COUNT(*) FROM clients') > or exit (); > > if ($row = mysql_fetch_array ($result)) > ..... etc ...... > > The message I get is: > > "Fatal error: Call to undefined function: mysql_pconnect() in > var/www/html/lesson/firsta.php" > > Seems that PHP4 does not find the MySQL library. I checked php.ini and > httpd.conf files and everything is in its place apparently. I re-installed > everything from scratch with no positive result. I would appreciate advice > on this issue.

    Install the php-mysql rpm, restart apache, and they will now exist. (assuming you already installed the mysql rpm) In short, there are three rpms: php, mysql, and php-mysql.

    http://www.rpmfind.net/

    Regards, Philip

    attached mail follows:


    There are lots of applications for XML in general. the most common one is the interchange of data between servers. here are some other links to wet your appetite: http://www.devshed.com/Server_Side/PHP/AmazonAPI/AmazonAPI1/page1.html http://www.devshed.com/Server_Side/PHP/GoogleAPI/page1.html hope that helps.

    -----Original Message----- From: Hardik Doshi [mailto:php_hardikyahoo.com] Sent: Thursday, January 30, 2003 10:33 AM To: Chris McCluskey Cc: php-generallists.php.net Subject: RE: [PHP] XML PHP question

    Hi Chris,

    Thanks for your nice reply. I would like to know what are the applications of XML with PHP. I know how to write and parse XML files but i dont know where can i use this power? Either you or any other member of this group can solve my problem then i would be thankful to him/her.

    Again thanks for your positive response.

    Hardik Doshi Web Application Developer Institute of Design, Chicago IL

    Chris McCluskey <chrismodulusgroup.com> wrote:

    Hardik, I have created my own XML parser based on the existing php xml functions http://php.net/xml . I've found this is nice but a bit annoying since I have to write everything from scratch. After about a week or two trying to get my parser just right I gave up and used MSXML 4.0 which is a Microsoft COM Object and contains everything you need to created XML Documents, parse them, validate them agaisnt DTD and XSD Schemas, etc... I use php's COM Support http://php.net/com to do this and created a wrapper object around the COM object with php for easy implementation.. Hope that helps. -Chris -----Original Message----- From: Hardik Doshi [mailto:php_hardikyahoo.com] Sent: Thursday, January 30, 2003 7:17 AM To: php-generallists.php.net Cc: doshhariit.edu Subject: [PHP] XML PHP question Hi everyone, Can you please tell me what is the best way of working with XML technology using PHP? I am not clear about integration of these two technologies. Suggest some books or links or good tutorials. thanks Hardik Doshi Web Application Developer Chicago --------------------------------- Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

    _____

    Do you Yahoo!? Yahoo! Mail Plus <http://rd.yahoo.com/mail/mailsig/*http://mailplus.yahoo.com> - Powerful. Affordable. Sign up now <http://rd.yahoo.com/mail/mailsig/*http://mailplus.yahoo.com>

    attached mail follows:


    Hi, A PHP page (main.php) loads another page (doit.php) via a form. doit.php gets the data via $_POST. Now, from a third page (other.php), I need to load doit.php with other data, but automatically, without a form. How can I redirect to doit.php and send POST data at the same time ? (as if a form was filled) I tried the fsockopen method, described at e.g. http://www.faqts.com/knowledge_base/view.phtml/aid/12039/fid/51, but it doesn't redirect to a page, it just gets its output. It need something like header("Location: doit.php") with POST data. doit.php can't be modified. I can't use javascript. What is the canonical way to do this in PHP ? ------------------------------------------ Faites un voeu et puis Voila ! www.voila.fr

    attached mail follows:


    Hi, I think this has been asked here before and I've looked around the archive but didn't find anything. So I ask again.

    Does anyone know if there's a utility/script/program in php that will allow one to parse and/or import iCAL calendar format to database, such as mySQL or PostGreSQL?

    Thanks for any info. RDB

    attached mail follows:


    No kidding. And the very thought that apple in its "intrusion" into the world of UNIX hasn't made a group open-SQL-database-driven web-accessible iCal is kind of unreal. At least make it filemaker pro driven. :-)

    > -----Original Message----- > From: Reuben D. Budiardja [mailto:reubendbinnovativethought.com] > Sent: Thursday, January 30, 2003 5:40 PM > To: php-generallists.php.net > Subject: [PHP] iCal parser and importing iCal to database > > > > Hi, > I think this has been asked here before and I've looked around the archive but > didn't find anything. So I ask again. > > Does anyone know if there's a utility/script/program in php that will allow > one to parse and/or import iCAL calendar format to database, such as mySQL or > PostGreSQL? > > Thanks for any info. > RDB > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >

    attached mail follows:


    Doesn't iCal use the vCalendar vCal format? Kind of like vCards, but to deal with Calendar information.. it should be easy to write something that will parse that..

    Cheers!

    Rick

    "The greatest trick the devil ever played was convincing the world he didn't exist." - Unknown

    > From: "Reuben D. Budiardja" <reubendbinnovativethought.com> > Date: Thu, 30 Jan 2003 19:40:15 -0500 > To: php-generallists.php.net > Subject: [PHP] iCal parser and importing iCal to database > > > Hi, > I think this has been asked here before and I've looked around the archive but > didn't find anything. So I ask again. > > Does anyone know if there's a utility/script/program in php that will allow > one to parse and/or import iCAL calendar format to database, such as mySQL or > PostGreSQL? > > Thanks for any info. > RDB > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > >

    attached mail follows:


    Thanks for your reactions guys, I stil havent been able to get it to work... I have added a .htaccess file into my directory that needs the register globals on, containing

    php_value register_globals on

    And i have chanched AllowOverride None to all in the httpd.conf file, and restarted my webserver... But its stil not working. I am i doing something wrong? Thanks for your time...

    Best regards,

    Davy Obdam mailto:infodavyobdam.com

    Davy Obdam wrote:

    > Hello people, > > On my development machine (win XP/Apache 2.0.44/PHP 4.3.0/MySQL > 3.23.55) i have several websites that i made some time ago that > require register globals to be On in the php.ini. Ofcourse i know > thats not a good idea at all for security, but rewriting all this code > is not an option. However in my php.ini i have set register globals to > Off because that better. Is it possible to configure my webserver/php > so that only those sites that require register globals to be On have > that setting, for instance in a .htacces file?? Any help is > appreciated:-) > > Best regards, > > Davy Obdam > mailto:infodavyobdam.com > > >

    -- 
    --------------------------------------------------------------------
    Davy Obdam - Obdam webdesign©
    mailto:infodavyobdam.com   web: www.davyobdam.com
    --------------------------------------------------------------------
    

    attached mail follows:


    Hi,

    Friday, January 31, 2003, 10:42:42 AM, you wrote: DO> Thanks for your reactions guys, I stil havent been able to get it to DO> work... I have added a .htaccess file into my directory that needs the DO> register globals on, containing

    DO> php_value register_globals on

    DO> And i have chanched AllowOverride None to all in the httpd.conf file, and restarted my webserver... But its stil not working. I am i doing something wrong? Thanks for your time...

    DO> Best regards,

    DO> Davy Obdam DO> mailto:infodavyobdam.com

    It should be: php_flag register_globals on

    -- 
    regards,
    Tom
    

    attached mail follows:


    On Friday 31 January 2003 09:26, Tom Rogers wrote:

    > DO> Thanks for your reactions guys, I stil havent been able to get it to > DO> work... I have added a .htaccess file into my directory that needs the > DO> register globals on, containing > > DO> php_value register_globals on > > DO> And i have chanched AllowOverride None to all in the httpd.conf file, > and restarted my webserver... But its stil not working. I am i doing > something wrong? Thanks for your time...

    > It should be: > php_flag register_globals on

    php_value register_globals 0

    works for me.

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

    /* A national debt, if it is not excessive, will be to us a national blessing. -- Alexander Hamilton */

    attached mail follows:


    On Friday 31 January 2003 14:36, Jason Wong wrote:

    > php_value register_globals 0 > > works for me.

    Perhaps it wasn't too clear. Use 0/1 rather than off/on.

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

    /* Genius is the talent of a person who is dead. */

    attached mail follows:


    Hi,

    Friday, January 31, 2003, 3:43:52 AM, you wrote: EKAHFe> Hi all!

    EKAHFe> Unfortunately, I didn't receive any replies to the problem I sent out EKAHFe> on January 16th so I thought I'd send another email and perhaps EKAHFe> clarify what I am seeing so that maybe someone CAN help and ask EKAHFe> if folks on the list have just not seen this issue before.

    EKAHFe> The program I am working on allows the customer to view test results EKAHFe> based on a keyword. If the results contain a URL (these URLs are EKAHFe> entered into the MySQL database as straight text), I make it live EKAHFe> using the code snippet below. Unfortunately, I have not been successful EKAHFe> doing this no matter what I try. Currently, after I have run the code EKAHFe> below, what I see is a link containing the correct text but, when you put EKAHFe> the cursor over the link, the actual URL is that of the "base" browser EKAHFe> page. For example, I am working on a file located at:

    EKAHFe> http://fake.url.com/testing/Test_Results/search_keyword.php

    EKAHFe> (which is called from form Search_Keyword.php).

    EKAHFe> If the test results that fit the keyword search contains, say, URL EKAHFe> http://www.cleanrun.com (again, entered into the database as EKAHFe> plain text), this is what will show up in the search output. HOWEVER, EKAHFe> when the cursor is placed over the URL (or the URL is clicked), the EKAHFe> URL that appears at the bottom of the browser corresponding to EKAHFe> the cursor'd URL is http://fake.url.com/testing/Test_Results.

    EKAHFe> Is there something in my PHP config file I might be missing? Is there EKAHFe> something in my code I'm not doing correctly? Has anyone else ever EKAHFe> seen this problem?

    EKAHFe> HELP!!! I'm at my wits end with this one. I'm afraid I'm not going to EKAHFe> be able to make these links live which will make the tool much less EKAHFe> usable. Please let me know if you need more information from me in EKAHFe> order to help!

    EKAHFe> Thanks so much,

    EKAHFe> Katherine

    EKAHFe> -----Original Message----- EKAHFe> From: ELLIOTT,KATHERINE A (HP-FtCollins,ex1) EKAHFe> [mailto:katherine.elliotthp.com] EKAHFe> Sent: Thursday, January 16, 2003 10:54 AM EKAHFe> To: 'php-generallists.php.net' EKAHFe> Subject: RE: [PHP] Adding HTTP URL Code

    EKAHFe> Thanks for all your help with my URL code problem!

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

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

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

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

    EKAHFe> What the hec??? Can someone help?

    EKAHFe> Many thanks!!

    EKAHFe> Katherine Elliott

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

    EKAHFe> On Thursday 09 January 2003 04:07, ELLIOTT,KATHERINE A (HP-FtCollins,ex1) EKAHFe> 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.

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

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

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

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

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

    I think your regex needs to look like this (from the manual): $data_str = eregi_replace ("\[([[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/])\]", "<a href=\"\\1\">\\1</a>", $data_str);

    The reason you were getting the wrong link was the href= was wrong so the browser just used the page address as the href.

    -- 
    regards,
    Tom
    

    attached mail follows:


    Using a PHP encoder or compiling a binary does not make it more secure than storing the IV and encryption key in plain text in a PHP script. The problem is the fact that the encryption cipher requires the same key for encryption and decryption, this is not a problem in many encryption cases but in cases where you want to be able to encrypt but not decrypt the information on the server public key encryption is the better solution, which unfortunately mcrypt does not support.

    Using a compiled/encoded program is just security through obscurity which is an illusion and definitely not something you want to do with credit card numbers.

    Jason On Thu, 2003-01-30 at 08:03, Adam Voigt wrote: > Granted, the $350 stand-alone encoder is a bit expensive. I'm talking > about the online > encoder though, you pass your PHP script through the online-control > center and it > output's the encrypted version, a typical PHP program is $5.00 (yes > that's five dollar's), > try selecting your code after you register for a free account, it will > tell you how much it > would cost to encode it. And after it is encoded, the decoder's (the > things you put on > the server to run the encrypted program's) are 100% free. > > > On Thu, 2003-01-30 at 10:03, Mike Morton wrote: > > Adam/Lowell: > > Thanks for the suggestions – but like all clients – they want > maximum function for minimum $$ - encoders are therefore not a > possibility (but I will keep that in mind for future apps :)) > > Thanks. > > On 1/30/03 9:55 AM, "Adam Voigt" <adamcryptocomm.com> wrote: > > > > http://www.ioncube.com/ > > Encrypt PHP scripts (there pretty cheap to). > > On Thu, 2003-01-30 at 09:30, Mike Morton wrote: > I want to use the mcrypt functions to encrypt credit card > numbers for > storage in a mysql database, which mycrypt does admirably: > > $key = "this is a secret key"; > $input = "Let us meet at 9 o'clock at the secret place."; > $iv = mcrypt_create_iv (mcrypt_get_iv_size (MCRYPT_RIJNDAEL_256, > MCRYPT_MODE_CBC), MCRYPT_RAND); > > $encrypted_data = base64_encode(mcrypt_encrypt > (MCRYPT_RIJNDAEL_256 , $key, > $input, MCRYPT_MODE_CBC,$iv)); > > The trouble is - the key and the IV. Both of these have to be > available in > the merchants administration for retrieval of the credit card, > thus need to > be stored somewhere - most likely on the server or in a > database. Here is > the problem - if someone gets to the database and retrieves the > encrypted > credit card, the chances are that they are able to also retrieve > the script > that did the encryption, thus find out where the key and IV are > stored, > making it simple to decrypt the credit card for them. > > The only solution that I can see is to use an asymetric > encryption and have > the merchant enter the decryption key at the time of credit card > retrieval - > but that is unrealistic for a User Interface point of view. > > So - the only other thing that I can see to do is have a > compiled program, > bound to the server, that has the key compiled into the program. > I am not a > C programmer - so this is also not exactly possible. > > Does anyone else have any answers or has anyone else run into > this? Is this > just a general problem with doing encryption through PHP as > opposed to a > compiled binary? Can anyone suggest a solution to this problem? > > Thanks :) > > > > > > > -- > 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 > > > -- > Adam Voigt (adamcryptocomm.com) > The Cryptocomm Group > My GPG Key: http://64.238.252.49:8080/adam_at_cryptocomm.asc

    attached mail follows:


    > I have written a PHP function that uses the MySQL command: > LOAD DATA INFILE ... > > The command returns the result in mysql_info() > Records: 42 Deleted: 0 Skipped: 0 Warnings: 5 > > My question is how do you find out what the 5 warnings are. > Does MySQL put them in a log file somewhere and is there a way to display > them to my user through PHP.

    Nope...

    ---John W. Holmes...

    PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/

    attached mail follows:


    I'm having a bit of trouble. A friend of mine just bought a server and install a bunch of stuff on it. MySQL was setup as a socket connection instead of TCP. How can I change that for his installed scripts to work?

    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:


    --- Stephen <webmastermelchior.us> wrote: > MySQL was setup as a socket connection instead of TCP. > How can I change that for his installed scripts to work?

    What in the world are you talking about? Might I suggest:

    1. Don't try to assume you know what the problem is unless you do. Just explain what is wrong. It is just confusing otherwise. 2. Ask MySQL questions on MySQL mailing lists.

    Chris

    attached mail follows:


    I think what you want to use is CURL. I don't know if that's the canonical way to do it, but it is certainly a way. You can get more info here: http://www.php.net/manual/en/ref.curl.php

    At 1:28 AM +0100 on 1/31/03, arthur.chereau wrote:

    >Hi, > >A PHP page (main.php) loads another page (doit.php) via a form. doit.php gets the data >via $_POST. > >Now, from a third page (other.php), I need to load doit.php with other data, but >automatically, without a form. > >How can I redirect to doit.php and send POST data at the same time ? (as if a form was >filled) > >I tried the fsockopen method, described at e.g. >http://www.faqts.com/knowledge_base/view.phtml/aid/12039/fid/51, but it doesn't >redirect to a page, it just gets its output. It need something like header("Location: >doit.php") with POST data. > >doit.php can't be modified. I can't use javascript. > >What is the canonical way to do this in PHP ? > >------------------------------------------ > >Faites un voeu et puis Voila ! www.voila.fr > > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php

    -- 
    

    Daniel Leighton Chief Technology Officer Webolution http://www.webolution.com

    This email may contain material that is confidential and privileged for the sole use of the intended recipient. Any review, reliance or distribution by others or forwarding without express permission is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.

    attached mail follows:


    Hello everyone,

    I just subscribed to the list and wanted to say hello. Also to check if I have the right address.

    :-)

    Julie Williams

    attached mail follows:


    I wish to format money with a £ sign, two decimal places and commas separating thousands. I seem to be able to do the £ and decimal places with sprintf or use money_format to do the commas but cant find how to do both/combine them.

    any insight, ben

    **************************************************************** * Ben Edwards +44 (0)117 968 2602 * * Critical Site Builder http://www.criticaldistribution.com * * online collaborative web authoring content management system * * Get alt news/views films online http://www.cultureshop.org * * i-Contact Progressive Video http://www.videonetwork.org * * Smashing the Corporate image http://www.subvertise.org * * Bristol Indymedia http://bristol.indymedia.org * * Bristol's radical news http://www.bristle.org.uk * * PGP : F0CA 42B8 D56F 28AD 169B 49F3 3056 C6DB 8538 EEF8 * ****************************************************************

    ---
    Outgoing mail is certified Virus Free.
    Checked by AVG anti-virus system (http://www.grisoft.com).
    Version: 6.0.449 / Virus Database: 251 - Release Date: 27/01/2003
    

    attached mail follows:


    http://php.net

    search in functions for number_format

    Cheers!

    Quoting Ben Edwards <benvideonetwork.org>:

    ### I wish to format money with a £ sign, two decimal places and commas ### separating thousands. I seem to be able to do the £ and decimal places with ### ### sprintf or use money_format to do the commas but cant find how to do ### both/combine them. ### ### any insight, ### ben ### ### **************************************************************** ### * Ben Edwards +44 (0)117 968 2602 * ### * Critical Site Builder http://www.criticaldistribution.com * ### * online collaborative web authoring content management system * ### * Get alt news/views films online http://www.cultureshop.org * ### * i-Contact Progressive Video http://www.videonetwork.org * ### * Smashing the Corporate image http://www.subvertise.org * ### * Bristol Indymedia http://bristol.indymedia.org * ### * Bristol's radical news http://www.bristle.org.uk * ### * PGP : F0CA 42B8 D56F 28AD 169B 49F3 3056 C6DB 8538 EEF8 * ### **************************************************************** ###

    -- 
    Richard Whitney
    Transcend Development
    Producing the next phase of your internet presence.
    rwxend.net
    http://xend.net
    602-971-2791
    

    attached mail follows:


    As I said it is almost what I want but not quite. If it can be done a code snipit would be good.

    Ben

    At 19:44 30/01/2003 -0700, V Dub wrote:

    >http://php.net > >search in functions for number_format > >Cheers! > >Quoting Ben Edwards <benvideonetwork.org>: > >### I wish to format money with a £ sign, two decimal places and commas >### separating thousands. I seem to be able to do the £ and decimal places >with >### >### sprintf or use money_format to do the commas but cant find how to do >### both/combine them. >### >### any insight, >### ben >### >### **************************************************************** >### * Ben Edwards +44 (0)117 968 2602 * >### * Critical Site Builder http://www.criticaldistribution.com * >### * online collaborative web authoring content management system * >### * Get alt news/views films online http://www.cultureshop.org * >### * i-Contact Progressive Video http://www.videonetwork.org * >### * Smashing the Corporate image http://www.subvertise.org * >### * Bristol Indymedia http://bristol.indymedia.org * >### * Bristol's radical news http://www.bristle.org.uk * >### * PGP : F0CA 42B8 D56F 28AD 169B 49F3 3056 C6DB 8538 EEF8 * >### **************************************************************** >### > > >-- >Richard Whitney >Transcend Development >Producing the next phase of your internet presence. >rwxend.net >http://xend.net >602-971-2791 > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php > > > >--- >Incoming mail is certified Virus Free. >Checked by AVG anti-virus system (http://www.grisoft.com). >Version: 6.0.449 / Virus Database: 251 - Release Date: 27/01/2003

    **************************************************************** * Ben Edwards +44 (0)117 968 2602 * * Critical Site Builder http://www.criticaldistribution.com * * online collaborative web authoring content management system * * Get alt news/views films online http://www.cultureshop.org * * i-Contact Progressive Video http://www.videonetwork.org * * Smashing the Corporate image http://www.subvertise.org * * Bristol Indymedia http://bristol.indymedia.org * * Bristol's radical news http://www.bristle.org.uk * * PGP : F0CA 42B8 D56F 28AD 169B 49F3 3056 C6DB 8538 EEF8 * ****************************************************************

    ---
    Outgoing mail is certified Virus Free.
    Checked by AVG anti-virus system (http://www.grisoft.com).
    Version: 6.0.449 / Virus Database: 251 - Release Date: 27/01/2003
    

    attached mail follows:


    Hello, I am trying to set up an admin in a site on the web. I keep coming up with the following error message when I try to set up services that this admin will cover:

    Warning: file("./conf1.ini") - No such file or directory in /home/domains/thisoldgranny.com/htdocs/uma/Uma.inc.php on line 1129

    This is the code from line 1127-1139 referred to in the warning:

    if (is_object($service)) {

    $this->service = $service;

    $conf = file(SERVICE_CONFIGURATION . $service->get('id') . ".ini");

    for ($i = 0; is_array($conf) && $i < count($conf); $i++) {

    $conf[$i] = rtrim($conf[$i]);

    $line = explode("=", $conf[$i]);

    eregi_replace('"+', '', $line[0]);

    eregi_replace('"+', '', $line[1]);

    $this->config[$line[0]] = $line[1];

    if ($line[0] == 'ElementsToManage') {

    $this->elementsToManage = explode(',', $line[1]);

    }

    }

    What I need to know is if the real problem is within this section of code or if there is a file missing that the program should be looking for. Could someone please help me?

    Thanks, Lynn

    attached mail follows:


    On Friday 31 January 2003 10:42, Lynn wrote: > Hello, I am trying to set up an admin in a site on the web. I keep coming > up with the following error message when I try to set up services that this > admin will cover: > > Warning: file("./conf1.ini") - No such file or directory in > /home/domains/thisoldgranny.com/htdocs/uma/Uma.inc.php on line 1129

    [snip]

    > What I need to know is if the real problem is within this section of code > or if there is a file missing that the program should be looking for. Could > someone please help me?

    Well the warning seems quite explicit -- it couldn't find a certain file. Did you check to see that there is such a file? If the file is there then try using the full path to the file instead of a relative path.

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

    /* After any salary raise, you will have less money at the end of the month than you did before. */

    attached mail follows:


    I hope this helps.

    Have you thought of concatenation?

    $a=spritf(however you set it up to get your decimals and comas) $b="£".$a;

    Will that not work?

    Leonard.

    -----Original Message----- From: V Dub [mailto:rwxend.net] Sent: Thursday, January 30, 2003 9:45 PM To: Ben Edwards Cc: php-generallists.php.net Subject: Re: [PHP] Money format

    http://php.net

    search in functions for number_format

    Cheers!

    Quoting Ben Edwards <benvideonetwork.org>:

    ### I wish to format money with a £ sign, two decimal places and commas ### separating thousands. I seem to be able to do the £ and decimal places with ### ### sprintf or use money_format to do the commas but cant find how to do ### both/combine them. ### ### any insight, ### ben ### ### **************************************************************** ### * Ben Edwards +44 (0)117 968 2602 * ### * Critical Site Builder http://www.criticaldistribution.com * ### * online collaborative web authoring content management system * ### * Get alt news/views films online http://www.cultureshop.org * ### * i-Contact Progressive Video http://www.videonetwork.org * ### * Smashing the Corporate image http://www.subvertise.org * ### * Bristol Indymedia http://bristol.indymedia.org * ### * Bristol's radical news http://www.bristle.org.uk * ### * PGP : F0CA 42B8 D56F 28AD 169B 49F3 3056 C6DB 8538 EEF8 * ### **************************************************************** ###

    --
    Richard Whitney
    Transcend Development
    Producing the next phase of your internet presence.
    rwxend.net
    http://xend.net
    602-971-2791
    

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

    attached mail follows:


    Greetings,

    I am having trouble with the following code. I am trying to make a table in plain text to send via email. I get the data frm a MYSQL table and then put it into an array. I find the max strlen and subtract each individual customer name strlen from that and add that many spaces. Such that if Max was 10 and a particular one was 3 it would add 7 spaces. It works fine most of the time but my customer fwd me an email where it wasnt.

    Can someone suggest a better way? I wonder if I have the cart in front of my horse but Im not sure of any better way.

    I appreciate any help.

    Thanks,

    Leonard. www.phpna.com

    //Get data from tables if ($result[1]) { while ($row = mysql_fetch_array($result[1])) { $cust = $row["customer"]; $cust = get_acct_names($cust, customer); $data[$z][cust]=$cust; $data[$z][strlen]=strlen($cust); //Get longest customer string if ($data[$z][strlen] > $data[1][$z-1][strlen]) { $maxstrlen=strlen($cust); }

    $data[$z][date]=the_big_date($row["date"], "/"); $data[$z][amount]="$".number_format($row["amount"], 2); $z++;

    } mysql_free_result($result[1]); }

    $msg[$i]="Revenue for $mon $yr\n"; $i++;

    for ($y=0; $y < $z; $y++) { //Find String Length Difference $deltastr = $maxstrlen - $data[$y][strlen]; $cust_str .= repeater(" ", $deltastr);

    $cust = $data[$y][cust].repeater(" ", $deltastr);

    $msg[$i]=$data[$y][date]."\t\t".$cust."\t\t".$data[$y][amount]."\n";

    $i++; }

    Leonard.

    attached mail follows:


    I'm looking at building a system script for build management. I would very much prefer to do this in PHP. Are there any integrated means of using CVS with php, or am I limited to using system calls from cvs?

    Thanks, Wes

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

    ---
    The selection and placement of letters on this page was
    determined automatically by a computer program. Any
    resemblance to actual words, sentences, or paragraphs is
    pure coincidence, and no liability will be assumed for
    such coincidences.
    ------------------------------------------------------------------------ 
    ---
    

    attached mail follows:


    Hi,

    I have a news site where i want to track how many "visits" or reads each individual news has. I have a main list with all the titles, then clicking on them shows the details of the specific news, only then the counter for that particular news is increased. The problem is, if the user does a refresh while at the details, the counter is increased again. How can i prevent this from happening?

    I thought it would be something like a unique counter problem, but its like having a "counter problem" for each news i have. :-P

    What would be nice, if it exists, is to check if the user is doing a refresh or coming from somewhere else. If its a refresh, the counter would simply not increase. That would be sufficient to keep the i-want-my-news-to-have-the-higher-number-of-visitors author, from having his way.

    Thanks.

    Pag

    attached mail follows:


    Not really that simple.

    You can't use the HTTP_REFERER, because it's not set when the user refreshes (at least on my browser, so at best it will be unreliable).

    Common ways to prevent such things happening (like voting for a pic or song or poll more than once) are usually done with either:

    1. logging IP address', and ignoring two votes within a reasonable period of time from the same address -- this has a high overhead of data, and isn't failsafe, because IP address' are notoriously unreliable.

    2. dropping a cookie onto the users computer, basically saying "read this one", so that the vote is only counted if the cookie isn't there... obviously users can choose to block cookies, or delete them, so this isn't reliable either

    3. sessions... if you maintain a site-wide session with each of your users (done with either a session id in the url, or with a cookie), you can keep track of which news items have been read on the server side with session variables. again, this isn't 100% reliable, because the user could delete the session cookie or delete the session # from the URL (both making the user appear as a new user)

    And that's about it.

    So, you've got a choice of three options, none of which are bullet proof at all. I personally like the session one (because all the user knows is that they're in a session, not that each news read is being logged), but you have to understand that you will not get it perfect, ever.

    I could write a PHP script, or even a client-side apple script or schedule which access' your URL every 5 mins... no cookies, no sessions, no nothin', and i'd get huge numbers :)

    If I was trying for the best possible outcome, I think I'd log an IP address, timestamp and user agent string (even if it's null), but rely on sessions first... Needless to say though if your news is being read a lot, you'll have a lot of data to store, clean out, etc.

    Justin

    on 15/02/03 5:08 PM, Pag (dantemail.telepac.pt) wrote:

    > > Hi, > > I have a news site where i want to track how many "visits" or reads each > individual news has. I have a main list with all the titles, then clicking > on them shows the details of the specific news, only then the counter for > that particular news is increased. The problem is, if the user does a > refresh while at the details, the counter is increased again. How can i > prevent this from happening? > > I thought it would be something like a unique counter problem, but its > like having a "counter problem" for each news i have. :-P > > What would be nice, if it exists, is to check if the user is doing a > refresh or coming from somewhere else. If its a refresh, the counter would > simply not increase. That would be sufficient to keep the > i-want-my-news-to-have-the-higher-number-of-visitors author, from having > his way. > > Thanks. > > Pag > >

    attached mail follows:


    a real simple thing i do is to increment the counter then use header() to redirect to same page with a variable added. so at the top of details.php i put..

    if(!$_GET['no_count']){ ...increment counter header("location:...details.php?no_count=on"); exit; }

    of course people can always just manually edit the url in the address bar in which case you could probly use http_referer to check. for my purposes most of the visitors won't edit the url so it's not too important.

    ----- Original Message ----- From: "Pag" <dantemail.telepac.pt> To: <php-generallists.php.net> Sent: Saturday, February 15, 2003 6:08 AM Subject: [PHP] How to check for refresh in PHP

    > > Hi, > > I have a news site where i want to track how many "visits" or reads each > individual news has. I have a main list with all the titles, then clicking > on them shows the details of the specific news, only then the counter for > that particular news is increased. The problem is, if the user does a > refresh while at the details, the counter is increased again. How can i > prevent this from happening? > > I thought it would be something like a unique counter problem, but its > like having a "counter problem" for each news i have. :-P > > What would be nice, if it exists, is to check if the user is doing a > refresh or coming from somewhere else. If its a refresh, the counter would > simply not increase. That would be sufficient to keep the > i-want-my-news-to-have-the-higher-number-of-visitors author, from having > his way. > > Thanks. > > Pag > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >

    attached mail follows:


    I was wondering, can you call a php script in the middle of a html page?

    I've seen some sites use code like this: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

    <html> <head> <title>Untitled</title> </head> <body> HELLO WORLD!!! <P> <!--#include file="helloworld2.php" --> </body> </html>

    but when I try it, the php script doesn't run.

    Does anyone else know how to use php on a page and yet keep the .html extension?

    Thanks in advance, Roger

    attached mail follows:


    I think what you've seen is shtml / ssi / server side includes, but anyway, since you asked:

    1. create a .htaccess file which pushes *all* .php pages through PHP

    I *THINK* the code is something like:

    <Files ~ "\.html$"> ForceType application/x-httpd-php </Files>

    But you should check the apache manual, list or some tutorials.

    2. change your code to:

    <html> <head> <title>Untitled</title> </head> <body> HELLO WORLD!!! <P> <?php include("helloworld2.php"); ?> </body> </html>

    Why can't you just use the .php extension?

    Justin

    on 31/01/03 5:46 PM, Guru Geek (gurugeek2002g-i-w-s.com) wrote:

    > I was wondering, can you call a php script in the middle of a html page? > > I've seen some sites use code like this: > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> > > <html> > <head> > <title>Untitled</title> > </head> > <body> > HELLO WORLD!!! > <P> > <!--#include file="helloworld2.php" --> > </body> > </html> > > but when I try it, the php script doesn't run. > > > Does anyone else know how to use php on a page and yet keep the .html > extension? > > Thanks in advance, > Roger > >

    attached mail follows:


    Hey everyone. I'm wondering if someone could lead me in the right direction on this one. What could I use to see if a site has been updated and then display what has been added to it?

    Any advice is appreciated. Thanks.

    Seth

    attached mail follows:


    If you are talking about a remote (out of your control) website then you will need to compare HTML areas but this could be a very hard process unless it is template/cms driven with comments in the html source etc.

    I would suggest you maybe tell us what website so we can see what the source looks like.

    Are you trying to pull out content bits or just show the areas inside of your website??

    Timothy Hitchens (HiTCHO) Web Application Consulting e-mail: timhitcho.com.au

    > -----Original Message----- > From: Seth Hopkins [mailto:shopkins006cox.net] > Sent: Friday, 31 January 2003 3:29 PM > To: php-generallists.php.net > Subject: [PHP] need some guidance > > > Hey everyone. I'm wondering if someone could lead me in the > right direction on this one. What could I use to see if a > site has been updated and then display what has been added to it? > > Any advice is appreciated. > Thanks. > > Seth > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    On a major level, create or use a large CMS (content management system), and use the information you have in the databases / file system to establish what's new, modified, etc.

    On a smaller level, you could check which files have been updated in X days (I think) with PHP, and display them as a list, which some selective listing.

    On a pain-in-the-ass level, you could maintain a HTML page with links on it to things you've recently updated, and maintain it manually.

    If you're talking about *another site* (not yours), it would be even harder.

    Justin

    on 31/01/03 4:28 PM, Seth Hopkins (shopkins006cox.net) wrote:

    > Hey everyone. I'm wondering if someone could lead me in the right direction > on this one. What could I use to see if a site has been updated and then > display what has been added to it? > > Any advice is appreciated. > Thanks. > > Seth > >

    attached mail follows:


    Hello Everyone,

    I'm trying to create a Logout Function and Link. My site uses a standard htaccess file for its authentication method. After the brower requests the username and password they have access to the protected site.

    Then users can jump to a special Messaging section where I wrote a php script that retieves the $REMOTE_USER value and checks it against a message database.

    My problem is that I'd like to have a logout link that will dump the values the user had entered for their username and password so that they can no longer access the messages, neither with a back button nor just by going back to the site url. But since I am retrieving the $REMOTE_USER value using PHP4, it seems some how it remebers the username and password. Is that because I need to destroy the session and remove or replace the session cookies? I do not know what the session name is, nor how to check it.

    Here is what I have tried so far:

    function logout() {

    session_start(); session_destroy(); setcookie("SES_NAME","","","/"); header("Location: http://www.yahoo.com"); exit; }

    My results were that everytime I click the logout link, I can just press back on the browser and go back where I was and continue using the Messaging application.

    Thank you for any help you might provide...

    Larentium Larentiumhosthive.com

    attached mail follows:


    On Friday 31 January 2003 15:50, Keith Spiller wrote: > Hello Everyone, > > I'm trying to create a Logout Function and Link. My site uses a standard > htaccess file for its authentication method. After the brower requests the > username and password they have access to the protected site. > > Then users can jump to a special Messaging section where I wrote a php > script that retieves the $REMOTE_USER value and checks it against a message > database. > > My problem is that I'd like to have a logout link that will dump the values > the user had entered for their username and password so that they can no > longer access the messages, neither with a back button nor just by going > back to the site url. But since I am retrieving the $REMOTE_USER value > using PHP4, it seems some how it remebers the username and password.

    Yes, that's because after HTTP authentication, each time the browser requests a page it'll send the user and password as well.

    > Is > that because I need to destroy the session and remove or replace the > session cookies? I do not know what the session name is, nor how to check > it.

    HTTP authentication are not related to sessions.

    Have a look in the manual > HTTP authentication with PHP

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

    /* New members are urgently needed in the Society for Prevention of Cruelty to Yourself. Apply within. */

    attached mail follows:


    when i try to rename a file with single quote(s) in the file name, e.g.

    rename("/tmp/foo 'n bar", "/tmp/foobar");

    rename fails with "there is no such file". whats wrong?

    thanx,

    akagisan

    __________________________________________________ Do You Yahoo!? Yahoo! BB is Broadband by Yahoo! http://bb.yahoo.co.jp/

    attached mail follows:


    On Friday 31 January 2003 16:52, $B%X!<%s(B $B%H!<%^%9(B wrote: > when i try to rename a file with single quote(s) in the > file name, e.g. > > rename("/tmp/foo 'n bar", "/tmp/foobar"); > > rename fails with "there is no such file". > whats wrong?

    You probably need to escape certain characters such as space and the single quote.

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

    /* I never said all Democrats were saloonkeepers; what I said was all saloonkeepers were Democrats. */

    attached mail follows:


    At 09:52 31.01.2003, =?ISO-2022-JP?B?GyRCJVghPCVzGyhCIBskQiVIITwlXiU5GyhC?= said: --------------------[snip]-------------------- >when i try to rename a file with single quote(s) in the >file name, e.g. > >rename("/tmp/foo 'n bar", "/tmp/foobar"); > >rename fails with "there is no such file". >whats wrong? --------------------[snip]--------------------

    try to escape blanks and quotes: rename("/tmp/foo\ \'n bar", "/tmp/foobar");

    generally you should escape all non-ascii characters in file names.

    -- 
       >O     Ernest E. Vogelsinger
       (\)    ICQ #13394035
        ^     http://www.vogelsinger.at/
    

    attached mail follows:


    > > Maby you could help me on why I get this message when using variables: > > Undefined variable: UN1 in c:\inetpub\wwwroot\sdd\pages\redirection.php > > on line 15 > Because you have an undefined variable. You have a variable that has not > been assigned a value. Assign it a default value or use isset() in your > tests and this will go away.

    This is a test script I used as a test (below) and got these errors. (below the script)

    The script: <?php #start variables $name = ab; $age = 16; #start script echo "Hi, my name is $name and I'am $age years old."; ?>

    The Error: Notice: Use of undefined constant ab - assumed 'ab' in c:\inetpub\wwwroot\sdd\pages\name&age.php on line 3 Hi, my name is ab and I'am 16 years old.

    How do I fix this.

    > > I have PWS being used, PHP 4.3.0 & Apache 2.0.34. OS is Windows 2k > > If you could help that would be great because I need it for testing > > scripts for my HSC Course. > Or look at error_reporting() > www.php.net/error_reporting

    There was nothing there that would really help it. Thanks any way

    > ---John Holmes...

    See Ya,

    Boz PC's Rule! Quote: "The brain can understand everything, but itself", Aaron Boeren, 2002

    *************N**********E***********R**********D*************** Webpage: http://au.geocities.com/bozthepcnerd Webpage: http://zeus.as.edu.au/~aboeren (not running) *************N**********E***********R**********D*************** Some good links: Moodle: http://zeus.as.edu.au/moodle Up & ReparePC's: http://www.upgradingandreparingpcs.com/ Blizzar Entertainment: http://www.blizzard.com/ Samsung: http://www.samsung.com/ Intel: http://www.intel.com/ Microsoft Corp.: http://www.microsoft.com/ AMD: http://www.amd.com/ Google: http://www.google.com/ Apple: http://www.apple.com/ MACOSX: http://www.apple.com/macosx/ PHP: http://www.php.net/ HTML: http://hotwired.webmonkey.com/ HTML: http://au.geocities.com/bozthepcnerd/pages/html.html

    attached mail follows:


    strings must be wrapped in quotes

    $name = 'ab';

    Justin

    on 31/01/03 8:45 PM, Aaron Stephan William Boeren (aboerenas.edu.au) wrote:

    > The script: > <?php > #start variables > $name = ab; > $age = 16; > #start script > echo "Hi, my name is $name and I'am $age years old."; > ?>

    attached mail follows:


    hi

    we try to migrate our intranet from asp to php the last problem is our indexserver.

    we are using the ado functions of php to make a connection and a query on the indexserver but the recordset is empty

    code:

    $objQuery = new COM("ixsso.Query")or die("Cannot start Query"); $objutil = new COM("IXSSO.util")or die("Cannot start Util"); $rsQuery = new COM("ADODB.recordset") or die("Cannot start Recordset"); $objutil->addscopetoquery ($objQuery,"/","deep"); $querystring = "#filename *.pdf"; print "$querystring"; $objQuery->catalog ="catalogname"; $objQuery->query = "$querystring"; $objQuery->SortBy = "filename"; $objQuery->columns = ("filename,docsubject, doctitle, docauthor, doccompany, doccategory, dockeywords, doccomments, characterization, vpath,"); $rsQuery = $objQuery->CreateRecordset("nonsequential");

    ___________________________

    any ideas how to get the thing work ?

    greets flo

    attached mail follows:


    hi all

    I'm writing a mail client and I got problem with attachments. I have no idea how to read and save attachments. Mayby someone already did something like that a can help me with some advice or giving me link to some resourses.

    greetz bartek