OSEC

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

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

    php-general Digest 1 Aug 2002 04:06:58 -0000 Issue 1498

    Topics (messages 110531 through 110618):

    Browser Javascript capabilities
            110531 by: Dennis Gearon
            110533 by: Matt Babineau
            110534 by: Brent Baisley
            110535 by: Chris Boget
            110536 by: Matt Babineau

    Re: mail () will send to everyone except my own domain
            110532 by: Tom Ray

    Disabling Browser "BACK" button
            110537 by: Petre
            110539 by: Martin Clifford
            110540 by: Petre
            110541 by: César Aracena
            110542 by: Tony Harrison
            110543 by: Dan Vande More
            110544 by: Petre
            110545 by: Chris Boget
            110547 by: César Aracena
            110548 by: R'twick Niceorgaw
            110549 by: Lee
            110550 by: Danny Shepherd
            110552 by: Petre
            110553 by: Dan Vande More
            110564 by: Jason Reid
            110600 by: Justin French
            110617 by: Aaron Ott

    Re: mcrypt
            110538 by: J Smith

    Re: web services and PHP
            110546 by: Andrew Chase

    ARRRRGGGGHHHH! Weird Problems!
            110551 by: Tony Harrison
            110614 by: Aaron Ott

    dir to array?
            110554 by: Jas
            110567 by: Jason Wong

    Creating Image...
            110555 by: mp
            110566 by: Jason Wong
            110569 by: Andrew Chase
            110573 by: hugh danaher

    I cannot use mail() ?!?
            110556 by: Aaron Paxson
            110558 by: Vail, Warren
            110559 by: Aaron Paxson
            110571 by: Jason Wong
            110588 by: Aaron Paxson
            110597 by: Manuel Lemos
            110611 by: Jason Wong

    String Question
            110557 by: Randy Johnson
            110560 by: Martin Clifford
            110561 by: Richard Baskett

    A Fond Farewell
            110562 by: Martin Clifford

    text area with quotes
            110563 by: Nathan Kline
            110565 by: 1LT John W. Holmes
            110568 by: Jason Reid
            110570 by: Kevin Stone
            110602 by: Justin French

    Re: stripping quotes from urls and images
            110572 by: Joel Boonstra
            110598 by: electroteque
            110604 by: Justin French
            110605 by: electroteque

    Printing a PHP Class
            110574 by: Marty McGowan
            110576 by: Jay Blanchard
            110579 by: 1LT John W. Holmes
            110581 by: 1LT John W. Holmes
            110583 by: Jerome Houston

    Re: Update of the problem w/ code - conditional image generation problem?!
            110575 by: Alex Maslov

    Re: dir to array? - SOLVED
            110577 by: Jas
            110585 by: Kevin Stone

    I need some help: PHP portal site/creating email accounts through form submission
            110578 by: Kevin Myrick
            110582 by: Nick Wilson
            110584 by: Kevin Myrick
            110586 by: Nathan Cook
            110587 by: Nick Wilson
            110589 by: Kevin Myrick

    extracting variables from files
            110580 by: Nick Wilson

    still need help with crash on make
            110590 by: Kirk Babb
            110591 by: Tyler Longren
            110594 by: Kirk Babb

    Re: Trouble Getting PHP Activated on Mac OS X 10.1.4
            110592 by: Robert Contursi

    Undefined function: dbmopen() in loaded Windows binaries of PHP 4.2.1
            110593 by: Nashev

    Help with fopen please.
            110595 by: Shane

    Cache issue
            110596 by: Chris Kay

    Re: n
            110599 by: Bruce Riddle

    mail() problems
            110601 by: dan radom
            110608 by: Manuel Lemos
            110610 by: dan radom
            110618 by: Manuel Lemos

    Re: Problem of recompile and reinstall apache/php/ssl
            110603 by: EdwardSPL.ita.org.mo

    PHP implementation of something like Apache's mod_speling?
            110606 by: Tim Luoma
            110609 by: Julio Nobrega

    iCalendar support?
            110607 by: Bogdan Stancescu

    php3 to php4 migration woes
            110612 by: Bruce Riddle
            110615 by: Andrew Brampton

    Explain?
            110613 by: Mantas Kriauciunas
            110616 by: Martin Towell

    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:


    Is it possible from the browser requests to tell if it is jscript
    enabled so that an appropriate page can be sent for en/disabled
    browsers?

    -- 
    

    If You want to buy computer parts, see the reviews at: http://www.cnet.com/ **OR EVEN BETTER COMPILATIONS**!! http://sysopt.earthweb.com/userreviews/products/

    attached mail follows:


    You could use a dummy page, with

    <META HTTP-EQUIV="Refresh" CONTENT="0;URL=newpage.php?jscript=off"> <SCRIPT> location.href='newpage.php?jscript=on'; </SCRIPT>

    What this should do is redirect if javascript is enabled or disabled giving you a URL variable to parse. I have not tested it but theorectically could work.

    Matt Babineau MCWD / CCFD ----------------------------------------- e: mattcriticalcode.com p: 603.943.4237 w: http://www.criticalcode.com PO BOX 601 Manchester, NH 03105

    -----Original Message----- From: Dennis Gearon [mailto:gearondcvc.net] Sent: Wednesday, July 31, 2002 12:12 PM To: php-generallists.php.net Subject: [PHP] Browser Javascript capabilities

    Is it possible from the browser requests to tell if it is jscript enabled so that an appropriate page can be sent for en/disabled browsers?

    -- 
    

    If You want to buy computer parts, see the reviews at: http://www.cnet.com/ **OR EVEN BETTER COMPILATIONS**!! http://sysopt.earthweb.com/userreviews/products/

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

    attached mail follows:


    You can't tell from the server side, but you can have a page send them to a different page depending on whether or not Javascript is enable. You could have a temp page with a Javascript redirect that is kicked off with an onLoad event handler and also have a meta refresh on the same page the executes after a second or two. If Javascript is enable, the javascript will direct them to one page, if javascript is not enabled, then the meta refresh will kick off.

    Or, you can have javascript write a cookie. Then on subsequent pages you could have the server check for the cookie, if it's not there, then they have javascript disabled (or cookies disabled).

    On Wednesday, July 31, 2002, at 12:12 PM, Dennis Gearon wrote:

    > Is it possible from the browser requests to tell if it is jscript > enabled so that an appropriate page can be sent for en/disabled > browsers? > -- > > If You want to buy computer parts, see the reviews at: > http://www.cnet.com/ > **OR EVEN BETTER COMPILATIONS**!! > http://sysopt.earthweb.com/userreviews/products/ > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >

    --
    Brent Baisley
    Systems Architect
    Landover Associates, Inc.
    Search & Advisory Services for Advanced Technology Environments
    p: 212.759.6400/800.759.0577
    

    attached mail follows:


    > <META HTTP-EQUIV="Refresh" CONTENT="0;URL=newpage.php?jscript=off">

    Pardon my ignorance, but wouldn't this immediately send the browser onto the next page before it had the opportunity to get to and run this:

    > <SCRIPT> > location.href='newpage.php?jscript=on'; > </SCRIPT>

    ? If that's the case, wouldn't you want to delay the refresh by a few seconds to allow the javascript to force the redirection?

    Chris

    attached mail follows:


    Yeah probably, you might need to add a 1 or 2 second delay to the meta refresh...

    Matt Babineau MCWD / CCFD ----------------------------------------- e: mattcriticalcode.com p: 603.943.4237 w: http://www.criticalcode.com PO BOX 601 Manchester, NH 03105

    -----Original Message----- From: Chris Boget [mailto:chriswild.net] Sent: Wednesday, July 31, 2002 12:36 PM To: Matt Babineau; gearondcvc.net; php-generallists.php.net Subject: Re: [PHP] Browser Javascript capabilities

    > <META HTTP-EQUIV="Refresh" CONTENT="0;URL=newpage.php?jscript=off">

    Pardon my ignorance, but wouldn't this immediately send the browser onto the next page before it had the opportunity to get to and run this:

    > <SCRIPT> > location.href='newpage.php?jscript=on'; > </SCRIPT>

    ? If that's the case, wouldn't you want to delay the refresh by a few seconds to allow the javascript to force the redirection?

    Chris

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

    attached mail follows:


    Gareth-

    This sounds more like a sendmail issue to me. I've run into this a few times myself.

    What's happening is simple, sendmail has a file that it reads generally called "domains" this file tells sendmail what domains it should be handling mail for. When you submit your form the first thing sendmail is doing is checking that domains file, and if your domain is listed in that file sendmail will then handle the mail locally. So basically the server is sending mail to itself. You need to edit that domains file and remove the domain name in question. Once that's done sendmail will look outside the server for answers on what it needs to do with the mail delievery.

    I can't remember the exact path off the top of my head because we use EXIM here (and it has the same issue) I would try either /etc/sendmail or /etc/mail or you can always do a find or whereis for "domains"

    Hello all,

    Having a real problem. Have written a very simple php email script that I'm testing on our server. The script works fine if I set the 'to' field as any email address but our own - i.e. xyzhotmail.com This works fine, however as soon as I set the script to email me at the domain to which the server resolves too it fails. I do not get a error message, it says that the mail has been sent. The server runs Apache 1.3 and Php 4.1.2 (I will update to 4.2.2 once I have resolved this). The error logs on the server give no indication of any problem. I cannot work this out at all - it simply will not email to the same address as the DNS resolves its own IP address too. Our mx records are held elsewhere.

    I'm at complete loss on this one - I've been checking php.ini, httpd.conf etc etc and cannot work out why this is happening. Php.ini is set too:

    sendmail_from melocalhost.com sendmail_path /usr/sbin/sendmail -t -i smtp localhost

    do I need to set the smtp to point to the server that holds the mx records?

    any help/advice much appreciated,

    thanks,

    Gareth

    ---
    Outgoing mail is certified Virus Free.
    Checked by AVG anti-virus system (http://www.grisoft.com).
    Version: 6.0.380 / Virus Database: 213 - Release Date: 24/07/2002
    

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

    attached mail follows:


    HI Is there a way I can disable the client's browser back button, forcing them to use the navigation I built into the page? Ideally, when they try to press "BACK" on browser, a popup asking them to use the navigation instead would win first prize.

    The reason I'm asking is again to do with sessions, I have an app running 100% now without using cookies, but if the user hits BACK and ignores the expire warning, the app produces unwanted results ( adds form data again to the db etc.) Just want to patch the holes.

    Maybe write my own little browser that has no back button??

    attached mail follows:


    There is never a way to disable back, forward, home, etc buttons. They all have shortcuts that will ALWAYS work, so there's really no point. Additionally, it's all nice and good that your site works fine without using cookies, and don't take this offensively, but if the client cannot use the back button without getting mishapen results, then it doesn't sound as if the site is designed very efficiently.

    Just my opinion.

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

    >>> Petre <internetvsa.co.za> 07/31/02 01:16PM >>> HI Is there a way I can disable the client's browser back button, forcing them to use the navigation I built into the page? Ideally, when they try to press "BACK" on browser, a popup asking them to use the navigation instead would win first prize.

    The reason I'm asking is again to do with sessions, I have an app running 100% now without using cookies, but if the user hits BACK and ignores the expire warning, the app produces unwanted results ( adds form data again to the db etc.) Just want to patch the holes.

    Maybe write my own little browser that has no back button??

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

    attached mail follows:


    Well, OK, then, How do you design the app NOT to allow the form to POST again when the user hits "BACK"

    Martin Clifford wrote:

    >There is never a way to disable back, forward, home, etc buttons. They all have shortcuts that will ALWAYS work, so there's really no point. Additionally, it's all nice and good that your site works fine without using cookies, and don't take this offensively, but if the client cannot use the back button without getting mishapen results, then it doesn't sound as if the site is designed very efficiently. > >Just my opinion. > >Martin Clifford >Homepage: http://www.completesource.net >Developer's Forums: http://www.completesource.net/forums/ > > >>>>Petre <internetvsa.co.za> 07/31/02 01:16PM >>> >>>> >HI >Is there a way I can disable the client's browser back button, forcing >them to use the navigation I built into the page? >Ideally, when they try to press "BACK" on browser, a popup asking them >to use the navigation instead would win first prize. > >The reason I'm asking is again to do with sessions, I have an app >running 100% now without using cookies, but if the user hits BACK and >ignores the expire warning, the app produces unwanted results ( adds >form data again to the db etc.) >Just want to patch the holes. > >Maybe write my own little browser that has no back button?? > > >

    attached mail follows:


    I think that would be easy just by UNSETTING or emptying the variables that the form passed after they are processed. Do I make sence?

    César

    > -----Original Message----- > From: Petre [mailto:internetvsa.co.za] > Sent: Wednesday, July 31, 2002 2:43 PM > To: Martin Clifford > Cc: php-general > Subject: Re: [PHP] Disabling Browser "BACK" button > > Well, OK, then, How do you design the app NOT to allow the form to POST > again when the user hits "BACK" > > Martin Clifford wrote: > > >There is never a way to disable back, forward, home, etc buttons. They > all have shortcuts that will ALWAYS work, so there's really no point. > Additionally, it's all nice and good that your site works fine without > using cookies, and don't take this offensively, but if the client cannot > use the back button without getting mishapen results, then it doesn't > sound as if the site is designed very efficiently. > > > >Just my opinion. > > > >Martin Clifford > >Homepage: http://www.completesource.net > >Developer's Forums: http://www.completesource.net/forums/ > > > > > >>>>Petre <internetvsa.co.za> 07/31/02 01:16PM >>> > >>>> > >HI > >Is there a way I can disable the client's browser back button, forcing > >them to use the navigation I built into the page? > >Ideally, when they try to press "BACK" on browser, a popup asking them > >to use the navigation instead would win first prize. > > > >The reason I'm asking is again to do with sessions, I have an app > >running 100% now without using cookies, but if the user hits BACK and > >ignores the expire warning, the app produces unwanted results ( adds > >form data again to the db etc.) > >Just want to patch the holes. > > > >Maybe write my own little browser that has no back button?? > > > > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php

    attached mail follows:


    If you write your own browser, who would use it? And without a back button - nobody

    "Petre" <internetvsa.co.za> wrote in message news:3D481B52.6020103vsa.co.za... > HI > Is there a way I can disable the client's browser back button, forcing > them to use the navigation I built into the page? > Ideally, when they try to press "BACK" on browser, a popup asking them > to use the navigation instead would win first prize. > > The reason I'm asking is again to do with sessions, I have an app > running 100% now without using cookies, but if the user hits BACK and > ignores the expire warning, the app produces unwanted results ( adds > form data again to the db etc.) > Just want to patch the holes. > > Maybe write my own little browser that has no back button?? > >

    attached mail follows:


    I do it this way

    Page1 (fill in data)->Page2(write data, instant redirect to p1, unless dies from php/mysql)

    Then the only way to repost, is to push the forward button.

    -----Original Message----- From: Petre [mailto:internetvsa.co.za] Sent: Wednesday, July 31, 2002 11:43 AM To: Martin Clifford Cc: php-general Subject: Re: [PHP] Disabling Browser "BACK" button

    Well, OK, then, How do you design the app NOT to allow the form to POST again when the user hits "BACK"

    Martin Clifford wrote:

    >There is never a way to disable back, forward, home, etc buttons. They all have shortcuts that will ALWAYS work, so there's really no point. Additionally, it's all nice and good that your site works fine without using cookies, and don't take this offensively, but if the client cannot use the back button without getting mishapen results, then it doesn't sound as if the site is designed very efficiently. > >Just my opinion. > >Martin Clifford >Homepage: http://www.completesource.net >Developer's Forums: http://www.completesource.net/forums/ > > >>>>Petre <internetvsa.co.za> 07/31/02 01:16PM >>> >>>> >HI >Is there a way I can disable the client's browser back button, forcing >them to use the navigation I built into the page? >Ideally, when they try to press "BACK" on browser, a popup asking them >to use the navigation instead would win first prize. > >The reason I'm asking is again to do with sessions, I have an app >running 100% now without using cookies, but if the user hits BACK and >ignores the expire warning, the app produces unwanted results ( adds >form data again to the db etc.) >Just want to patch the holes. > >Maybe write my own little browser that has no back button?? > > >

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

    attached mail follows:


    I hear you, but how do I know if the POST comes from a valid form submit, or from a "back" ? I cannot simply unset the $_POST vars, as that will prevent anything from being posted correctly, right?

    César Aracena wrote:

    >I think that would be easy just by UNSETTING or emptying the variables >that the form passed after they are processed. Do I make sence? > >César > >>-----Original Message----- >>From: Petre [mailto:internetvsa.co.za] >>Sent: Wednesday, July 31, 2002 2:43 PM >>To: Martin Clifford >>Cc: php-general >>Subject: Re: [PHP] Disabling Browser "BACK" button >> >>Well, OK, then, How do you design the app NOT to allow the form to >> >POST > >>again when the user hits "BACK" >> >>Martin Clifford wrote: >> >>>There is never a way to disable back, forward, home, etc buttons. >>> >They > >>all have shortcuts that will ALWAYS work, so there's really no point. >>Additionally, it's all nice and good that your site works fine without >>using cookies, and don't take this offensively, but if the client >> >cannot > >>use the back button without getting mishapen results, then it doesn't >>sound as if the site is designed very efficiently. >> >>>Just my opinion. >>> >>>Martin Clifford >>>Homepage: http://www.completesource.net >>>Developer's Forums: http://www.completesource.net/forums/ >>> >>> >>>>>>Petre <internetvsa.co.za> 07/31/02 01:16PM >>> >>>>>> >>>HI >>>Is there a way I can disable the client's browser back button, >>> >forcing > >>>them to use the navigation I built into the page? >>>Ideally, when they try to press "BACK" on browser, a popup asking >>> >them > >>>to use the navigation instead would win first prize. >>> >>>The reason I'm asking is again to do with sessions, I have an app >>>running 100% now without using cookies, but if the user hits BACK and >>>ignores the expire warning, the app produces unwanted results ( adds >>>form data again to the db etc.) >>>Just want to patch the holes. >>> >>>Maybe write my own little browser that has no back button?? >>> >>> >>> >> >> >>-- >>PHP General Mailing List (http://www.php.net/) >>To unsubscribe, visit: http://www.php.net/unsub.php >> > >

    attached mail follows:


    > Page1 (fill in data)->Page2(write data, instant redirect to p1, > unless dies from php/mysql) > Then the only way to repost, is to push the forward button.

    Unless, of course, they hit the "Submit" button again and I think that was the point the original poster was getting at. If the user cannot hit the back button, they cannot hit submit again.

    Chris

    attached mail follows:


    Well... you simple can't unless you take advantage from all the wonderful features of PHP like it's capability to know where the request comes from. Another interesting point would be to see if your program is made correctly, so your script(s) will handle just the right stuff. That is, if you point your form in Page1 to a Script in Page2, you should be pretty sure that it will handle the right stuff. After all the handling was done, you should be able to unset the variables in order *FORBID* the user to push the REFRESH or BACK buttons, submitting the data all over again.

    > -----Original Message----- > From: Petre [mailto:internetvsa.co.za] > Sent: Wednesday, July 31, 2002 2:50 PM > To: César Aracena > Cc: php-general > Subject: Re: [PHP] Disabling Browser "BACK" button > > I hear you, but how do I know if the POST comes from a valid form > submit, or from a "back" ? I cannot simply unset the $_POST vars, as > that will prevent anything from being posted correctly, right? > > > César Aracena wrote: > > >I think that would be easy just by UNSETTING or emptying the variables > >that the form passed after they are processed. Do I make sence? > > > >César > > > >>-----Original Message----- > >>From: Petre [mailto:internetvsa.co.za] > >>Sent: Wednesday, July 31, 2002 2:43 PM > >>To: Martin Clifford > >>Cc: php-general > >>Subject: Re: [PHP] Disabling Browser "BACK" button > >> > >>Well, OK, then, How do you design the app NOT to allow the form to > >> > >POST > > > >>again when the user hits "BACK" > >> > >>Martin Clifford wrote: > >> > >>>There is never a way to disable back, forward, home, etc buttons. > >>> > >They > > > >>all have shortcuts that will ALWAYS work, so there's really no point. > >>Additionally, it's all nice and good that your site works fine without > >>using cookies, and don't take this offensively, but if the client > >> > >cannot > > > >>use the back button without getting mishapen results, then it doesn't > >>sound as if the site is designed very efficiently. > >> > >>>Just my opinion. > >>> > >>>Martin Clifford > >>>Homepage: http://www.completesource.net > >>>Developer's Forums: http://www.completesource.net/forums/ > >>> > >>> > >>>>>>Petre <internetvsa.co.za> 07/31/02 01:16PM >>> > >>>>>> > >>>HI > >>>Is there a way I can disable the client's browser back button, > >>> > >forcing > > > >>>them to use the navigation I built into the page? > >>>Ideally, when they try to press "BACK" on browser, a popup asking > >>> > >them > > > >>>to use the navigation instead would win first prize. > >>> > >>>The reason I'm asking is again to do with sessions, I have an app > >>>running 100% now without using cookies, but if the user hits BACK and > >>>ignores the expire warning, the app produces unwanted results ( adds > >>>form data again to the db etc.) > >>>Just want to patch the holes. > >>> > >>>Maybe write my own little browser that has no back button?? > >>> > >>> > >>> > >> > >> > >>-- > >>PHP General Mailing List (http://www.php.net/) > >>To unsubscribe, visit: http://www.php.net/unsub.php > >> > > > > >

    attached mail follows:


    Here's what I think may work, not sure though......

    set a session variable form_submitted=false before displaying the form for input. when posted, check if form_submitted==false, then only set the session variable form_submitted to true and process it. Else show an error message If the user hits BACK button and resubmits it, then form_submitted will evaluate to true and in this case it will not be further processed.

    R'twick ----- Original Message ----- From: "Petre" <internetvsa.co.za> To: "Martin Clifford" <MLC1nrc.gov> Cc: "php-general" <php-generallists.php.net> Sent: Wednesday, July 31, 2002 1:42 PM Subject: Re: [PHP] Disabling Browser "BACK" button

    > Well, OK, then, How do you design the app NOT to allow the form to POST > again when the user hits "BACK" > > Martin Clifford wrote: > > >There is never a way to disable back, forward, home, etc buttons. They all have shortcuts that will ALWAYS work, so there's really no point. Additionally, it's all nice and good that your site works fine without using cookies, and don't take this offensively, but if the client cannot use the back button without getting mishapen results, then it doesn't sound as if the site is designed very efficiently. > > > >Just my opinion. > > > >Martin Clifford > >Homepage: http://www.completesource.net > >Developer's Forums: http://www.completesource.net/forums/ > > > > > >>>>Petre <internetvsa.co.za> 07/31/02 01:16PM >>> > >>>> > >HI > >Is there a way I can disable the client's browser back button, forcing > >them to use the navigation I built into the page? > >Ideally, when they try to press "BACK" on browser, a popup asking them > >to use the navigation instead would win first prize. > > > >The reason I'm asking is again to do with sessions, I have an app > >running 100% now without using cookies, but if the user hits BACK and > >ignores the expire warning, the app produces unwanted results ( adds > >form data again to the db etc.) > >Just want to patch the holes. > > > >Maybe write my own little browser that has no back button?? > > > > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >

    attached mail follows:


    An Idea I have just had but not tested.

    To start:- Page1 - Input Form Page2 - Data Handling (i.e. processing the form) Page3 - Redirect handler.

    So, User fills in form on Page1 then submits it. Page2 then processes this data and if it handles it correctly it simply sends a redirect (something like a Meta Refresh with time set to 0) to Page3 which then sends you onto the final page.

    By using a querystring variable and checking this in page2 you could probably get rid of Page3 and have its part handled in page2.

    I hope this makes sense.

    Cheers

    Lee ----- Original Message ----- From: "César Aracena" <icaamicaam.com.ar> To: "'Petre'" <internetvsa.co.za> Cc: "'php-general'" <php-generallists.php.net> Sent: Wednesday, July 31, 2002 7:06 PM Subject: RE: [PHP] Disabling Browser "BACK" button

    Well... you simple can't unless you take advantage from all the wonderful features of PHP like it's capability to know where the request comes from. Another interesting point would be to see if your program is made correctly, so your script(s) will handle just the right stuff. That is, if you point your form in Page1 to a Script in Page2, you should be pretty sure that it will handle the right stuff. After all the handling was done, you should be able to unset the variables in order *FORBID* the user to push the REFRESH or BACK buttons, submitting the data all over again.

    > -----Original Message----- > From: Petre [mailto:internetvsa.co.za] > Sent: Wednesday, July 31, 2002 2:50 PM > To: César Aracena > Cc: php-general > Subject: Re: [PHP] Disabling Browser "BACK" button > > I hear you, but how do I know if the POST comes from a valid form > submit, or from a "back" ? I cannot simply unset the $_POST vars, as > that will prevent anything from being posted correctly, right? > > > César Aracena wrote: > > >I think that would be easy just by UNSETTING or emptying the variables > >that the form passed after they are processed. Do I make sence? > > > >César > > > >>-----Original Message----- > >>From: Petre [mailto:internetvsa.co.za] > >>Sent: Wednesday, July 31, 2002 2:43 PM > >>To: Martin Clifford > >>Cc: php-general > >>Subject: Re: [PHP] Disabling Browser "BACK" button > >> > >>Well, OK, then, How do you design the app NOT to allow the form to > >> > >POST > > > >>again when the user hits "BACK" > >> > >>Martin Clifford wrote: > >> > >>>There is never a way to disable back, forward, home, etc buttons. > >>> > >They > > > >>all have shortcuts that will ALWAYS work, so there's really no point. > >>Additionally, it's all nice and good that your site works fine without > >>using cookies, and don't take this offensively, but if the client > >> > >cannot > > > >>use the back button without getting mishapen results, then it doesn't > >>sound as if the site is designed very efficiently. > >> > >>>Just my opinion. > >>> > >>>Martin Clifford > >>>Homepage: http://www.completesource.net > >>>Developer's Forums: http://www.completesource.net/forums/ > >>> > >>> > >>>>>>Petre <internetvsa.co.za> 07/31/02 01:16PM >>> > >>>>>> > >>>HI > >>>Is there a way I can disable the client's browser back button, > >>> > >forcing > > > >>>them to use the navigation I built into the page? > >>>Ideally, when they try to press "BACK" on browser, a popup asking > >>> > >them > > > >>>to use the navigation instead would win first prize. > >>> > >>>The reason I'm asking is again to do with sessions, I have an app > >>>running 100% now without using cookies, but if the user hits BACK and > >>>ignores the expire warning, the app produces unwanted results ( adds > >>>form data again to the db etc.) > >>>Just want to patch the holes. > >>> > >>>Maybe write my own little browser that has no back button?? > >>> > >>> > >>> > >> > >> > >>-- > >>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:


    On processing page (I.e the form's action page - where the stuff is entered into the db) set another session var so that your app knows that the form has been submitted, data entered etc. The actual form page should have some extra logic at the top which checks for this extra session var, redirecting to an 'already done this' page if the var is set. I suppose this logic should also exist in the action page, in case the user hits back and browser reposts the data.

    Example:

    1. User fills out form on 'form.php' and hits submit - browser loads 'action.php' 2. action.php checks for $_SESSION['formIsFilled'] and redirects if found, enters data into db otherwise. 3. user hits back and goes back to form.php - if browser has cached then user will be able to resubmit but will be caught at step2. If the browser didn't cache they'll be caught here.

    This method will prevent them resubmitting for the length of their session (or until $_SESSION['formIsFilled'] is unset)

    HTH

    Danny. ----- Original Message ----- From: "Chris Boget" <chriswild.net> To: "Dan Vande More" <dvmgwtr.com>; "Petre" <internetvsa.co.za>; <php-generallists.php.net> Sent: Wednesday, July 31, 2002 6:53 PM Subject: Re: [PHP] Disabling Browser "BACK" button

    > > Page1 (fill in data)->Page2(write data, instant redirect to p1, > > unless dies from php/mysql) > > Then the only way to repost, is to push the forward button. > > Unless, of course, they hit the "Submit" button again and I think > that was the point the original poster was getting at. If the user > cannot hit the back button, they cannot hit submit again. > > Chris > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    Exactly. The only way I've seen that this can be prevented is if the form action is PHP_SELF, so, you call the page onto itself and use a isset($submit), but I have reasons for not going that route, one being that I have already have a navigation laid out, and changing that will be a nightmare!

    Chris Boget wrote:

    >>Page1 (fill in data)->Page2(write data, instant redirect to p1, >>unless dies from php/mysql) >>Then the only way to repost, is to push the forward button. >> > >Unless, of course, they hit the "Submit" button again and I think >that was the point the original poster was getting at. If the user >cannot hit the back button, they cannot hit submit again. > >Chris > >

    attached mail follows:


    You are correct Chris.

    However if you designed your application as the generic

    Master-Detail-(write changes) structure

    you would merely have to use

    echo "<body onload=\"javascript:history.go(-2)\">"; to take you back to the master set, assuming js is turned on, and that is the flow of your app.

    I mainly design in an intranet environment, and variables are more controlled here than in other places.

    For instance, I'm sure that noone uses anything but IE, and JS is almost for sure on.

    Dan

    -----Original Message----- From: Chris Boget [mailto:chriswild.net] Sent: Wednesday, July 31, 2002 11:54 AM To: Dan Vande More; Petre; php-generallists.php.net Subject: Re: [PHP] Disabling Browser "BACK" button

    > Page1 (fill in data)->Page2(write data, instant redirect to p1, > unless dies from php/mysql) > Then the only way to repost, is to push the forward button.

    Unless, of course, they hit the "Submit" button again and I think that was the point the original poster was getting at. If the user cannot hit the back button, they cannot hit submit again.

    Chris

    attached mail follows:


    Actually a meta refresh isnt a good idea for this example. id personally use a header, because then there is no entry in the back list for the processing page, unlike if u used a meta refresh, which, if i am correct, leaves an entry.

    Jason Reid jasonachost.ca

    --
    AC Host Canada
    www.achost.ca
    

    ----- Original Message ----- From: "Lee" <leeunassemble.co.uk> To: "César Aracena" <icaamicaam.com.ar>; "'Petre'" <internetvsa.co.za> Cc: "'php-general'" <php-generallists.php.net> Sent: Wednesday, July 31, 2002 12:17 PM Subject: Re: [PHP] Disabling Browser "BACK" button

    > An Idea I have just had but not tested. > > To start:- > Page1 - Input Form > Page2 - Data Handling (i.e. processing the form) > Page3 - Redirect handler. > > So, User fills in form on Page1 then submits it. Page2 then processes this > data and if it handles it correctly it simply sends a redirect (something > like a Meta Refresh with time set to 0) to Page3 which then sends you onto > the final page. > > By using a querystring variable and checking this in page2 you could > probably get rid of Page3 and have its part handled in page2. > > I hope this makes sense. > > Cheers > > Lee > ----- Original Message ----- > From: "César Aracena" <icaamicaam.com.ar> > To: "'Petre'" <internetvsa.co.za> > Cc: "'php-general'" <php-generallists.php.net> > Sent: Wednesday, July 31, 2002 7:06 PM > Subject: RE: [PHP] Disabling Browser "BACK" button > > > Well... you simple can't unless you take advantage from all the > wonderful features of PHP like it's capability to know where the request > comes from. Another interesting point would be to see if your program is > made correctly, so your script(s) will handle just the right stuff. That > is, if you point your form in Page1 to a Script in Page2, you should be > pretty sure that it will handle the right stuff. After all the handling > was done, you should be able to unset the variables in order *FORBID* > the user to push the REFRESH or BACK buttons, submitting the data all > over again. > > > -----Original Message----- > > From: Petre [mailto:internetvsa.co.za] > > Sent: Wednesday, July 31, 2002 2:50 PM > > To: César Aracena > > Cc: php-general > > Subject: Re: [PHP] Disabling Browser "BACK" button > > > > I hear you, but how do I know if the POST comes from a valid form > > submit, or from a "back" ? I cannot simply unset the $_POST vars, as > > that will prevent anything from being posted correctly, right? > > > > > > César Aracena wrote: > > > > >I think that would be easy just by UNSETTING or emptying the > variables > > >that the form passed after they are processed. Do I make sence? > > > > > >César > > > > > >>-----Original Message----- > > >>From: Petre [mailto:internetvsa.co.za] > > >>Sent: Wednesday, July 31, 2002 2:43 PM > > >>To: Martin Clifford > > >>Cc: php-general > > >>Subject: Re: [PHP] Disabling Browser "BACK" button > > >> > > >>Well, OK, then, How do you design the app NOT to allow the form to > > >> > > >POST > > > > > >>again when the user hits "BACK" > > >> > > >>Martin Clifford wrote: > > >> > > >>>There is never a way to disable back, forward, home, etc buttons. > > >>> > > >They > > > > > >>all have shortcuts that will ALWAYS work, so there's really no > point. > > >>Additionally, it's all nice and good that your site works fine > without > > >>using cookies, and don't take this offensively, but if the client > > >> > > >cannot > > > > > >>use the back button without getting mishapen results, then it > doesn't > > >>sound as if the site is designed very efficiently. > > >> > > >>>Just my opinion. > > >>> > > >>>Martin Clifford > > >>>Homepage: http://www.completesource.net > > >>>Developer's Forums: http://www.completesource.net/forums/ > > >>> > > >>> > > >>>>>>Petre <internetvsa.co.za> 07/31/02 01:16PM >>> > > >>>>>> > > >>>HI > > >>>Is there a way I can disable the client's browser back button, > > >>> > > >forcing > > > > > >>>them to use the navigation I built into the page? > > >>>Ideally, when they try to press "BACK" on browser, a popup asking > > >>> > > >them > > > > > >>>to use the navigation instead would win first prize. > > >>> > > >>>The reason I'm asking is again to do with sessions, I have an app > > >>>running 100% now without using cookies, but if the user hits BACK > and > > >>>ignores the expire warning, the app produces unwanted results ( > adds > > >>>form data again to the db etc.) > > >>>Just want to patch the holes. > > >>> > > >>>Maybe write my own little browser that has no back button?? > > >>> > > >>> > > >>> > > >> > > >> > > >>-- > > >>PHP General Mailing List (http://www.php.net/) > > >>To unsubscribe, visit: http://www.php.net/unsub.php > > >> > > > > > > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php

    attached mail follows:


    on 01/08/02 3:42 AM, Petre (internetvsa.co.za) wrote:

    > Well, OK, then, How do you design the app NOT to allow the form to POST > again when the user hits "BACK"

    The PHP script that process' the form submission shouldn't be an actual page that sends stuff to the browser.

    1. form.php POSTs to parse.php

    2. parse.php validates the submitted data, adds stuff to DBs, emails people, whatever, then does a header('Location: thanks.php') redirect (not outputting anything to the browser). if there's a an error in the data, it redirects back to form.php with an error message.

    3. thanks.php says thanks for submitting the form

    When they hit "back" from thanks.php, they get the form again, and would have to click submit again to repost. When they click forward, they get the thankyou page. Since the script that adds stuff to the DB was never on the browser, it's impossible to refresh it and double-post.

    If you work on it, this can actually all be done within one php script, rather than 3.

    Good luck,

    Justin French

    attached mail follows:


    Petre,

    why not use javascripts window.open something like this link to open your app

    <a href="#" onClick="window.open('http://yourapp.com','yourappname','toolbar=no'); return false;">link to your app</a>.

    this would open a new window without the back and forward buttons.

    "Petre" <internetvsa.co.za> wrote in message news:3D481B52.6020103vsa.co.za... > HI > Is there a way I can disable the client's browser back button, forcing > them to use the navigation I built into the page? > Ideally, when they try to press "BACK" on browser, a popup asking them > to use the navigation instead would win first prize. > > The reason I'm asking is again to do with sessions, I have an app > running 100% now without using cookies, but if the user hits BACK and > ignores the expire warning, the app produces unwanted results ( adds > form data again to the db etc.) > Just want to patch the holes. > > Maybe write my own little browser that has no back button?? > >

    attached mail follows:


    If all you need is some generic encryption that doesn't require mcrypt, you might want to take a look at a crypto extension I wrote called cryptopp-php. It does everything that the mcrypt extension does and might be a touch easier to use as far as syntax and such goes. (Plus, it works on Windows if you're into that sort of thing.) It's fairly stable at the moment, and doesn't have the memory allocation problems.

    See http://www.tutorbuddy.com/software/, and http://www.tutorbuddy.com/software/cryptopp/ for the manual.

    (I hate the shameless plugging, but the more people who use my extension the easier it is for me to debug...)

    J

    Purushotham Komaravolu wrote:

    > Hi, > Thanks for the prompt answer. But I am still getting the same error. > > ///////////////////////////////////////////////////// > original: meet at secret place > encrypted: d40d72f1b224b9bf86a7dbc52402c1d02a5cf90adb9050f0 > > Warning: mcrypt_generic_init: Memory allocation error in > /mount/marsellus/gwolfe/puruclient/staging/vhosts/partnersdev.sec.yaga.com/h > tml/time/cancelsubscription/new.php on line 29 > > Warning: mdecrypt_generic(): 2 is not a valid MCrypt resource in > /mount/marsellus/gwolfe/puruclient/staging/vhosts/partnersdev.sec.yaga.com/h > tml/time/cancelsubscription/new.php on line 30 > > Warning: mcrypt_generic_end(): 2 is not a valid MCrypt resource in > /mount/marsellus/gwolfe/puruclient/staging/vhosts/partnersdev.sec.yaga.com/h > tml/time/cancelsubscription/new.php on line 31 > decrypted: > > > /////////////////////////////////////////// > > > Regards, > > Purushotham Komaravolu > Software Engineer > Yaga, Inc. - "advanced payment services" > Direct: 415-901-7343 > Fax: 415-901-1586 > http://www.yaga.com > > > > ----- Original Message ----- > From: "Tech Support" <jgrillweb-1hosting.net> > To: "Purushotham Komaravolu" <purikkhotmail.com> > Sent: Tuesday, July 30, 2002 11:34 AM > Subject: Re: [PHP] mcrypt > > >> Rather than tease you with hints I'll give you some working code ;-) >> >> Documentation for practical usage of mcrypt is weak. I agree. >> >> <? >> // crypto.inc >> $key = "secret key crap"; >> >> function hex2bin($data) >> { >> $len = strlen($data); >> return pack("H" . $len, $data); >> } >> >> function encrypt($string, $key) >> { >> // version 2.4.x of lib mcrypt >> $td = mcrypt_module_open (MCRYPT_TripleDES, "", MCRYPT_MODE_ECB, >> ""); $iv = mcrypt_create_iv (mcrypt_enc_get_iv_size ($td), >> MCRYPT_RAND); mcrypt_generic_init ($td, $key, $iv); >> $crypted = mcrypt_generic ($td, $string); >> mcrypt_generic_end ($td); >> return bin2hex($crypted); >> } >> >> function decrypt($string, $key) >> { >> //version 2.4.x of lib mcrypt >> $string = hex2bin($string); >> $td = mcrypt_module_open (MCRYPT_TripleDES, "", MCRYPT_MODE_ECB, >> ""); $iv = mcrypt_create_iv (mcrypt_enc_get_iv_size ($td), >> MCRYPT_RAND); mcrypt_generic_init ($td, $key, $iv); >> $decrypted = mdecrypt_generic ($td, $string); >> mcrypt_generic_end ($td); >> return trim($decrypted); >> } >> ?> >> >> >> usage: >> <? >> include ("path/to/crypto.inc"); >> $secret = "meet at secret place"; >> $encrypted = encrypt($secret, $key); >> print "original: " . $secret . "<br>"; >> print "encrypted: " . $encrypted . "<br>"; >> $decrypted = decrypt($encrypted, $key); >> print "decrypted: " . $decrypted . "<br>"; >> ?> >> >> Note: if you are encrypting really secret crap like credit card numbers >> or something of that nature then NEVER include the key anywhere in your >> code. Make a form where you have to type it in or something in order to >> display the results. >> >> >> Jim Grill >> Support >> Web-1 Hosting >> http://www.web-1hosting.net >> ----- Original Message ----- >> From: "Purushotham Komaravolu" <purikkhotmail.com> >> To: <php-generallists.php.net>; <php-devlists.php.net> >> Sent: Tuesday, July 30, 2002 12:52 PM >> Subject: [PHP] mcrypt >> >> >> Hello, >> I am getting some odd errors trying to get an encrypt/decrypt >> process to >> work. Looking at the manual examples and some other literature, I > have >> tried >> the two approaches listed below. For each, I get a sometimes-works, >> sometimes fails result. The manual entry has a string of user notes >> with >> problem like mine, but I still have problems. >> >> >> >> Server API Apache >> >> >> >> mcrypt >> mcrypt support enabled >> version 2.4.x >> Supported ciphers twofish rijndael-128 rijndael-192 > rijndael-256 >> saferplus rc2 xtea serpent safer-sk64 safer-sk128 cast-256 loki97 > gost >> threeway cast-128 des tripledes enigma arcfour panama wake >> Supported modes ofb cfb nofb cbc ecb stream >> >> >> --] >> >> >> >> The first attempt used the following code: >> >> >> --> >> <?php >> $key = "this is a secret key"; >> $input = "Let us meet at 9 o'clock at the secret place."; >> >> >> $td = mcrypt_module_open ('tripledes', '', 'ecb', ''); >> $iv = mcrypt_create_iv (mcrypt_enc_get_iv_size ($td), >> MCRYPT_RAND); >> mcrypt_generic_init ($td, $key, $iv); >> $encrypted_data = mcrypt_generic ($td, $input); >> $decrypted_data = mdecrypt_generic ($td, $encrypted_data); >> mcrypt_generic_end ($td); >> >> >> echo "key: >> >> > $key<br>input:$input<br>encrypted:$encrypted_data<br>decrypted:$decrypted_da >> ta"; >> ?> >> --] >> >> >> This resulted, at first, in "key: this is a secret key >> input:Let us meet at 9 o'clock at the secret place. >> encrypted:\ºþêTÏ'áz(v¹FýaõFËU³æç SäÇÚÖzßù5Qì<±_T-:Í >> decrypted:Let us meet at 9 o'clock at the secret place." >> >> >> BUT after I refreshed/reloaded a couple of times, I got this: >> "Warning: >> mcrypt_generic_init: Memory allocation error in >> /home/pndrdrm001/www/administrator/crypt.php on line 64 >> >> >> Warning: 1 is not a valid MCrypt resource in >> /home/pndrdrm001/www/administrator/crypt.php on line 65 >> >> >> Warning: 1 is not a valid MCrypt resource in >> /home/pndrdrm001/www/administrator/crypt.php on line 66 >> >> >> Warning: 1 is not a valid MCrypt resource in >> /home/pndrdrm001/www/administrator/crypt.php on line 67 >> key: this is a secret key >> input:Let us meet at 9 o'clock at the secret place. >> encrypted: >> decrypted: " >> >> >> There were no changes to the code. >> >> >> >> The second try used the following: >> >> >> In file 1, the functions: >> --> >> <?php >> >> >> function my_encrypt($sString) >> { >> GLOBAL $sCryptoKey; >> >> >> $iIV = mcrypt_create_iv (mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, >> MCRYPT_MODE_ECB), MCRYPT_RAND); >> >> >> $sEncrypted = mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $sCryptoKey, >> $sString, >> MCRYPT_MODE_ECB, $iIV); >> >> >> return($sEncrypted); >> } // End function my_encrypt >> >> >> function my_decrypt($sString) >> { >> GLOBAL $sCryptoKey; >> >> >> $iIV = mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, >> MCRYPT_MODE_ECB), MCRYPT_RAND); >> >> >> $sDecrypted = mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $sCryptoKey, >> $sString, >> MCRYPT_MODE_ECB, $iIV); >> >> >> return(trim($sDecrypted)); >> >> >> } // End function my_decrypt >> ?> >> --] >> and in file 2, the main page: >> --> >> <?php >> include "cryption.php"; >> $sCryptoKey = "key"; >> $input = "test"; >> $encrypted = my_encrypt($input); >> $decrypted = my_decrypt($encrypted); >> >> >> echo "key: >> >> > $sCryptoKey<br>input:$input<br>encrypted:$encrypted<br>decrypted:$decrypted" >> ; >> >> >> >> ?> >> --] >> >> >> This resulted in "key: key >> input:test >> encrypted: &foUÝø§ª~RM¡°Kz à¼O¼¿rw"xnÉ >> decrypted:test " the first time, but then I got "Fatal error: >> generic_init >> failed in /home/pndrdrm001/www/administrator/cryption.php on line >> 9" >> on the >> second refresh. >> >> >> >> Is there a missing call to free resources, or something? What can >> be >> done? >> >> >> Thanks! >> Regards, >> >> Puru >>

    attached mail follows:


    There is also a PEAR SOAP package available:

    http://pear.php.net/package-info.php?pacid=87

    Some web services also use XML-RPC, a simpler predecessor to SOAP:

    http://www.xmlrpc.com

    There are a couple of PHP classes available for implementing XML-RPC clients and servers:

    http://phpxmlrpc.sourceforge.net/

    -Andy

    > -----Original Message----- > From: Andrey Hristov [mailto:ahristovicygen.com] > Sent: Wednesday, July 31, 2002 2:40 AM > To: php-generallists.php.net > Subject: Re: [PHP] web services and PHP > > > > There are two ways (SOAP) to use SOAP library written in PHP > such as NuSOAP > by Dietrich Ayala or to use > PHP-SOAP toolkit (module for PHP written in C)by Brad > Lafountain(coding) and > Shane Caraveo(testing) (available at sourceforge.net).

    attached mail follows:


    OK, im having some minor problems with my site. In artist.php (http://members.lycos.co.uk/ajohnh/artist.php - Source at: http://members.lycos.co.uk/ajohnh/source/artist.txt) If for example you view lyrics by Weird Al Yankovic (http://members.lycos.co.uk/ajohnh/artist.php?id=1) You'll see that the bottom lyric (The Sage Begins) does not display. Now when you sort them by views (http://members.lycos.co.uk/ajohnh/artist.php?id=1&sortby=views) you will see that err, The Sage Begins is there, and the other one can no longer be seen. PLease examine my source and tell me whats wrong. And another thing about that page. The rows are meant to be alternating between #DFDFDF (grey) and #FFFFFF (white) - why the hell are they all grey?!?!?!!? It worked fine in index.php - source at http://members.lycos.co.uk/ajohnh/source/index.txt

    Please help !!!!!!

    attached mail follows:


    tony,

    regarding problem one, it looks like there is a problem in the code near: for ($g = 0; $g < $num_lyrics; $g ++) {

    try doing: for ($g = 0; $g <= $num_lyrics; $g ++) {

    As for problem two, it looks like you have your color variable set in the for loop thereby resetting the color variable to 1 with each pass: for ($g = 0; $g < $num_lyrics; $g ++) { $color = 1; if ($color == 1) { $rowcolor = "#DFDFDF"; $color ++; } else { $rowcolor= "#FFFFFF"; $color --; } ... }

    "Tony Harrison" <tonyh21tharrison21.fsnet.co.uk> wrote in message news:20020731181502.56031.qmailpb1.pair.com... > OK, im having some minor problems with my site. > In artist.php (http://members.lycos.co.uk/ajohnh/artist.php - Source at: > http://members.lycos.co.uk/ajohnh/source/artist.txt) If for example you view > lyrics by Weird Al Yankovic > (http://members.lycos.co.uk/ajohnh/artist.php?id=1) You'll see that the > bottom lyric (The Sage Begins) does not display. Now when you sort them by > views (http://members.lycos.co.uk/ajohnh/artist.php?id=1&sortby=views) you > will see that err, The Sage Begins is there, and the other one can no longer > be seen. PLease examine my source and tell me whats wrong. And another thing > about that page. The rows are meant to be alternating between #DFDFDF (grey) > and #FFFFFF (white) - why the hell are they all grey?!?!?!!? It worked fine > in index.php - source at http://members.lycos.co.uk/ajohnh/source/index.txt > > > Please help !!!!!! > >

    attached mail follows:


    Not sure why this isn't working, any help is appreciated. I am trying to read the files in a directory and place them into an array. Here is the code:

    /* Function to create array of directory contents */ function dCNTS($files) { $dir = opendir("/path/to/directory/"); while($imgs = readdir($dir)) { if (($imgs != ".") && ($imgs != "..")) { $cnt[count($imgs)] = $cnt; } else { print "Cannot create array of files in directory!"; } } closedir($dir); }

    attached mail follows:


    On Thursday 01 August 2002 03:00, Jas wrote: > Not sure why this isn't working, any help is appreciated. I am trying to > read the files in a directory and place them into an array. Here is the > code: > > /* Function to create array of directory contents */ > function dCNTS($files) { > $dir = opendir("/path/to/directory/"); > while($imgs = readdir($dir)) { > if (($imgs != ".") && ($imgs != "..")) { > $cnt[count($imgs)] = $cnt; > } else { > print "Cannot create array of files in directory!"; } > } > closedir($dir); > }

    HOW isn't it working?

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

    /* One person's error is another person's data. */

    attached mail follows:


    I want to create simple image... I execute this script:

    $im = imagecreate (50, 100); $fp = fopen("test/im.jpg","w"); fwrite($fp, imagegd($im)); fclose($fp);

    But there is some problems about this... Could somebody help me?

    attached mail follows:


    On Thursday 01 August 2002 02:11, mp wrote: > I want to create simple image... > I execute this script: > > $im = imagecreate (50, 100); > $fp = fopen("test/im.jpg","w"); > fwrite($fp, imagegd($im)); > fclose($fp); > > But there is some problems about this... > Could somebody help me?

    Only if you say what the problems are.

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

    /* I'm proud to be paying taxes in the United States. The only thing is -- I could be just as proud for half the money. -- Arthur Godfrey */

    attached mail follows:


    To write a GD image to disk as a jpeg, do this instead:

    $im = imagecreate(50,100);

    imagejpeg($im, "test/im.jpg");

    You don't need to use file handlers. Of course, without doing anything like adding text or lines to $im, it will just be written to disk as a blank image. :)

    -Andy

    > -----Original Message----- > From: mp [mailto:lietuvaxxx.lt] > Sent: Wednesday, July 31, 2002 11:11 AM > To: php-generallists.php.net > Subject: [PHP] Creating Image... > > > I want to create simple image... > I execute this script: > > $im = imagecreate (50, 100); > $fp = fopen("test/im.jpg","w"); > fwrite($fp, imagegd($im)); > fclose($fp); > > But there is some problems about this... > Could somebody help me? > Could somebody help me?

    attached mail follows:


    You might also want to add a "quality" factor to the imagejpeg() function if the image "as is" looks a bit ratty. $factor="100" // or another suitable number between 100 and 0 imagejpeg($im, "test/im.jpg",$factor); hope this helps. Hugh

    ----- Original Message ----- From: "Andrew Chase" <andrew.chasevalleypres.org> To: <php-generallists.php.net> Sent: Wednesday, July 31, 2002 1:10 PM Subject: RE: [PHP] Creating Image...

    > To write a GD image to disk as a jpeg, do this instead: > > > $im = imagecreate(50,100); > > imagejpeg($im, "test/im.jpg"); > > > You don't need to use file handlers. Of course, without doing anything like > adding text or lines to $im, it will just be written to disk as a blank > image. :) > > -Andy > > > -----Original Message----- > > From: mp [mailto:lietuvaxxx.lt] > > Sent: Wednesday, July 31, 2002 11:11 AM > > To: php-generallists.php.net > > Subject: [PHP] Creating Image... > > > > > > I want to create simple image... > > I execute this script: > > > > $im = imagecreate (50, 100); > > $fp = fopen("test/im.jpg","w"); > > fwrite($fp, imagegd($im)); > > fclose($fp); > > > > But there is some problems about this... > > Could somebody help me? > > Could somebody help me? > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    I am currently using PHP 4.2.2 with Apache 1.3 on RedHat 7.2. My email server is Exchange 5.5sp3

    SMTP is set correctly in my php.ini file, and have restarted Apache. However, I still cannot send out a simple text email:

    <?php mail("namemydomain.com","Test","This is a test message"); ?>

    The function returns true, but no delivery is made. In looking in my Exchange Queues, I do not see any sign of an email going through. However, using an email client in KDE, email is sent just fine through SMTP. Did I miss something?

    Aaron

    attached mail follows:


    Outgoing email requires access to a SMTP client or relay. To prevent these relays from being used for SPAM, most shops will restrict which IP's can use the relay. Suggest you contact the administrators of your exchange server, and make sure the IP is on the list of eligible IP's for using the relay, or install the smtp client software on your RedHat machine. Another concern would be access to DNS serving the domains you intend to send mail to. Your SMTP client will need have access a good dns. Key question, are you attempting to send email thru a firewall? Unless you get the an ok for that, you may find your ability to send email limited to within the domain.

    just a few ideas,

    Warren Vail Tools, Metrics & Quality Processes

    -----Original Message----- From: Aaron Paxson [mailto:apaxsonteters.com] Sent: Wednesday, July 31, 2002 12:18 PM To: php-generallists.php.net Subject: [PHP] I cannot use mail() ?!?

    I am currently using PHP 4.2.2 with Apache 1.3 on RedHat 7.2. My email server is Exchange 5.5sp3

    SMTP is set correctly in my php.ini file, and have restarted Apache. However, I still cannot send out a simple text email:

    <?php mail("namemydomain.com","Test","This is a test message"); ?>

    The function returns true, but no delivery is made. In looking in my Exchange Queues, I do not see any sign of an email going through. However, using an email client in KDE, email is sent just fine through SMTP. Did I miss something?

    Aaron

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

    attached mail follows:


    Excellent ideas Warren!!

    Being the IT Systems Administrator, I administrate everything from the firewalls to the exchange/DNS servers. Everything seems to be okay there.

    In doing another test, I was able to send out an email via my SMTP server to other domains, just not to me. It apparently did not use the "sendmail_from" setting since the email says root. I'll look at that issue later <grin>

    You are correct, that I am set to "not be a relay". However, there is no relaying involved, since it is coming from "within" my own domain. Also, the KDE environment works just fine with SMTP messaging, just not PHP. I'm wondering if I'm missing something. I'm fairly new to PHP. Maybe my settings? I just compiled PHP, Apache, and MySql just last week.

    Thanks for the response!!! Aaron "Warren Vail" <Warren.Vailschwab.com> wrote in message news:A252B2CDF6D2D4119DAB0002A51326DE09A992F9n1028smx.nt.schwab.com... > Outgoing email requires access to a SMTP client or relay. To prevent these > relays from being used for SPAM, most shops will restrict which IP's can use > the relay. Suggest you contact the administrators of your exchange server, > and make sure the IP is on the list of eligible IP's for using the relay, or > install the smtp client software on your RedHat machine. Another concern > would be access to DNS serving the domains you intend to send mail to. Your > SMTP client will need have access a good dns. Key question, are you > attempting to send email thru a firewall? Unless you get the an ok for > that, you may find your ability to send email limited to within the domain. > > just a few ideas, > > Warren Vail > Tools, Metrics & Quality Processes > > > -----Original Message----- > From: Aaron Paxson [mailto:apaxsonteters.com] > Sent: Wednesday, July 31, 2002 12:18 PM > To: php-generallists.php.net > Subject: [PHP] I cannot use mail() ?!? > > > I am currently using PHP 4.2.2 with Apache 1.3 on RedHat 7.2. My email > server is Exchange 5.5sp3 > > SMTP is set correctly in my php.ini file, and have restarted Apache. > However, I still cannot send out a simple text email: > > <?php mail("namemydomain.com","Test","This is a test message"); ?> > > The function returns true, but no delivery is made. In looking in my > Exchange Queues, I do not see any sign of an email going through. However, > using an email client in KDE, email is sent just fine through SMTP. Did I > miss something? > > Aaron > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php

    attached mail follows:


    On Thursday 01 August 2002 03:17, Aaron Paxson wrote: > I am currently using PHP 4.2.2 with Apache 1.3 on RedHat 7.2. My email > server is Exchange 5.5sp3 > > SMTP is set correctly in my php.ini file, and have restarted Apache. > However, I still cannot send out a simple text email:

    I believe the SMTP setting in php.ini is only used if the server is running Windows. Under Linux, the sendmail setting is used. Read the comments in php.ini.

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

    /* panic: kernel segmentation violation. core dumped (only kidding) */

    attached mail follows:


    That is what I had orginally thought. However, in an article I found about mail(), he said it will also work on a linux box that does not have sendmail configured.

    If that's the case, how do I get sendmail to work with Exchange?? <sendmail newbie>

    Aaron

    "Jason Wong" <php-generalgremlins.com.hk> wrote in message news:200208010416.16738.php-generalgremlins.com.hk... > On Thursday 01 August 2002 03:17, Aaron Paxson wrote: > > I am currently using PHP 4.2.2 with Apache 1.3 on RedHat 7.2. My email > > server is Exchange 5.5sp3 > > > > SMTP is set correctly in my php.ini file, and have restarted Apache. > > However, I still cannot send out a simple text email: > > I believe the SMTP setting in php.ini is only used if the server is running > Windows. Under Linux, the sendmail setting is used. Read the comments in > php.ini. > > -- > Jason Wong -> Gremlins Associates -> www.gremlins.com.hk > Open Source Software Systems Integrators > * Web Design & Hosting * Internet & Intranet Applications Development * > > /* > panic: kernel segmentation violation. core dumped (only kidding) > */ >

    attached mail follows:


    Hello,

    On 07/31/2002 04:17 PM, Aaron Paxson wrote: > I am currently using PHP 4.2.2 with Apache 1.3 on RedHat 7.2. My email > server is Exchange 5.5sp3 > > SMTP is set correctly in my php.ini file, and have restarted Apache. > However, I still cannot send out a simple text email: > > <?php mail("namemydomain.com","Test","This is a test message"); ?> > > The function returns true, but no delivery is made. In looking in my > Exchange Queues, I do not see any sign of an email going through. However, > using an email client in KDE, email is sent just fine through SMTP. Did I > miss something?

    mail() function has a very long track record for being buggy, especially under Windows were the PHP SMTP client code in used by mail() has to be used.

    I lot of people has overcame their mail problems using this SMTP client class that I recommend. If you still have delivery problems, you can still enable debug mode and see what the SMTP dialog shows.

    http://www.phpclasses.org/smtpclass

    This class is better used in conjunction with this for composing and sending MIME formatted messages:

    http://www.phpclasses.org/mimemessage

    -- 
    

    Regards, Manuel Lemos

    attached mail follows:


    On Thursday 01 August 2002 05:50, Aaron Paxson wrote: > That is what I had orginally thought. However, in an article I found about > mail(), he said it will also work on a linux box that does not have > sendmail configured.

    In my experience, if php does not find sendmail when it is configured and compiled, mail() would not work. You would get an error message like:

    PHP Warning: mail() is not supported in this PHP build ...

    To see whether this is the case in your situation check your php log file (make sure you've set php to report ALL errors).

    > If that's the case, how do I get sendmail to work with Exchange?? > <sendmail newbie>

    How do you mean by 'work with Exchange' ? If sendmail was configured properly, it would send mail to anywhere you tell it to.

    Does your sendmail installation work at all? That is have you tested it outside of PHP?

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

    /* Graduate life: It's not just a job. It's an indenture. */

    attached mail follows:


    Hello,

    I would like to be able to do the following but have not figured out a way to handle it

    $string="abcdefghijklmnopqrstuvwxz";

    I would like to divde the above string into separate strings 8 charactes long , example

    $string1=abcdefgh $string2=ijklmnop $string3=qrstuvwx $string4=yz

    if the string were only 10 long

    $string=abcdefghij

    then

    $string1=abcdefgh $string2=ij

    any suggestions would be greatly appreciated.

    Thanks,

    Randy

    attached mail follows:


    Give this a whirl:

    <?php

    $string = "abcdefghijklmnopqrstuvwxyz"; $len = strlen($string) // in this case, 26

    for($i=0; $i < $len; $i+8) { $str_array[] = substr($string, $i, 8); }

    for($i=0; $i < count($str_array); $i++) { echo $str_array[$i] . "<br>\n"; }

    ?>

    I haven't tested it, but in theory it should find the length of the string (26), loop through it as long as $i is less than 26, incrementing 8 at a time. Each time it goes through, $str_array[] is fed a new element, which is a substring of $string that starts at $i (0, 8, 16, 24, etc) and grabs 8 characters. So here is how the data should be retrieved.

    1st loop: 0-7 (8 elements) 2nd loop: 8-15 (8 elements) 3rd loop: 16-23 (8 elements) 4th loop: 24-26 (3 elements)

    Let me know how it works out for you :o)

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

    >>> "Randy Johnson" <icgphpicecoldgold.com> 07/31/02 03:26PM >>> Hello,

    I would like to be able to do the following but have not figured out a way to handle it

    $string="abcdefghijklmnopqrstuvwxz";

    I would like to divde the above string into separate strings 8 charactes long , example

    $string1=abcdefgh $string2=ijklmnop $string3=qrstuvwx $string4=yz

    if the string were only 10 long

    $string=abcdefghij

    then

    $string1=abcdefgh $string2=ij

    any suggestions would be greatly appreciated.

    Thanks,

    Randy

    attached mail follows:


    <? $string = 'abcdefghijklmnopqrstuvwxyz'; $strNum = ceil(strlen($string)/8);

    for ($i=0; $i<$strNum; $i++) $newString[] = substr($string, ($i*8), 8);

    for ($j=0; $j<count($newString); $j++) echo "string$j = $newString[$j]<br />"; ?>

    Rick

    A sense of humor can help you over look the unattractive, tolerate the unpleasant, cope with the unexpected, and smile through the unbearable. - Moshe Waldoks

    > From: "Randy Johnson" <icgphpicecoldgold.com> > Date: Wed, 31 Jul 2002 15:26:15 -0400 > To: <php-generallists.php.net> > Subject: [PHP] String Question > > Hello, > > I would like to be able to do the following but have not figured out a way to > handle it > > $string="abcdefghijklmnopqrstuvwxz"; > > I would like to divde the above string into separate strings 8 charactes long > , example > > $string1=abcdefgh > $string2=ijklmnop > $string3=qrstuvwx > $string4=yz > > if the string were only 10 long > > $string=abcdefghij > > then > > $string1=abcdefgh > $string2=ij > > any suggestions would be greatly appreciated. > > Thanks, > > > Randy >

    attached mail follows:


    Howdy List,

    Well, apparently we are no longer permitted to receive "personal" emails where I am working, so I'm afraid I'll have to part ways with the lot of you. It's unfortunate, considering I think this one of the best places to find information about PHP (and more!) on the internet. It sure as hell as taught me a lot about our craft.

    To those that I have helped, thank you for giving me the opportunity to do so. It has truly been MY pleasure. You can always contact me at this address if you're in a bind, and I'll do what I can :o)

    To those that have helped me, one HUGE THANK YOU!!! You all are the best of the best, and I'll always been grateful for the advice and knowledge that you all have shared with me. You are truly great people to be so generous. Thank you again!

    If anyone wants to contact me, you'll have to reply directly, as I'm unsubscribing after I send this last mail. Against my will, no doubt, but leaving just the same. Take care, everyone, and as always...

    Happy Coding! :o)

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

    attached mail follows:


    this seems so obvious yet it is giving me problems.

    I have a text area in a form that is passed to a php page to be written to a database. first though It displays the contents of the form in a preview page. then if everything is good the user click the button and it write to the DB. I pass the contents of the text area straight to the next page (i.e. $form_item_name) so i never mess with the variable.

    now for the problem.

    when it displays the variable it adds the escape character (\) to any ' or " in the text. if I resend the same document it adds more. how do i get it to display 's and "s in a variable without php adding the \??

    -- 
    Nathan Kline
    i.e. Man in the Box
    mitbmitb.net
    

    attached mail follows:


    www.php.net/stripslashes

    ---John Holmes...

    ----- Original Message ----- From: "Nathan Kline" <mitbmitb.net> To: <php-generallists.php.net> Sent: Wednesday, July 31, 2002 3:50 PM Subject: [PHP] text area with quotes

    > this seems so obvious yet it is giving me problems. > > I have a text area in a form that is passed to a php page to be > written to a database. first though It displays the contents of the > form in a preview page. then if everything is good the user click the > button and it write to the DB. I pass the contents of the text area > straight to the next page (i.e. $form_item_name) so i never mess with > the variable. > > now for the problem. > > when it displays the variable it adds the escape character (\) to any > ' or " in the text. if I resend the same document it adds more. how > do i get it to display 's and "s in a variable without php adding the > \?? > > > -- > Nathan Kline > i.e. Man in the Box > mitbmitb.net > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    If it adds the slashes, before u echo it back out, try stripslashes($var) first

    Jason Reid jasonachost.ca

    --
    AC Host Canada
    www.achost.ca
    

    ----- Original Message ----- From: "Nathan Kline" <mitbmitb.net> To: <php-generallists.php.net> Sent: Wednesday, July 31, 2002 1:50 PM Subject: [PHP] text area with quotes

    > this seems so obvious yet it is giving me problems. > > I have a text area in a form that is passed to a php page to be > written to a database. first though It displays the contents of the > form in a preview page. then if everything is good the user click the > button and it write to the DB. I pass the contents of the text area > straight to the next page (i.e. $form_item_name) so i never mess with > the variable. > > now for the problem. > > when it displays the variable it adds the escape character (\) to any > ' or " in the text. if I resend the same document it adds more. how > do i get it to display 's and "s in a variable without php adding the > \?? > > > -- > Nathan Kline > i.e. Man in the Box > mitbmitb.net > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    addslashes($st); before you put the string into the d-base stripslashes($str); after you retrieve the string from the d-base Otherwise MySQL is going to do its best to limit the illegal characters on its own. :) -Kevin

    ----- Original Message ----- From: "Nathan Kline" <mitbmitb.net> To: <php-generallists.php.net> Sent: Wednesday, July 31, 2002 1:50 PM Subject: [PHP] text area with quotes

    > this seems so obvious yet it is giving me problems. > > I have a text area in a form that is passed to a php page to be > written to a database. first though It displays the contents of the > form in a preview page. then if everything is good the user click the > button and it write to the DB. I pass the contents of the text area > straight to the next page (i.e. $form_item_name) so i never mess with > the variable. > > now for the problem. > > when it displays the variable it adds the escape character (\) to any > ' or " in the text. if I resend the same document it adds more. how > do i get it to display 's and "s in a variable without php adding the > \?? > > > -- > Nathan Kline > i.e. Man in the Box > mitbmitb.net > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    check out strip_slashes() or stripslashes() [can never remember which one!!] in the manual.

    Justin French

    on 01/08/02 5:50 AM, Nathan Kline (mitbmitb.net) wrote:

    > this seems so obvious yet it is giving me problems. > > I have a text area in a form that is passed to a php page to be > written to a database. first though It displays the contents of the > form in a preview page. then if everything is good the user click the > button and it write to the DB. I pass the contents of the text area > straight to the next page (i.e. $form_item_name) so i never mess with > the variable. > > now for the problem. > > when it displays the variable it adds the escape character (\) to any > ' or " in the text. if I resend the same document it adds more. how > do i get it to display 's and "s in a variable without php adding the > \?? >

    attached mail follows:


    > hi guys i now have a problem with urls i need to remove the quotes from both > href="" and src="" > > so > <a href="blah"> <img src=""> needs to be <a href=> <img src=> and i cant > remove quotes from all string matches :|

    Someone mentioned this already, but you should really know that if you remove quotes from your HTML attributes, your HTML will no longer be forward-compatible with XHTML, which you really should strive for. What reason would you have for removing the quotes? There must be a better workaround than removing them.

    Regarding your question, it really depends on how you can operate on your HTML. Where is your HTML? Is it in a database, string, etc? Is it all in one chunk? That is, do you have stuff like this:

    <a href="some/url"><img src="some/image">This link has "quotes"</img></a>

    that can't just have all quotes removed entirely from it? If you really need to remove quotes from attributes (and I don't think you do), and all of your HTML is in one big string, you're looking at a regular expression. Read up on them here:

    http://www.php.net/manual/en/pcre.pattern.syntax.php

    Yep, that's a lot of reading. But you should learn about regular expressions; they'll be useful all over the place. If you happen to be on a Linux/Unix/BSD/whatever machine that has man pages and perl installed, check out `man perlre`. Or read on-line here:

    http://www.perldoc.com/perl5.6.1/pod/perlre.html

    Some things to watch out for -- even if you do want to remove quotes from your attributes, I'm 100% sure you don't want to remove from *all* of them. Like this:

    <img src="/some/image/" title="this is a pop-up description" />

    Removing the quotes from the title attribute will likely break at least some browsers, if not all. So your regular expression needs to be able to handle that gracefully.

    Good luck!

    -- 
    [ joel boonstra | jboonstragospelcom.net ]
    

    attached mail follows:


    i sorter need a preg example i'm not very good at it , and its for a wysiwyg dhtml editor , it reformats those tags if the quotes are there when i load the content and stuffs the code

    -----Original Message----- From: Joel Boonstra [mailto:jboonstragospelcom.net] Sent: Thursday, August 01, 2002 6:18 AM To: php-generallists.php.net Cc: electroteque Subject: Re: stripping quotes from urls and images

    > hi guys i now have a problem with urls i need to remove the quotes from both > href="" and src="" > > so > <a href="blah"> <img src=""> needs to be <a href=> <img src=> and i cant > remove quotes from all string matches :|

    Someone mentioned this already, but you should really know that if you remove quotes from your HTML attributes, your HTML will no longer be forward-compatible with XHTML, which you really should strive for. What reason would you have for removing the quotes? There must be a better workaround than removing them.

    Regarding your question, it really depends on how you can operate on your HTML. Where is your HTML? Is it in a database, string, etc? Is it all in one chunk? That is, do you have stuff like this:

    <a href="some/url"><img src="some/image">This link has "quotes"</img></a>

    that can't just have all quotes removed entirely from it? If you really need to remove quotes from attributes (and I don't think you do), and all of your HTML is in one big string, you're looking at a regular expression. Read up on them here:

    http://www.php.net/manual/en/pcre.pattern.syntax.php

    Yep, that's a lot of reading. But you should learn about regular expressions; they'll be useful all over the place. If you happen to be on a Linux/Unix/BSD/whatever machine that has man pages and perl installed, check out `man perlre`. Or read on-line here:

    http://www.perldoc.com/perl5.6.1/pod/perlre.html

    Some things to watch out for -- even if you do want to remove quotes from your attributes, I'm 100% sure you don't want to remove from *all* of them. Like this:

    <img src="/some/image/" title="this is a pop-up description" />

    Removing the quotes from the title attribute will likely break at least some browsers, if not all. So your regular expression needs to be able to handle that gracefully.

    Good luck!

    --
    [ joel boonstra | jboonstragospelcom.net ]
    

    attached mail follows:


    I'm reminded of a reasonable quote:

    "It's easy to write HTML, and impossible to parse it" Because HTML is *SO* easy to write, and has so many options, and is easy to screw up AND have browsers still work, it's totally evil to parse.

    You end up with massive regular expressions, or a state engine which reads the string one character at a time, and can keep track of what's going on, then make changes.

    I've been working on a state engine for a while, with some success.

    Basically, a browser is just a big state engine.

    I think you should perhaps look at your problem from another angle... there are MANY valid ways to write HTML tags... whatever your system does, it should support user preferences.

    <A HREF=foo.php> = valid <A HREF="foo.php"> = valid <A HREF='foo.php'> = valid

    Plus combinations of single and double quotes for different attributes, etc etc.

    Check out http://www.w3.org/TR/1999/REC-html401-19991224/intro/sgmltut.html

    Justin French

    on 01/08/02 10:43 AM, electroteque (danielelectroteque.org) wrote:

    > i sorter need a preg example i'm not very good at it , and its for a wysiwyg > dhtml editor , it reformats those tags if the quotes are there when i load > the content and stuffs the code > > -----Original Message----- > From: Joel Boonstra [mailto:jboonstragospelcom.net] > Sent: Thursday, August 01, 2002 6:18 AM > To: php-generallists.php.net > Cc: electroteque > Subject: Re: stripping quotes from urls and images > > >> hi guys i now have a problem with urls i need to remove the quotes from > both >> href="" and src="" >> >> so >> <a href="blah"> <img src=""> needs to be <a href=> <img src=> and i cant >> remove quotes from all string matches :| > > Someone mentioned this already, but you should really know that if you > remove quotes from your HTML attributes, your HTML will no longer be > forward-compatible with XHTML, which you really should strive for. What > reason would you have for removing the quotes? There must be a better > workaround than removing them. > > Regarding your question, it really depends on how you can operate on > your HTML. Where is your HTML? Is it in a database, string, etc? Is > it all in one chunk? That is, do you have stuff like this: > > <a href="some/url"><img src="some/image">This link has "quotes"</img></a> > > that can't just have all quotes removed entirely from it? If you really > need to remove quotes from attributes (and I don't think you do), and > all of your HTML is in one big string, you're looking at a regular > expression. Read up on them here: > > http://www.php.net/manual/en/pcre.pattern.syntax.php > > Yep, that's a lot of reading. But you should learn about regular > expressions; they'll be useful all over the place. If you happen to be > on a Linux/Unix/BSD/whatever machine that has man pages and perl > installed, check out `man perlre`. Or read on-line here: > > http://www.perldoc.com/perl5.6.1/pod/perlre.html > > Some things to watch out for -- even if you do want to remove quotes > from your attributes, I'm 100% sure you don't want to remove from *all* > of them. Like this: > > <img src="/some/image/" title="this is a pop-up description" /> > > Removing the quotes from the title attribute will likely break at least > some browsers, if not all. So your regular expression needs to be able > to handle that gracefully. > > Good luck! > > -- > [ joel boonstra | jboonstragospelcom.net ] >

    attached mail follows:


    hi mate , i sorter just need a regular expression only when loading it , i use tidy to reformat it back to go into the database its how it handles tags, can anyone help ?

    -----Original Message----- From: Justin French [mailto:justinindent.com.au] Sent: Thursday, August 01, 2002 11:59 AM To: electroteque; Joel Boonstra; php-generallists.php.net Subject: Re: [PHP] RE: stripping quotes from urls and images

    I'm reminded of a reasonable quote:

    "It's easy to write HTML, and impossible to parse it" Because HTML is *SO* easy to write, and has so many options, and is easy to screw up AND have browsers still work, it's totally evil to parse.

    You end up with massive regular expressions, or a state engine which reads the string one character at a time, and can keep track of what's going on, then make changes.

    I've been working on a state engine for a while, with some success.

    Basically, a browser is just a big state engine.

    I think you should perhaps look at your problem from another angle... there are MANY valid ways to write HTML tags... whatever your system does, it should support user preferences.

    <A HREF=foo.php> = valid <A HREF="foo.php"> = valid <A HREF='foo.php'> = valid

    Plus combinations of single and double quotes for different attributes, etc etc.

    Check out http://www.w3.org/TR/1999/REC-html401-19991224/intro/sgmltut.html

    Justin French

    on 01/08/02 10:43 AM, electroteque (danielelectroteque.org) wrote:

    > i sorter need a preg example i'm not very good at it , and its for a wysiwyg > dhtml editor , it reformats those tags if the quotes are there when i load > the content and stuffs the code > > -----Original Message----- > From: Joel Boonstra [mailto:jboonstragospelcom.net] > Sent: Thursday, August 01, 2002 6:18 AM > To: php-generallists.php.net > Cc: electroteque > Subject: Re: stripping quotes from urls and images > > >> hi guys i now have a problem with urls i need to remove the quotes from > both >> href="" and src="" >> >> so >> <a href="blah"> <img src=""> needs to be <a href=> <img src=> and i cant >> remove quotes from all string matches :| > > Someone mentioned this already, but you should really know that if you > remove quotes from your HTML attributes, your HTML will no longer be > forward-compatible with XHTML, which you really should strive for. What > reason would you have for removing the quotes? There must be a better > workaround than removing them. > > Regarding your question, it really depends on how you can operate on > your HTML. Where is your HTML? Is it in a database, string, etc? Is > it all in one chunk? That is, do you have stuff like this: > > <a href="some/url"><img src="some/image">This link has "quotes"</img></a> > > that can't just have all quotes removed entirely from it? If you really > need to remove quotes from attributes (and I don't think you do), and > all of your HTML is in one big string, you're looking at a regular > expression. Read up on them here: > > http://www.php.net/manual/en/pcre.pattern.syntax.php > > Yep, that's a lot of reading. But you should learn about regular > expressions; they'll be useful all over the place. If you happen to be > on a Linux/Unix/BSD/whatever machine that has man pages and perl > installed, check out `man perlre`. Or read on-line here: > > http://www.perldoc.com/perl5.6.1/pod/perlre.html > > Some things to watch out for -- even if you do want to remove quotes > from your attributes, I'm 100% sure you don't want to remove from *all* > of them. Like this: > > <img src="/some/image/" title="this is a pop-up description" /> > > Removing the quotes from the title attribute will likely break at least > some browsers, if not all. So your regular expression needs to be able > to handle that gracefully. > > Good luck! > > -- > [ joel boonstra | jboonstragospelcom.net ] >

    attached mail follows:


    PHPers, In a genaology application, where I add individuals to an array:

    $everyone[] = new Individual($id);

    I'd like to print the indiviuals' attributes. Some of these are in array's themselves: like a list of event's in one's life.

    My problem is: when printing the Class Variables using the "standard" approach: ========= function print_vars($obj) { $arr = get_object_vars($obj); while (list($prop, $val) = each($arr)) { echo "$prop\t$val\n"; } } ========= I see the message:

    Variables: Person: Added RELI attribute

    id I6 last McGOWAN first Martin James suffix Sr.

    sex M

    lifeevent Array attribute Array ========

    My question is: How does one print out the "Array"?

    My attempt at testing .

    (strcmp($val,"Array") == 0)

    was fruitless, as the print value of $var is always a string, but not always in other contexts.

    What am I missing?

    Thanks, -- Marty McGowan

    attached mail follows:


    [snip] My question is: How does one print out the "Array"? [/snip]

    Try print_r

    http://www.php.net/manual/en/function.print-r.php

    HTH!

    Jay

    I took a pain pill, why are you still here?

    *************************************** * * * Texas PHP Developers Meeting * * Spring 2003 * * T Bar M Resort & Conference Center * * New Braunfels, Texas * * Interested? Contact; * * jay.blanchardniicommunications.com * * * ***************************************

    attached mail follows:


    Use is_array() to see if it's an array. If it is, then loop through it and display the contents...

    ---John Holmes...

    ----- Original Message ----- From: "Marty McGowan" <marty3mcgowans.org> To: <php-generallists.php.net> Sent: Wednesday, July 31, 2002 4:15 PM Subject: [PHP] Printing a PHP Class

    > PHPers, > In a genaology application, where I add individuals to > an array: > > $everyone[] = new Individual($id); > > I'd like to print the indiviuals' attributes. Some of these are > in array's themselves: like a list of event's in one's life. > > My problem is: > when printing the Class Variables using the "standard" approach: > ========= > function print_vars($obj) { > $arr = get_object_vars($obj); > while (list($prop, $val) = each($arr)) > { > echo "$prop\t$val\n"; > } > } > ========= > I see the message: > > Variables: Person: Added RELI attribute > > id I6 > last McGOWAN > first Martin James > suffix Sr. > > sex M > > lifeevent Array > attribute Array > ======== > > My question is: > How does one print out the "Array"? > > My attempt at testing . > > (strcmp($val,"Array") == 0) > > was fruitless, as the print value of > $var is always a string, but not always > in other contexts. > > What am I missing? > > Thanks, > -- Marty McGowan > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    Maybe code will help...

    > My problem is: > when printing the Class Variables using the "standard" approach: > ========= > function print_vars($obj) { > $arr = get_object_vars($obj); > while (list($prop, $val) = each($arr)) > { > echo "$prop\t$val\n"; > } > } > =========

    Try this:

    function print_vars($obj) { $arr = get_object_vars($obj); while (list($prop, $val) = each($arr)) { if(is_array($val)) { echo "$prop\t" . implode(",",$val) . "\n"; } else { echo "$prop\t$val\n"; } } }

    ---John Holmes...

    attached mail follows:


    Also, you could use print_r($obj); to look at everything in the class, with arrays already expanded for you.

    http://www.php.net/manual/en/function.print-r.php

    jerome

    >From: Marty McGowan <marty3mcgowans.org> > >PHPers, > In a genaology application, where I add individuals to >an array: > > $everyone[] = new Individual($id); > >I'd like to print the indiviuals' attributes. Some of these are >in array's themselves: like a list of event's in one's life. > >My problem is: >when printing the Class Variables using the "standard" approach: >========= >function print_vars($obj) { > $arr = get_object_vars($obj); > while (list($prop, $val) = each($arr)) > { > echo "$prop\t$val\n"; > } >} >========= >I see the message: > > Variables: Person: Added RELI attribute > >id I6 >last McGOWAN >first Martin James >suffix Sr. > >sex M > >lifeevent Array >attribute Array >======== > > My question is: > How does one print out the "Array"? > > My attempt at testing . > > (strcmp($val,"Array") == 0) > > was fruitless, as the print value of > $var is always a string, but not always > in other contexts. > > What am I missing? > >Thanks, > -- Marty McGowan > > > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php

    _________________________________________________________________ Join the world’s largest e-mail service with MSN Hotmail. http://www.hotmail.com

    attached mail follows:


    Sorry to bother you.

    That actually was my mistake. I was looking too hard elsewhere; it happens.

    Thank you Joseph.

    alex

    Jason Wong wrote:

    > On Tuesday 30 July 2002 04:47, Joseph Rosenblum wrote: > > Do you know you have a typo in that conditional there? Was that your > > real code? You misspelled 'else' as 'esle'. > > (To OP): If you're going to post code that you want someone to debug, please > copy & paste. Introducing spurious typos wastes everybody's time. > > -- > Jason Wong -> Gremlins Associates -> www.gremlins.com.hk > Open Source Software Systems Integrators > * Web Design & Hosting * Internet & Intranet Applications Development * > > /* > CHUBBY CHECKER just had a CHICKEN SANDWICH in downtown DULUTH! > */

    attached mail follows:


    I got it fixed, thanks again. Just in case anyone else needs help with this type of item look at readdir() at http://www.php.net Jas

    "Jason Wong" <php-generalgremlins.com.hk> wrote in message news:200208010411.06801.php-generalgremlins.com.hk... > On Thursday 01 August 2002 03:00, Jas wrote: > > Not sure why this isn't working, any help is appreciated. I am trying to > > read the files in a directory and place them into an array. Here is the > > code: > > > > /* Function to create array of directory contents */ > > function dCNTS($files) { > > $dir = opendir("/path/to/directory/"); > > while($imgs = readdir($dir)) { > > if (($imgs != ".") && ($imgs != "..")) { > > $cnt[count($imgs)] = $cnt; > > } else { > > print "Cannot create array of files in directory!"; } > > } > > closedir($dir); > > } > > HOW isn't it working? > > -- > Jason Wong -> Gremlins Associates -> www.gremlins.com.hk > Open Source Software Systems Integrators > * Web Design & Hosting * Internet & Intranet Applications Development * > > /* > One person's error is another person's data. > */ >

    attached mail follows:


    ----- Original Message ----- From: "Kevin Stone" <kevinhelpelf.com> To: "php-generallists.php.net" <'php-generallists.php.net'> Sent: Wednesday, July 31, 2002 3:03 PM Subject: Fw: [PHP] dir to array? - SOLVED

    > *LOL* I was just about to post an answer for you but it looks like you got > it figured out. Since I hate to waste the post here you go.. for what it's > worth anyway. :) > -Kevin > ------------------------------ > > I would recommend reading up on readdir() function. There are some good > examples in there. Also you might want to browse the manual for some > examples. > > http://www.php.net/manual/en/function.readdir.php > > // dircont (string [directory path]) > // Returns Array of filenames in the given directory. > // Returns FALSE on error. > function dircont($path) > { > $dir_array = array(); > if (false !== ($dir = opendir($path))) > { > while (false !== ($file = readdir($dir))) > { > if ($file != '.' && $file != '..') > { > $dir_array[] = $file; > } > } > return $dir_array; > } > else > { > return false; > } > } > > // To print.. > $path = "/home/helpelf/helpelf-www/"; > echo "<pre>"; > print_r(dircont($path)); > echo "</pre>"; > > -Kevin > > > ----- Original Message ----- > From: "Jas" <jlgerfenhotmail.com> > To: <php-generallists.php.net> > Sent: Wednesday, July 31, 2002 2:22 PM > Subject: Re: [PHP] dir to array? - SOLVED > > > > I got it fixed, thanks again. Just in case anyone else needs help with > this > > type of item look at readdir() at http://www.php.net > > Jas > > > > "Jason Wong" <php-generalgremlins.com.hk> wrote in message > > news:200208010411.06801.php-generalgremlins.com.hk... > > > On Thursday 01 August 2002 03:00, Jas wrote: > > > > Not sure why this isn't working, any help is appreciated. I am trying > > to > > > > read the files in a directory and place them into an array. Here is > the > > > > code: > > > > > > > > /* Function to create array of directory contents */ > > > > function dCNTS($files) { > > > > $dir = opendir("/path/to/directory/"); > > > > while($imgs = readdir($dir)) { > > > > if (($imgs != ".") && ($imgs != "..")) { > > > > $cnt[count($imgs)] = $cnt; > > > > } else { > > > > print "Cannot create array of files in directory!"; } > > > > } > > > > closedir($dir); > > > > } > > > > > > HOW isn't it working? > > > > > > -- > > > Jason Wong -> Gremlins Associates -> www.gremlins.com.hk > > > Open Source Software Systems Integrators > > > * Web Design & Hosting * Internet & Intranet Applications Development * > > > > > > /* > > > One person's error is another person's data. > > > */ > > > > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > >

    attached mail follows:


    Ok, I admit, I am relatively new to PHP.

    But I have some good ideas of what I want to do, and I have a client who wants to have a portal for his LANParty Site, and I am working on that, somewhat successfully. I am trying to use PHP-Nuke, but it won't load on his FreeBSD server. Any ideas?

    I also want to do a signup form for his site so when people join the "community" forum, they will automatically be given an email username and password for his site.

    Any help would be very greatful.

    Thanks, Kevin Myrick www.ultimatealchemy.com

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

    attached mail follows:


    -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1

    * and then Kevin Myrick declared.... > I also want to do a signup form for his site so when > people join the "community" forum, they will > automatically be given an email username and password > for his site. > > Any help would be very greatful.

    I think you'll need to start from the beggining and post specific problems. That's a bit vague to get a decent answer.... Also, we don't even know how the system works: Does he have the ability to create unlimited emails? The permissions to do that? etc etc....

    - -- Nick Wilson // www.tioka.com

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

    iD8DBQE9SExIHpvrrTa6L5oRAvbUAJ9RrBB3Y8l2/YaRRp1sM//Ytw6PgACdEWHs e4HrmAsobSyYYiWXDacMq78= =Fjao -----END PGP SIGNATURE-----

    attached mail follows:


    Specific problems? Ok, I think I can do something about that...

    I am not sure how many emails he can handle, but I am pretty sure he can create as many as he wants. Basically unlimited accounts. I am pretty sure that the permissions would be aimacable to do that, as in 755 permissions on his server.

    I also can tell you he uses neomail to run his web based email services. Anything else at this time, I couldn't tell you.

    So my specific problem is this: How do I create a new user account on a *NIX system to have permissions to send and receive email, for a web based email system.

    BTW, I don't declare. I demand. ;)

    Kevin Myrick www.ultimatealchemy.com --- Nick Wilson <nicktioka.com> wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > > * and then Kevin Myrick declared.... > > I also want to do a signup form for his site so > when > > people join the "community" forum, they will > > automatically be given an email username and > password > > for his site. > > > > Any help would be very greatful. > > I think you'll need to start from the beggining and > post specific > problems. That's a bit vague to get a decent > answer.... Also, we don't > even know how the system works: Does he have the > ability to create > unlimited emails? The permissions to do that? etc > etc.... > > - -- > Nick Wilson // www.tioka.com > > > > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.0.6 (GNU/Linux) > > iD8DBQE9SExIHpvrrTa6L5oRAvbUAJ9RrBB3Y8l2/YaRRp1sM//Ytw6PgACdEWHs > e4HrmAsobSyYYiWXDacMq78= > =Fjao > -----END PGP SIGNATURE----- > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

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

    attached mail follows:


    > So my specific problem is this: How do I create a new > user account on a *NIX system to have permissions to > send and receive email, for a web based email system.

    In theory, and in my case, I couldn't have PHP do this because PHP is running on apache with the user status of nobody. So here is my long-winded solution:

    User requests e-mail account to be created. PHP inserts their name into a text file (or db, doesn't matter). I compiled command line php (./configure without the --with-apache). I setup command line php to run a php script through cron with root permissions every 5 mins. The php script moves the text file to a temporary location (so that I don't have people added to it as I am reading it) and then the php script parses through the usernames and passwords in the text file and issues system() commands to create the users. It is not the most secure solution but there are some ways to secure it through data validation.

    Does that make sense?

    Hope so, Nathan Cook

    attached mail follows:


    -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1

    * and then Kevin Myrick declared.... > So my specific problem is this: How do I create a new > user account on a *NIX system to have permissions to > send and receive email, for a web based email system.

    I think you'd need to take a look at the exec() function but there are better qualified people here to answer that kind of question... anyone?

    > BTW, I don't declare. I demand. ;)

    hehe, right! - -- Nick Wilson // www.explodingnet.com

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

    iD8DBQE9SFlPHpvrrTa6L5oRApFxAKCIq0inSFizDKLdxiZzx+3CImb++QCfafuC fZ7mSekTqM90J2Qfj0Oh0TA= =3rrA -----END PGP SIGNATURE-----

    attached mail follows:


    Thanks man

    Kevin Myrick www.ultimatealchemy.com --- Nick Wilson <nickexplodingnet.com> wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > > * and then Kevin Myrick declared.... > > So my specific problem is this: How do I create a > new > > user account on a *NIX system to have permissions > to > > send and receive email, for a web based email > system. > > I think you'd need to take a look at the exec() > function but there are > better qualified people here to answer that kind of > question... anyone? > > > BTW, I don't declare. I demand. ;) > > hehe, right! > - -- > Nick Wilson // www.explodingnet.com > > > > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.0.6 (GNU/Linux) > > iD8DBQE9SFlPHpvrrTa6L5oRApFxAKCIq0inSFizDKLdxiZzx+3CImb++QCfafuC > fZ7mSekTqM90J2Qfj0Oh0TA= > =3rrA > -----END PGP SIGNATURE----- > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

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

    attached mail follows:


    -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1

    Hi everyone,

    I break out in a cold sweat just thinking about regex, so I thought I'd ask you if there was an easier way to do this:

    I want to look through all of the files in a directory and extract a certain variable from each.

    This is to create a dynamic menu of the directory: The files are php scripts that assign $title (among others) to Smarty templates.

    I need to get $title from each file

    I had a look through the docs and didn't see anything obvious, which is why I'm here :-)

    Many thanks... - -- Nick Wilson // www.tioka.com

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

    iD8DBQE9SEtnHpvrrTa6L5oRAuVyAJ4j4jfC4nKKni3S6V5xsmZH2xhPDQCdF7wA Y0vShZPQ1n5qZE48LIhCVyA= =DLPZ -----END PGP SIGNATURE-----

    attached mail follows:


    Could somebody help me with this?.....I posted yesterday with only one reply...please read the following and let me know where I'm going wrong. THANKS!!!

    -Kirk

    BEGIN MESSAGE

    > > Yes, I configured apache with mod_so enabled and the > module is there. Still crashes on make. > >-Kirk

    You chose to compile PHP as a DSO this requires apache to have the mod_so module, you can check this by doing a httpd -l in your apache's bin directory. > I'm attempting to compile php 4.2.2 and apache 2.0.39 (both of which I > downloaded today) on mandrake 8.1. I've followed the generic > unix directions on php.net and at these steps > > $root> ./configure --with-mysql --with-apxs2=/www/bin/apxs > > followed by > > $root> make > > the process crashes with errors at the end of the make: > > -DTHREAD=1 -g -O2 -pthread -DZTS -prefer-pic -c php_functions.c > php_functions.c:93:27: missing binary operator before '!' > make[3]: *** [php_functions.lo] Error 1 > make[3]: Leaving directory `/usr/local/php-4.2.2/sapi/apache2filter' > make[2]: *** [all-recursive] Error 1 > make[2]: Leaving directory `/usr/local/php-4.2.2/sapi/apache2filter' > make[1]: *** [all-recursive] Error 1 > make[1]: Leaving directory `/usr/local/php-4.2.2/sapi' > make: *** [all-recursive] Error 1 > > Can somebody point out what I need to do to correct this? It doesn't make > sense that the code I downloaded from php.net would have a problem since > that's a stable release. > > TIA! > > -Kirk > > -- > K.B. BABB > email: babbk10comcast.net > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    -Pushkar S. Pradhan

    attached mail follows:


    Use apache 1.3.26 and it'll work. Just change the configure line: ./configure --with-mysql --with-apxs=/path/to/apxs

    Apache 2 is troublesome.

    tyler

    On Wed, 31 Jul 2002 17:27:30 -0500 "Kirk Babb" <kbcdworldnet.att.net> wrote:

    > Could somebody help me with this?.....I posted yesterday with only one > reply...please read the following and let me know where I'm going > wrong. THANKS!!! > > -Kirk > > BEGIN MESSAGE > > > > > Yes, I configured apache with mod_so enabled and the > > module is there. Still crashes on make. > > > >-Kirk > > You chose to compile PHP as a DSO this requires apache to have the > mod_so module, you can check this by doing a > httpd -l in your apache's bin directory. > > I'm attempting to compile php 4.2.2 and apache 2.0.39 (both of which > > I downloaded today) on mandrake 8.1. I've followed the generic > > unix directions on php.net and at these steps > > > > $root> ./configure --with-mysql --with-apxs2=/www/bin/apxs > > > > followed by > > > > $root> make > > > > the process crashes with errors at the end of the make: > > > > -DTHREAD=1 -g -O2 -pthread -DZTS -prefer-pic -c php_functions.c > > php_functions.c:93:27: missing binary operator before '!' > > make[3]: *** [php_functions.lo] Error 1 > > make[3]: Leaving directory `/usr/local/php-4.2.2/sapi/apache2filter' > > make[2]: *** [all-recursive] Error 1 > > make[2]: Leaving directory `/usr/local/php-4.2.2/sapi/apache2filter' > > make[1]: *** [all-recursive] Error 1 > > make[1]: Leaving directory `/usr/local/php-4.2.2/sapi' > > make: *** [all-recursive] Error 1 > > > > Can somebody point out what I need to do to correct this? It > > doesn't make sense that the code I downloaded from php.net would > > have a problem since that's a stable release. > > > > TIA! > > > > -Kirk > > > > -- > > K.B. BABB > > email: babbk10comcast.net > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > -Pushkar S. Pradhan > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    Thanks, Tyler, I will if I have to, but is there someone out there who has done this on Linux?

    cheers

    Kirk

    "Tyler Longren" <tylercaptainjack.com> wrote in message news:20020731173507.7781ab8b.tylercaptainjack.com... > Use apache 1.3.26 and it'll work. Just change the configure line: > ./configure --with-mysql --with-apxs=/path/to/apxs > > Apache 2 is troublesome. > > tyler > > On Wed, 31 Jul 2002 17:27:30 -0500 > "Kirk Babb" <kbcdworldnet.att.net> wrote: > > > Could somebody help me with this?.....I posted yesterday with only one > > reply...please read the following and let me know where I'm going > > wrong. THANKS!!! > > > > -Kirk > > > > BEGIN MESSAGE > > > > > > > > Yes, I configured apache with mod_so enabled and the > > > module is there. Still crashes on make. > > > > > >-Kirk > > > > You chose to compile PHP as a DSO this requires apache to have the > > mod_so module, you can check this by doing a > > httpd -l in your apache's bin directory. > > > I'm attempting to compile php 4.2.2 and apache 2.0.39 (both of which > > > I downloaded today) on mandrake 8.1. I've followed the generic > > > unix directions on php.net and at these steps > > > > > > $root> ./configure --with-mysql --with-apxs2=/www/bin/apxs > > > > > > followed by > > > > > > $root> make > > > > > > the process crashes with errors at the end of the make: > > > > > > -DTHREAD=1 -g -O2 -pthread -DZTS -prefer-pic -c php_functions.c > > > php_functions.c:93:27: missing binary operator before '!' > > > make[3]: *** [php_functions.lo] Error 1 > > > make[3]: Leaving directory `/usr/local/php-4.2.2/sapi/apache2filter' > > > make[2]: *** [all-recursive] Error 1 > > > make[2]: Leaving directory `/usr/local/php-4.2.2/sapi/apache2filter' > > > make[1]: *** [all-recursive] Error 1 > > > make[1]: Leaving directory `/usr/local/php-4.2.2/sapi' > > > make: *** [all-recursive] Error 1 > > > > > > Can somebody point out what I need to do to correct this? It > > > doesn't make sense that the code I downloaded from php.net would > > > have a problem since that's a stable release. > > > > > > TIA! > > > > > > -Kirk > > > > > > -- > > > K.B. BABB > > > email: babbk10comcast.net > > > > > > -- > > > PHP General Mailing List (http://www.php.net/) > > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > -Pushkar S. Pradhan > > > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > >

    attached mail follows:


    I deal with student machines that I do not own. I have to work with what's in front of me. Unfortunately. The activation script for 10.2 on entropy.ch did the trick by the way.

    I also need to change register_globals from off to on in version 4.2.2. Any help on how to do that with the PHP module on OS X. I'm a rookie with this stuff.

    On Wednesday, July 31, 2002, at 03:31 PM, Brandon Pearcy wrote:

    > What seems to be the problem? How far did you get before you realized > it wasn't working? > > I have upgraded to Mac OS X 10.1.5, and so should you. There is no > reason to stick with 10.1.4, is there? > >> I'm having difficulty getting PHP activated on Mac OS X 10.1.4. I'm >> using the activation script from Marc Liyanage's page at >> http://www.entropy.ch. If anyone has any advise or can help me trouble >> shoot please let me know. >> >> Thanks, >> Robert Contursi Hendriks Institute 5500 Brush Hollow Road Westbury, NY 11590 516.338.5400 > > > -- -------------------------- > Brandon Pearcy > Internet Technician > > Bowes Online > -------------------------- > phone: 1-780-532-1110 ext. 265 > fax: 1-780-532-2120 > bpearcybowesnet.com >

    attached mail follows:


    Hello.

    Say me pls, are there method to enable DBM support in loaded Windows binaries of PHP 4.2.1?

    I have "Fatal error: Call to undefined function: dbmopen() in ..." my .php file... :((

    Nashev (nashevmail.ru)

    attached mail follows:


    Looked in the archive and manual and came up with no luck, so here it goes.

    My end result is to save the output of a PHP script as an HTML file in a specified directory on a WIN2K server.

    my script is such... <? PHP function save_archive(){ $filename = "http://myserver.net/extranet/archive.php?jobid=1"; $fd = fopen( $filename, "r" ); $fd2 = fopen("myserver.net/extranet/test2.html">ftp://me:pwmyserver.net/extranet/test2.html", "w");

    while (!feof($fd)) { $line = fgets($fd, 1024); fputs($fd2,$line); }

    fclose($fd); fclose($fd2); } ?>

    I'm having a terrible time getting this to work. Is there a better way? Or can someone point me toward or post an example of some working function I could study???

    Thanks so much my friends! - NorhthBayShane

    attached mail follows:


    Question.....

    I have a problem with forms not been cached when they click submit... And then the back button, I know of some fields that can not be cached (password),

    I am thinking I am not doing something that asks it to cache..

    Anyone have any tips or a place to start looking.....

    Thanks in advance

    --------------------------------------------------------------------------- Chris Kay Technical Support - Techex Communications Website: www.techex.com.au Email: chris.kaytechex.net.au Telephone: 1300 88 111 2 - Fax: (02) 9970 5788 Address: Suite 13, 5 Vuko Place, Warriewood, NSW 2102 Platinum Channel Partner of the Year - Request DSL - Broadband for Business ---------------------------------------------------------------------------

    attached mail follows:


    Tomasz Zolnierczyk wrote: > > subscribe tomekquarknet.com > > ===== > Tomasz Zolnierczyk > > "The Path Of Excess Leads To The Tower Of Wisdom" > - W. Blake > > __________________________________________________ > Do You Yahoo!? > Send instant messages & get email alerts with Yahoo! Messenger. > http://im.yahoo.com/

    -- 
    Can marketing and reality really coexist ?
    

    attached mail follows:


    I'm having provblems with the following script...

    mail("danradom.org", "www form submission", $message, "From: $email");

    ...the variables are being POSTed from a form, which does make it to sendmail. sendmail logs the following...

    Jul 31 19:32:47 mars sendmail[20605]: g711Wlu20605: from=nobody, size=81, class=0, nrcpts=0, msgid=<200208010132.g711Wlu20605mars.radom.org>, relay=nobodylocalhost

    the nrcpts=0 is obviously a concern here. This sendmail does handle mail for a few domains and does accept mail for localhost. Any ideas where I've gone wrong? All this was wokring with php 4.2.1 until a hard drive died. I rebuild the machine and installed php 4.2.2 and this is where I'm at. I'm using the same sendmail configuration.

    dan

    attached mail follows:


    Hello,

    On 07/31/2002 10:47 PM, Dan Radom wrote: > I'm having provblems with the following script... > > mail("danradom.org", "www form submission", $message, "From: $email"); > > ...the variables are being POSTed from a form, which does make it to sendmail. sendmail logs the following... > > Jul 31 19:32:47 mars sendmail[20605]: g711Wlu20605: from=nobody, size=81, class=0, nrcpts=0, msgid=<200208010132.g711Wlu20605mars.radom.org>, relay=nobodylocalhost > > > the nrcpts=0 is obviously a concern here. This sendmail does handle mail for a few domains and does accept mail for localhost. Any ideas where I've gone wrong? All this was wokring with php 4.2.1 until a hard drive died. I rebuild the machine and installed php 4.2.2 and this is where I'm at. I'm using the same sendmail configuration.

    Try setting mail() 5th argument to "-f$email".

    -- 
    

    Regards, Manuel Lemos

    attached mail follows:


    nope. all that did was prodice the following warning... Jul 31 20:53:47 mars sendmail[20790]: g712rkA20790: Authentication-Warning: mars.radom.org: nobody set sender to foobar.net using -f

    dan

    * Manuel Lemos (mlemosacm.org) wrote: > Hello, > > On 07/31/2002 10:47 PM, Dan Radom wrote: > >I'm having provblems with the following script... > > > >mail("danradom.org", "www form submission", $message, "From: $email"); > > > >...the variables are being POSTed from a form, which does make it to > >sendmail. sendmail logs the following... > > > >Jul 31 19:32:47 mars sendmail[20605]: g711Wlu20605: from=nobody, size=81, > >class=0, nrcpts=0, msgid=<200208010132.g711Wlu20605mars.radom.org>, > >relay=nobodylocalhost > > > > > >the nrcpts=0 is obviously a concern here. This sendmail does handle mail > >for a few domains and does accept mail for localhost. Any ideas where > >I've gone wrong? All this was wokring with php 4.2.1 until a hard drive > >died. I rebuild the machine and installed php 4.2.2 and this is where I'm > >at. I'm using the same sendmail configuration. > > Try setting mail() 5th argument to "-f$email". > > > -- > > Regards, > Manuel Lemos > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php

    attached mail follows:


    Hello,

    On 07/31/2002 11:55 PM, Dan Radom wrote: > nope. all that did was prodice the following warning... Jul 31 20:53:47 mars sendmail[20790]: g712rkA20790: Authentication-Warning: mars.radom.org: nobody set sender to foobar.net using -f

    Are you sure the message is not stuck in the mail queue for some reason? Did you do mailq to see if it is still there?

    If it isn't and it bounced it should have gone to that $email address. If you set to foobar.net, you will not see the bounced message and will probably miss the reason why it bounced.

    > * Manuel Lemos (mlemosacm.org) wrote: > >>Hello, >> >>On 07/31/2002 10:47 PM, Dan Radom wrote: >> >>>I'm having provblems with the following script... >>> >>>mail("danradom.org", "www form submission", $message, "From: $email"); >>> >>>...the variables are being POSTed from a form, which does make it to >>>sendmail. sendmail logs the following... >>> >>>Jul 31 19:32:47 mars sendmail[20605]: g711Wlu20605: from=nobody, size=81, >>>class=0, nrcpts=0, msgid=<200208010132.g711Wlu20605mars.radom.org>, >>>relay=nobodylocalhost >>> >>> >>>the nrcpts=0 is obviously a concern here. This sendmail does handle mail >>>for a few domains and does accept mail for localhost. Any ideas where >>>I've gone wrong? All this was wokring with php 4.2.1 until a hard drive >>>died. I rebuild the machine and installed php 4.2.2 and this is where I'm >>>at. I'm using the same sendmail configuration. >> >>Try setting mail() 5th argument to "-f$email".

    -- 
    

    Regards, Manuel Lemos

    attached mail follows:


    attached mail follows:


    Hello,

    I have just recompile and reinstall these sources code package... But I found I need to add these line into httpd.conf :

    AddType application/x-httpd-php .php .php3 AddType application/x-httpd-php-source .phps

    Must I add these line into httpd.conf under apache 1.3.22 ? Why can't I uncomment these line ?

    then the php ( create a php with <?phpinfo()?> will good for work with apache !

    And the https protocol can't for work with apache :

    Is here any mistake about my installation steps :

    1, cd gettext-0.10.40 ./configure make make check make install

    2, cd ../openssl-0.9.6d ./config make

    3, cd ../mod_ssl-2.8.10-1.3.26 ./configure --with-apache=../apache_1.3.26 --with-ssl=../openssl-0.9.6d

    4, cd ../apache_1.3.26 ./configure \ --enable-module=most --enable-shared=max --enable-module=ssl --enable-shared=ssl --enable-module=rewrite --enable-shared=rewrite --disable-module=auth_dbm make make certificate TYPE=custom make install

    5, cd ../php-4.2.2 ./configure \ --with-apxs=/usr/local/apache/bin/apxs \ --with-config-file-path=/usr/local/apache/conf \ --enable-versioning --with-imap --with-imap-ssl \ --with-ldap --with-mysql --enable-ftp \ --with-gettext --enable-memory-limit=yes \ --enable-track-vars --with-kerberos make make install

    cp /usr/local/src/php-4.2.2/php.ini-dist /usr/local/apache/conf/php.ini

    Thank for your help !

    Edward.

    attached mail follows:


    As I assume most of you know, mod_speling (sic) is a feature of the Apache httpd that will suggest possible corrections to URLs.

    i.e. if you look for /sidebar/ on my site you'll get a 404 because the actual URL is /sidebars/

    The problem is that some sites don't enable mod_speling and some don't use Apache ;-)

    Before I reinvent the wheel, I thought I'd ask if anyone had written some PHP to cover this... I didn't find anything useful in Google or HotScripts

    TjL

    attached mail follows:


    How about a file wilh all the directories and you compare its contents using similar_text() or soundex/metaphone() with the url/directory that failed?

    Shouldn't be too hard to implement.

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

    "Tim Luoma" <luomatpeak.org> escreveu na mensagem news:3D489898.1010204peak.org... > > As I assume most of you know, mod_speling (sic) is a feature of the > Apache httpd that will suggest possible corrections to URLs. > > i.e. if you look for /sidebar/ on my site you'll get a 404 because the > actual URL is /sidebars/ > > The problem is that some sites don't enable mod_speling and some don't > use Apache ;-) > > Before I reinvent the wheel, I thought I'd ask if anyone had written > some PHP to cover this... I didn't find anything useful in Google or > HotScripts > > TjL > >

    attached mail follows:


    Hi all!

    I know this is not the first (and will definitely not be the last) time this question is asked here, but since I was unable to Google anything out on the topic, does anyone know of any kind of iCalendar support for PHP? I'd much prefer a class to a module because I'm working on a project that's being distributed under GPL (and most people won't recompile/upgrade just to get this part of the project working), but any kind of pointers are welcome.

    In case nobody knows about any cool iCalendar implementation, I'll start to think very seriously about working on an iCalendar library (as a PHP class) mainly for the project I'm working on, but obviously also released as LGPL. So if anyone's interested in that, drop me an e-mail.

    TIA

    Bogdan

    -- 
    

    Mail scanat cu RAV Antivirus!

    attached mail follows:


    x86-3 being added to access control list I've recently updgrade my Apache Webserver to 1.3.26 and opted to upgrade php form 3.x.x to 4.2.2. I have succesfully built it all and things are stable.

    I have been running the "album" picture database which is included as an example with the php3 distro.

    Well this is now broken with php4. What apears to be happening is the query string is not being processed. For example if I have the simple phpscript test2.php which looks like: <? $url=parse_url($_SERVER["REQUEST_URI"]); echo "<H1>QUERY_STRING= $url[query]</H1>"; $url[query]; echo "<H1>Album= $album</H1>"; ?>

    and call this with something like

    http://foo.bar.com/test2.php?album=sunsets

    It echoes out the query string but the variable album remains unset.

    This same script works just fine if accessed against my php3 enabled apache server.

    Can anybody explain why this is happening? Did I miss some configuration somewhere.

    Oh yeah, this is all on Solaris.

    Rgds,

    Bruce Riddle

    -- 
    Can marketing and reality really coexist ?
    

    attached mail follows:


    Since 4.1.? the way things worked changed... Instead of using $album you need to use $_GET['album'] you can default back the old behaviour with a php.ini change, but the new way is prefered

    andrew ----- Original Message ----- From: "Bruce Riddle" <briddleriddleware.com> To: <php-generallists.php.net> Sent: Thursday, August 01, 2002 4:20 AM Subject: [PHP] php3 to php4 migration woes

    > x86-3 being added to access control list > I've recently updgrade my Apache Webserver to > 1.3.26 and opted to upgrade php form 3.x.x to 4.2.2. > I have succesfully built it all and things are stable. > > I have been running the "album" picture database which > is included as an example with the php3 distro. > > Well this is now broken with php4. > What apears to be happening is the query string > is not being processed. > For example if I have the simple phpscript > test2.php which looks like: > <? > $url=parse_url($_SERVER["REQUEST_URI"]); > echo "<H1>QUERY_STRING= $url[query]</H1>"; > $url[query]; > echo "<H1>Album= $album</H1>"; > ?> > > and call this with something like > > http://foo.bar.com/test2.php?album=sunsets > > It echoes out the query string but the > variable album remains unset. > > This same script works just fine if accessed > against my php3 enabled apache server. > > Can anybody explain why this is happening? > Did I miss some configuration somewhere. > > Oh yeah, this is all on Solaris. > > Rgds, > > Bruce Riddle > > -- > Can marketing and reality really coexist ? > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >

    attached mail follows:


    Hey php-general,

    maybe somebody can explain me what happens in this line? because how mutch i read it..thought i don't get it :)

    list ($date, $laik) = split (' ', $row['time'], 2);

    -- 
    Best regards,
     Mantas                          
    

    Contacts: Mantuksattbi.com

    attached mail follows:


    Split() chops up the string (param #2) according to param #1 (in this case, space is the delimiter). Param #3 says, don't chop more than two bits. It then returns an array

    list() assigns $arr[0] to the first variable, $arr[1] to the second, etc.

    HTH Martin

    -----Original Message----- From: Mantas Kriauciunas [mailto:Mantuksattbi.com] Sent: Wednesday, July 31, 2002 5:45 PM To: php-generallists.php.net Subject: [PHP] Explain?

    Hey php-general,

    maybe somebody can explain me what happens in this line? because how mutch i read it..thought i don't get it :)

    list ($date, $laik) = split (' ', $row['time'], 2);

    -- 
    Best regards,
     Mantas                          
    

    Contacts: Mantuksattbi.com

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