OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
From: php-general-digest-helplists.php.net
Date: Fri May 31 2002 - 17:20:25 CDT

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

    php-general Digest 31 May 2002 22:20:25 -0000 Issue 1378

    Topics (messages 100073 through 100183):

    Re: how to detect if the client's browser accepts cookies ?
            100073 by: Ford, Mike [LSS]

    Re: mktime parameters (Was: Replacing Number with Month(new bie))
            100074 by: Jon Haworth

    Re: Cache Control
            100075 by: Jeroen Timmers
            100076 by: Jon Haworth

    Regular Expressions...
            100077 by: Brian McGarvie
            100089 by: Michael Sims

    Is PHP used by U.S. Government? By U.S. DoD?
            100078 by: John Christopher
            100081 by: John Holmes
            100088 by: Leotta, Natalie (NCI/IMS)
            100124 by: Philip Hallstrom
            100128 by: Miguel Cruz
            100142 by: syslog.org

    PHP-mysql: affected rows
            100079 by: Victor SpÃ¥ng Arthursson
            100083 by: John Holmes
            100094 by: Chris Hewitt

    Re: Replacing Number with Month(newbie)
            100080 by: John Holmes

    Run php function with user click
            100082 by: Dave Shacket
            100084 by: Michael Davey
            100130 by: Michael Sweeney
            100135 by: Miguel Cruz
            100140 by: Jay Blanchard
            100156 by: Jim lucas
            100160 by: Leotta, Natalie (NCI/IMS)
            100163 by: Jim lucas
            100166 by: Leotta, Natalie (NCI/IMS)

    Go to a different web page?
            100085 by: Dave Shacket
            100087 by: Justin French

    Standalone PHP Binaries?
            100086 by: Jonathan Rosenberg

    PHP can not connect to mysql
            100090 by: andy
            100093 by: Michael Davey
            100095 by: andy
            100097 by: James Holden
            100098 by: Michael Davey

    Make stand alone php with FastZTrack
            100091 by: Qingjuan Gu

    Re: Graphs using PHP
            100092 by: Leotta, Natalie (NCI/IMS)

    Re: Multiple queries
            100096 by: Analysis & Solutions

    Why does the mail() function hang ?!?
            100099 by: Phil Schwarzmann
            100100 by: Jay Blanchard

    apache2filter.dll
            100101 by: Herman Pool
            100103 by: Michael Davey
            100180 by: PHPGeek

    Class variables and scope
            100102 by: Michael Davey
            100105 by: Stuart Dallas
            100106 by: Michael Davey

    gd project question
            100104 by: Michael Geier
            100107 by: Michael Davey
            100121 by: Darren Gamble
            100137 by: Michael Geier
            100146 by: Miguel Cruz

    Form content type missing, how to fetch variables?
            100108 by: Simon Troup
            100144 by: Analysis & Solutions

    PHP Decisions and Issues
            100109 by: Justin Felker
            100131 by: Miguel Cruz
            100141 by: syslog.org
            100143 by: John Holmes

    MS SQL Problem
            100110 by: Justin Felker
            100113 by: Sqlcoders.com Programming Dept

    bzip/zlib question
            100111 by: Michael Davey
            100133 by: Miguel Cruz
            100139 by: Michael Davey

    Class/Objects
            100112 by: Gerard Samuel
            100115 by: Michael Davey
            100118 by: Gerard Samuel

    Newbie question : PHP variables are not posted by this
            100114 by: Frédérick St-Hilaire
            100116 by: Michael Davey
            100119 by: Stuart Dallas

    diplaying the path
            100117 by: Kris Vose
            100123 by: Michael Davey
            100127 by: Jim lucas
            100138 by: Philip Olson
            100157 by: Jim lucas

    Re: Undefined variables
            100120 by: Philip Olson
            100122 by: Darren Gamble

    Working with ip addresses and address space
            100125 by: Chris Knipe
            100136 by: Rasmus Lerdorf

    PHP URLs not opening from email in Outlook XP
            100126 by: Leotta, Natalie (NCI/IMS)
            100132 by: Jaime Bozza
            100134 by: Leotta, Natalie (NCI/IMS)

    <!----XML Parsing
            100129 by: Crane, Christopher

    Parsing file's
            100145 by: Scott
            100153 by: Michael Davey
            100161 by: Scott
            100168 by: Mark Heintz PHP Mailing Lists

    Re: SOLVED: [PHP] PHP URLs not opening from email in Outlook XP
            100147 by: Leotta, Natalie (NCI/IMS)

    Re: SQL question, getting error and not sure why
            100148 by: Michael Virnstein
            100149 by: Michael Virnstein

    php newbie question
            100150 by: Taylor Lewick

    is session.use_trans_sid dangerous?
            100151 by: Giancarlo

    php4 install with apache.org
            100152 by: Taylor Lewick

    php, javascript
            100154 by: Gerard Samuel
            100162 by: Michael Sweeney

    Running Setuid Programs fro PHP?
            100155 by: Jonathan Rosenberg
            100158 by: Jonathan Rosenberg

    Re: [PEAR] [HTML_Form] cant change values in array after getAll()
            100159 by: Peter TB Brett
            100164 by: Peter TB Brett

    new session policy
            100165 by: Giancarlo

    writting to files
            100167 by: Jas
            100173 by: Jason Wong

    Running a script to check something before submitting a form. Can this be done?
            100169 by: Don
            100171 by: Jason Wong
            100172 by: Jim lucas
            100176 by: Kevin Stone

    Writing Files (Unix, Apache, PHP 4.0.X) [Newbie Alert]
            100170 by: Jason Teagle

    Re: writing to files
            100174 by: Jonathan Rosenberg

    new session creation policy is trust user input ?
            100175 by: Giancarlo

    Speed comparison of PHP vs. PERL (not conclusive)
            100177 by: Daniel Grace
            100178 by: Daniel Grace
            100179 by: Rasmus Lerdorf
            100181 by: Ilia A.
            100182 by: Rasmus Lerdorf
            100183 by: Daniel Grace

    Administrivia:

    To subscribe to the digest, e-mail:
            php-general-digest-subscribelists.php.net

    To unsubscribe from the digest, e-mail:
            php-general-digest-unsubscribelists.php.net

    To post to the list, e-mail:
            php-generallists.php.net

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

    attached mail follows:


    > -----Original Message-----
    > From: David Eisenhart [mailto:daviderothe.freeserve.co.uk]
    > Sent: 31 May 2002 10:54
    >
    > I am writing a function to construct page links within my
    > site; I want it to
    > append the session id to the URL's query string if the client does not
    > accept cookies (and ignore the session id if the client does accept
    > cookies).
    >
    > How do I detect if the client browser accepts cookies?
    > Indeed, has anyone got such a function as described above?

    Yes -- and it's called PHP!

    The following is taken from the online manual page at http://www.php.net/manual/en/ref.session.php:

      The session module supports both methods. Cookies are optimal, but
      since they are not reliable (clients are not bound to accept them),
      we cannot rely on them. The second method embeds the session id
      directly into URLs.

      PHP is capable of doing this transparently when compiled with
      --enable-trans-sid. If you enable this option, relative URIs will be
      changed to contain the session id automatically. Alternatively, you
      can use the constant SID which is defined, if the client did not
      send the appropriate cookie. SID is either of the form
      session_name=session_id or is an empty string.

    Cheers!

    Mike

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

    attached mail follows:


    Hi Mike,

    > > > Is there a magical function that I can use to convert 4
    > > > into April and 5 into May etc?
    > > > can I use mktime()
    > > > One yes no answer will do fine
    > >
    > > Yes and no ;-)
    >
    > Ha! I was just about to say exactly that myself!

    It was just too tempting :-)

    > Except, to get just the month (and leaving out
    > optional arguments to mktime()), you would need:
    > date('F', mktime(12, 0, 0, $month));

    Hmm. I thought this should work as well. This morning, though, I had to fix
    a bug where a combo box was displaying something like

    "January"
    "March"
    "March"
    "April"
    "May"
    "May"

    ...

    The code was

    <select name="lm">
      <?php
        for ($i=1; $i<=12; $i++) {
          echo "<option value=\"". $i. "\"";
          echo ($i == $lm) ? " selected" : "";
          echo ">". date ("F", mktime (3, 0, 0, $i)). "</option>";
        }
      ?>
    </select>

    When I changed the mktime parameters to (3, 0, 0, $i, 1, 2002) it all worked
    fine.

    I think it's because it's the 31st today, and any months that don't have 31
    days were getting screwed up (wouldn't mind hearing any other ideas though).
    It seems like it's always a good idea to pass at least the day parameter to
    mktime(), unless you enjoy unpredictable results ;-)

    Cheers
    Jon

    attached mail follows:


    >Date: Fri, 31 May 2002 12:13:40 +0200
    >To: Jon Haworth <jhaworthwitanjardine.co.uk>
    >From: Jeroen Timmers <mailliststart4me.nl>
    >Subject: RE: [PHP] Cache Control
    >
    >I want info on the internet where i can find a manuel.
    >
    >I want a statement that de page always refresh
    >
    >the page is a php script and sometimes it comes out of a proxy but
    >that is not allowed.
    >
    >Thx Jeroen
    >
    >At 11:11 31-5-2002 +0100, you wrote:
    >
    >>Hi Jeroen,
    >> > > > Where i can find more help about cache control
    >> > >
    >> > > http://www.google.com/search?q=help+about+cache+control
    >> > > Or did you mean something a bit more specific?
    >> >
    >> > indeed
    >> > more specific
    >>
    >>Well, seeing as you're not sharing the actual question with the mailing
    >>list, this answer may not be exactly what you're after, but it's probably:
    >>
    >><meta http-equiv="Pragma" content="no-cache">
    >><meta http-equiv="Cache-Control" content="no-cache">
    >><meta http-equiv="Expires" content="<?=$a_GMT_date_in_the_past?>">
    >>
    >>;-)
    >>
    >>Cheers
    >>Jon
    >>
    >>--
    >>PHP General Mailing List (http://www.php.net/)
    >>To unsubscribe, visit: http://www.php.net/unsub.php

    attached mail follows:


    Hi Jeroen,

    > I want info on the internet where i can find a manuel.

    http://www.google.com/search?q=http+cache+control+headers

    > the page is a php script and sometimes it comes out of a proxy but
    > that is not allowed.

    It's not something you have absolute control over - some proxies are
    configured to ignore your caching instructions anyway.

    Cheers
    Jon

    PS. Please try and avoid using HTML mail on lists.

    attached mail follows:


    All,

    I have a text field that a user can enter text into, I then explode it
    into an array, and ultimatley build a regular expression such as:

    /(advance|racingx)|(advance|racingx)/i

    for use in:

    preg_match ($reg_expr, $file);

    however the expression above doesnot yeild the required result, it will
    match a string with any word, whereas i want to match strings with BOTH
    words present.

    example of the contents of $file that might pass is:

    advance_racingx_14_4_29.pdf

    another might be, which would not pass is:

    advance_fork10_3_4_11.pdf

    Thanks in advance for your help...

      Brian...

    attached mail follows:


    On Fri, 31 May 2002 12:32:29 +0100, you wrote:

    >example of the contents of $file that might pass is:
    >
    >advance_racingx_14_4_29.pdf
    >
    >another might be, which would not pass is:
    >
    >advance_fork10_3_4_11.pdf

    If you need it to be in that specific order, use the following:

    if(preg_match("/advance.*racingx/",$string)) {
      //do stuff
    }

    If the order doesn't matter, do this:

    if(preg_match("/advance/",$string) && preg_match("/racingx/",$string))
    {
      //do stuff
    }

    There may be some more efficient/elegant ways to do this, but the
    above should yield the results you are looking for.

    attached mail follows:


    I would like to use PHP in a project for a United States
    Government client. The client is skeptical because PHP
    is not a Microsoft product. I'm looking for statistics and
    links that show that PHP *is* currently in use by the
    US Government.

    Is PHP used by the U.S. Department of Defense? Examples?

    Is PHP a U.S. Military Standard?

    Any stats or links would be most helpful. Thank you.

    __________________________________________________
    Do You Yahoo!?
    Yahoo! - Official partner of 2002 FIFA World Cup
    http://fifaworldcup.yahoo.com

    attached mail follows:


    It's being used by me. :)

    It's not really accepted anywhere, but there are no regulations against
    using it. I looked into it a little bit before I started writing my
    current project. I don't know of any sites that are using it except for
    mine (and it's intranet only).

    ---John Holmes...

    > -----Original Message-----
    > From: John Christopher [mailto:john_christopher1997yahoo.com]
    > Sent: Friday, May 31, 2002 8:08 AM
    > To: php-generallists.php.net
    > Subject: [PHP] Is PHP used by U.S. Government? By U.S. DoD?
    >
    >
    > I would like to use PHP in a project for a United States
    > Government client. The client is skeptical because PHP
    > is not a Microsoft product. I'm looking for statistics and
    > links that show that PHP *is* currently in use by the
    > US Government.
    >
    > Is PHP used by the U.S. Department of Defense? Examples?
    >
    > Is PHP a U.S. Military Standard?
    >
    > Any stats or links would be most helpful. Thank you.
    >
    >
    > __________________________________________________
    > Do You Yahoo!?
    > Yahoo! - Official partner of 2002 FIFA World Cup
    > http://fifaworldcup.yahoo.com
    >
    > --
    > PHP General Mailing List (http://www.php.net/)
    > To unsubscribe, visit: http://www.php.net/unsub.php

    attached mail follows:


    My company contracts for the National Institutes of Health and the National
    Cancer Institute. A group of us are developing a website for State Cancer
    Profiles - ie, you want to see the trend of lung cancer in the Total US v.
    Kentucky kinds of things. All of the graphs that I'm working on are being
    developed dynamically using PHP.

    Unfortunately, the site isn't public yet, so I can't send you a link. We
    should be live sometime this summer. At that point in time it will be a
    link off of www.cancer.gov.

    Good luck! If you want any more information, I'll see what I can get you
    and your client. I know examples of the site have been shown to people on
    Capitol Hill, so it is possible I could send you the password for the test
    site. I'm not in a position to make those kinds of decisions :-)

    -Natalie

    -----Original Message-----
    From: John Holmes [mailto:holmes072000charter.net]
    Sent: Friday, May 31, 2002 8:55 AM
    To: 'John Christopher'; php-generallists.php.net
    Subject: RE: [PHP] Is PHP used by U.S. Government? By U.S. DoD?

    It's being used by me. :)

    It's not really accepted anywhere, but there are no regulations against
    using it. I looked into it a little bit before I started writing my current
    project. I don't know of any sites that are using it except for mine (and
    it's intranet only).

    ---John Holmes...

    > -----Original Message-----
    > From: John Christopher [mailto:john_christopher1997yahoo.com]
    > Sent: Friday, May 31, 2002 8:08 AM
    > To: php-generallists.php.net
    > Subject: [PHP] Is PHP used by U.S. Government? By U.S. DoD?
    >
    >
    > I would like to use PHP in a project for a United States Government
    > client. The client is skeptical because PHP is not a Microsoft
    > product. I'm looking for statistics and links that show that PHP *is*
    > currently in use by the US Government.
    >
    > Is PHP used by the U.S. Department of Defense? Examples?
    >
    > Is PHP a U.S. Military Standard?
    >
    > Any stats or links would be most helpful. Thank you.
    >
    >
    > __________________________________________________
    > Do You Yahoo!?
    > Yahoo! - Official partner of 2002 FIFA World Cup
    > http://fifaworldcup.yahoo.com
    >
    > --
    > PHP General Mailing List (http://www.php.net/)
    > To unsubscribe, visit: http://www.php.net/unsub.php

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

    attached mail follows:


    U.S. Naval Research Laboratory's Intranet relies on PHP

    http://www.zend.com/zend/cs/csnavalready.php

    On Fri, 31 May 2002, John Christopher wrote:

    > > I would like to use PHP in a project for a United States > Government client. The client is skeptical because PHP > is not a Microsoft product. I'm looking for statistics and > links that show that PHP *is* currently in use by the > US Government. > > Is PHP used by the U.S. Department of Defense? Examples? > > Is PHP a U.S. Military Standard? > > Any stats or links would be most helpful. Thank you. > > > __________________________________________________ > Do You Yahoo!? > Yahoo! - Official partner of 2002 FIFA World Cup > http://fifaworldcup.yahoo.com > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    On Fri, 31 May 2002, John Christopher wrote: > I would like to use PHP in a project for a United States > Government client. The client is skeptical because PHP > is not a Microsoft product. I'm looking for statistics and > links that show that PHP *is* currently in use by the > US Government. > > Is PHP used by the U.S. Department of Defense? Examples? > > Is PHP a U.S. Military Standard?

    I used PHP when I worked for the US government. No inquests were launched.

    Here are some random government PHP pages pulled off a quick Google search:

    http://eire.census.gov/popest/estimates.php http://www.oig.dot.gov/docs_by_area.php?area=8 http://mdn.arm.gov/web/webutil/lib/suitetoc.php?suite=ds&component=hands http://www.aps.anl.gov/epics/php.php?format=printer http://kinetics.nist.gov/index.php http://pacer.ca6.uscourts.gov/index.php http://www.mbda.gov/templates/inside.php?content_id=624

    And some in .mil...

    http://futures.hua.army.mil/privacy.php https://projects.nrl.navy.mil/epi/sign_up.php http://hafb2.hill.af.mil/museum/entry.php http://www.estripes.osd.mil/billing/Matches/01Matches.php http://pf.itd.nrl.navy.mil/docman/display_doc.php?docid=2129&group_id=1 http://housing.cnfj.navy.mil/waitinglist.php

    miguel

    attached mail follows:


    I just did a google search on .gov & php and got back a ton of hits. dot, dod, census, anl and many many others.

    Jerry

    On Fri, 31 May 2002, John Christopher wrote:

    > > I would like to use PHP in a project for a United States > Government client. The client is skeptical because PHP > is not a Microsoft product. I'm looking for statistics and > links that show that PHP *is* currently in use by the > US Government. > > Is PHP used by the U.S. Department of Defense? Examples? > > Is PHP a U.S. Military Standard? > > Any stats or links would be most helpful. Thank you. > > > __________________________________________________ > Do You Yahoo!? > Yahoo! - Official partner of 2002 FIFA World Cup > http://fifaworldcup.yahoo.com > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >

    attached mail follows:


    Hi!

    If I use the "LIMIT 0, 9" at the end of a SQL-query, mysql will only return the first 9 records from the database... But to determine wether or not to print out the "next page", I need to know the total number of records matching the query... Is there a way of doing this without having to do a new query with COUNT in it..?

    Sincerely

    Victor

    attached mail follows:


    No. Do one query with count(*), one with limit. If you're smart, you'll save the total amount in a session somewhere so you only have to do that query once, anyway.

    ---John Holmes...

    > -----Original Message----- > From: Victor Spång Arthursson [mailto:scooterbabemac.com] > Sent: Friday, May 31, 2002 8:16 AM > To: php-generallists.php.net > Subject: [PHP] PHP-mysql: affected rows > > Hi! > > If I use the "LIMIT 0, 9" at the end of a SQL-query, mysql will only > return the first 9 records from the database... But to determine wether or > not to print out the "next page", I need to know the total number of > records matching the query... Is there a way of doing this without having > to do a new query with COUNT in it..? > > Sincerely > > Victor > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php

    attached mail follows:


    Victor,

    I'd do the count first anyway. Then you know whether you need to put up the "next page" links or not.

    HTH Chris

    Victor Spång Arthursson wrote:

    >Hi! > >If I use the "LIMIT 0, 9" at the end of a SQL-query, mysql will only return the first 9 records from the database... But to determine wether or not to print out the "next page", I need to know the total number of records matching the query... Is there a way of doing this without having to do a new query with COUNT in it..? > >Sincerely > >Victor > >

    attached mail follows:


    You can use an array.. $month = array("January","February","March","April".); echo $month[1]; Or put that into a function and use it like show_month(5); ---John Holmes. -----Original Message----- From: webmastertececo.com [mailto:webmastertececo.com] Sent: Friday, May 31, 2002 5:51 AM To: php-generallists.php.net Subject: [PHP] Replacing Number with Month(newbie) Is there a magical function that I can use to convert 4 into April and 5 into May etc? can I use mktime() One yes no answer will do fine JJ Harrison webmastertececo.com www.tececo.com

    attached mail follows:


    I know how to have my php code run a function within itself. But is there a way that upon an event (clicking a button, etc.), you could run a php function without having to go to a new page?

    attached mail follows:


    Not really, seeing as PHP is executed at the server and not on the client - you would need JavaScript for this.

    Mikey

    "Dave Shacket" <dshacketbelievethis.org> wrote in message news:20020531123807.80260.qmailpb1.pair.com... > I know how to have my php code run a function within itself. But is there a > way that upon an event (clicking a button, etc.), you could run a php > function without having to go to a new page? > >

    attached mail follows:


    On Friday 31 May 2002 05:44, you wrote: > I know how to have my php code run a function within itself. But is there a > way that upon an event (clicking a button, etc.), you could run a php > function without having to go to a new page?

    No. PHP is a server side application. The only way to run a function or php program is to send a request to the server. When you do that the server sends back a response and your broswer refreshes the page.

    ..michael..

    attached mail follows:


    On Fri, 31 May 2002, Dave Shacket wrote: > I know how to have my php code run a function within itself. But is there a > way that upon an event (clicking a button, etc.), you could run a php > function without having to go to a new page?

    javascript onclick or whatever can call a PHP program on your server.

    miguel

    attached mail follows:


    [snip] On Friday 31 May 2002 05:44, you wrote: > I know how to have my php code run a function within itself. But is there a > way that upon an event (clicking a button, etc.), you could run a php > function without having to go to a new page?

    No. PHP is a server side application. The only way to run a function or php program is to send a request to the server. When you do that the server sends back a response and your broswer refreshes the page. [/snip]

    You could put up a borderless IFRAME and refresh the associated file :)

    Jay

    attached mail follows:


    use flash to open a tunnel to the server and run a script, therefor it never has to leave the current page. ::)

    Jim Lucas ----- Original Message ----- From: "Michael Sweeney" <sweeneyverisity.com> To: <php-generallists.php.net> Cc: "Dave Shacket" <dshacketbelievethis.org> Sent: Friday, May 31, 2002 10:36 AM Subject: Re: [PHP] Run php function with user click

    > On Friday 31 May 2002 05:44, you wrote: > > I know how to have my php code run a function within itself. But is there a > > way that upon an event (clicking a button, etc.), you could run a php > > function without having to go to a new page? > > No. PHP is a server side application. The only way to run a function or php > program is to send a request to the server. When you do that the server sends > back a response and your broswer refreshes the page. > > ..michael.. > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >

    attached mail follows:


    JavaScript could do a similar thing with onClick.

    -Natalie

    -----Original Message----- From: Jim lucas [mailto:phplistzonedzero.net] Sent: Friday, May 31, 2002 4:21 PM To: sweeneyverisity.com; php-generallists.php.net Cc: Dave Shacket Subject: Re: [PHP] Run php function with user click

    use flash to open a tunnel to the server and run a script, therefor it never has to leave the current page. ::)

    Jim Lucas ----- Original Message ----- From: "Michael Sweeney" <sweeneyverisity.com> To: <php-generallists.php.net> Cc: "Dave Shacket" <dshacketbelievethis.org> Sent: Friday, May 31, 2002 10:36 AM Subject: Re: [PHP] Run php function with user click

    > On Friday 31 May 2002 05:44, you wrote: > > I know how to have my php code run a function within itself. But is there a > > way that upon an event (clicking a button, etc.), you could run a > > php function without having to go to a new page? > > No. PHP is a server side application. The only way to run a function > or php > program is to send a request to the server. When you do that the > server sends > back a response and your broswer refreshes the page. > > ..michael.. > > -- > 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:


    but that would take you off the current page wouldn't it? or would you return false?

    Jim Lucas ----- Original Message ----- From: "Leotta, Natalie (NCI/IMS)" <LeottaNims.nci.nih.gov> To: "'Jim lucas'" <phplistzonedzero.net>; <sweeneyverisity.com>; <php-generallists.php.net> Cc: "Dave Shacket" <dshacketbelievethis.org> Sent: Friday, May 31, 2002 1:25 PM Subject: RE: [PHP] Run php function with user click

    > JavaScript could do a similar thing with onClick. > > -Natalie > > -----Original Message----- > From: Jim lucas [mailto:phplistzonedzero.net] > Sent: Friday, May 31, 2002 4:21 PM > To: sweeneyverisity.com; php-generallists.php.net > Cc: Dave Shacket > Subject: Re: [PHP] Run php function with user click > > > use flash to open a tunnel to the server and run a script, therefor it > never has to leave the current page. ::) > > Jim Lucas > ----- Original Message ----- > From: "Michael Sweeney" <sweeneyverisity.com> > To: <php-generallists.php.net> > Cc: "Dave Shacket" <dshacketbelievethis.org> > Sent: Friday, May 31, 2002 10:36 AM > Subject: Re: [PHP] Run php function with user click > > > > On Friday 31 May 2002 05:44, you wrote: > > > I know how to have my php code run a function within itself. But is > there a > > > way that upon an event (clicking a button, etc.), you could run a > > > php function without having to go to a new page? > > > > No. PHP is a server side application. The only way to run a function > > or > php > > program is to send a request to the server. When you do that the > > server > sends > > back a response and your broswer refreshes the page. > > > > ..michael.. > > > > -- > > 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:


    If Michael Sweeney is right that you can run PHP in a JS method that would work. I just do all of my "instant gratification" stuff in JS. I guess it depends on what is in the PHP function that he wants to run - it's possible that he could do it in JS.

    -Nat

    -----Original Message----- From: Jim lucas [mailto:phplistzonedzero.net] Sent: Friday, May 31, 2002 4:29 PM To: Leotta, Natalie (NCI/IMS); sweeneyverisity.com; php-generallists.php.net Cc: Dave Shacket Subject: Re: [PHP] Run php function with user click

    but that would take you off the current page wouldn't it? or would you return false?

    Jim Lucas ----- Original Message ----- From: "Leotta, Natalie (NCI/IMS)" <LeottaNims.nci.nih.gov> To: "'Jim lucas'" <phplistzonedzero.net>; <sweeneyverisity.com>; <php-generallists.php.net> Cc: "Dave Shacket" <dshacketbelievethis.org> Sent: Friday, May 31, 2002 1:25 PM Subject: RE: [PHP] Run php function with user click

    > JavaScript could do a similar thing with onClick. > > -Natalie > > -----Original Message----- > From: Jim lucas [mailto:phplistzonedzero.net] > Sent: Friday, May 31, 2002 4:21 PM > To: sweeneyverisity.com; php-generallists.php.net > Cc: Dave Shacket > Subject: Re: [PHP] Run php function with user click > > > use flash to open a tunnel to the server and run a script, therefor > it never has to leave the current page. ::) > > Jim Lucas > ----- Original Message ----- > From: "Michael Sweeney" <sweeneyverisity.com> > To: <php-generallists.php.net> > Cc: "Dave Shacket" <dshacketbelievethis.org> > Sent: Friday, May 31, 2002 10:36 AM > Subject: Re: [PHP] Run php function with user click > > > > On Friday 31 May 2002 05:44, you wrote: > > > I know how to have my php code run a function within itself. But > > > is > there a > > > way that upon an event (clicking a button, etc.), you could run a > > > php function without having to go to a new page? > > > > No. PHP is a server side application. The only way to run a function > > or > php > > program is to send a request to the server. When you do that the > > server > sends > > back a response and your broswer refreshes the page. > > > > ..michael.. > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    I have stared at fopen for a long time but can't figure out how to get php to pull in a new web page. I am looking for something akin to javascript window.location command, just as if I typed a new page into my address bar. What am I missing?

    attached mail follows:


    on 31/05/02 10:43 PM, Dave Shacket (dshacketbelievethis.org) wrote:

    > I have stared at fopen for a long time but can't figure out how to get php > to pull in a new web page. I am looking for something akin to javascript > window.location command, just as if I typed a new page into my address bar. > What am I missing?

    you are missing header('Location: blah.html') :)

    read the manual page carefully, because header()'s have to be set before any content is sent to the browser.

    php.net/header

    Justin French

    attached mail follows:


    Can someone point me at a site that has pre-compiled binaries for a standalone PHP interpreter? In particular, I'm looking to use one on Solaris.

    TIA.

    --
    JR
    

    attached mail follows:


    Hi there,

    I am runningn suse72 and there was a mysql installation with the rpm installed. so I did try to get rid of all the stuff I found from the old mysql installation (with yast) and compiled mysql from source. Server is running now. Unfotuantelly php is still trying to connect to the old version. phpinfo tells me the old mysql version number.

    This is what I am gettinng from php:

    Warning: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in

    Server is definatelly running. Not the old one though! I killed the old process which was anyhow running.

    Can anybody help on that?

    Thank you very much in advance,

    Andy

    attached mail follows:


    Check permissions on '/var/lib/mysql/mysql.sock' I seem to remember having this problem in the past...

    Mikey

    "Andy" <news.lettersgmx.de> wrote in message news:20020531133929.23399.qmailpb1.pair.com... > Hi there, > > I am runningn suse72 and there was a mysql installation with the rpm > installed. so I did try to get rid of all the stuff I found from the old > mysql installation (with yast) and compiled mysql from source. Server is > running now. Unfotuantelly php is still trying to connect to the old > version. phpinfo tells me the old mysql version number. > > This is what I am gettinng from php: > > Warning: Can't connect to local MySQL server through socket > '/var/lib/mysql/mysql.sock' (2) in > > Server is definatelly running. Not the old one though! I killed the old > process which was anyhow running. > > Can anybody help on that? > > Thank you very much in advance, > > Andy > >

    attached mail follows:


    That is the wron socket. I found out that my mysql version is running on socket /tmp/mysql.sock while the old one is running on /var/lib/mysql/mysql.sock.

    How can I tell php to connect with the other socket?

    Thanx,

    Andy

    ----- Original Message ----- From: "Michael Davey" <mikeysplatted.net> Newsgroups: php.general To: <php-generallists.php.net> Sent: Friday, May 31, 2002 4:05 PM Subject: Re: PHP can not connect to mysql

    > Check permissions on '/var/lib/mysql/mysql.sock' I seem to remember having > this problem in the past... > > Mikey > > "Andy" <news.lettersgmx.de> wrote in message > news:20020531133929.23399.qmailpb1.pair.com... > > Hi there, > > > > I am runningn suse72 and there was a mysql installation with the rpm > > installed. so I did try to get rid of all the stuff I found from the old > > mysql installation (with yast) and compiled mysql from source. Server is > > running now. Unfotuantelly php is still trying to connect to the old > > version. phpinfo tells me the old mysql version number. > > > > This is what I am gettinng from php: > > > > Warning: Can't connect to local MySQL server through socket > > '/var/lib/mysql/mysql.sock' (2) in > > > > Server is definatelly running. Not the old one though! I killed the old > > process which was anyhow running. > > > > Can anybody help on that? > > > > Thank you very much in advance, > > > > Andy > > > > > >

    attached mail follows:


    mysql_connect("localhost:/tmp/mysql","user","pass");

    - James -------------------------- W: www.londontown.com : jameslondontown.com --------------------------

    -----Original Message----- From: andy [mailto:news.lettersgmx.de] Sent: 31 May 2002 15:19 To: Michael Davey; php-generallists.php.net Subject: [PHP] Re: PHP can not connect to mysql

    That is the wron socket. I found out that my mysql version is running on socket /tmp/mysql.sock while the old one is running on /var/lib/mysql/mysql.sock.

    How can I tell php to connect with the other socket?

    Thanx,

    Andy

    ----- Original Message ----- From: "Michael Davey" <mikeysplatted.net> Newsgroups: php.general To: <php-generallists.php.net> Sent: Friday, May 31, 2002 4:05 PM Subject: Re: PHP can not connect to mysql

    > Check permissions on '/var/lib/mysql/mysql.sock' I seem to remember having > this problem in the past... > > Mikey > > "Andy" <news.lettersgmx.de> wrote in message > news:20020531133929.23399.qmailpb1.pair.com... > > Hi there, > > > > I am runningn suse72 and there was a mysql installation with the rpm > > installed. so I did try to get rid of all the stuff I found from the old > > mysql installation (with yast) and compiled mysql from source. Server is > > running now. Unfotuantelly php is still trying to connect to the old > > version. phpinfo tells me the old mysql version number. > > > > This is what I am gettinng from php: > > > > Warning: Can't connect to local MySQL server through socket > > '/var/lib/mysql/mysql.sock' (2) in > > > > Server is definatelly running. Not the old one though! I killed the old > > process which was anyhow running. > > > > Can anybody help on that? > > > > Thank you very much in advance, > > > > Andy > > > > > >

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

    attached mail follows:


    Or edit php.ini:

    mysql.default_socket = /tmp/mysql.sock

    "James Holden" <php_listsglobalvision.com> wrote in message news:EOEGLFBLIODKEIOHNAANAEJOEGAA.php_listsglobalvision.com... > mysql_connect("localhost:/tmp/mysql","user","pass"); > > > - James > -------------------------- > W: www.londontown.com > : jameslondontown.com > -------------------------- > > -----Original Message----- > From: andy [mailto:news.lettersgmx.de] > Sent: 31 May 2002 15:19 > To: Michael Davey; php-generallists.php.net > Subject: [PHP] Re: PHP can not connect to mysql > > > That is the wron socket. I found out that my mysql version is running on > socket /tmp/mysql.sock while the old one is running on > /var/lib/mysql/mysql.sock. > > How can I tell php to connect with the other socket? > > Thanx, > > Andy > > > > ----- Original Message ----- > From: "Michael Davey" <mikeysplatted.net> > Newsgroups: php.general > To: <php-generallists.php.net> > Sent: Friday, May 31, 2002 4:05 PM > Subject: Re: PHP can not connect to mysql > > > > Check permissions on '/var/lib/mysql/mysql.sock' I seem to remember > having > > this problem in the past... > > > > Mikey > > > > "Andy" <news.lettersgmx.de> wrote in message > > news:20020531133929.23399.qmailpb1.pair.com... > > > Hi there, > > > > > > I am runningn suse72 and there was a mysql installation with the rpm > > > installed. so I did try to get rid of all the stuff I found from the old > > > mysql installation (with yast) and compiled mysql from source. Server is > > > running now. Unfotuantelly php is still trying to connect to the old > > > version. phpinfo tells me the old mysql version number. > > > > > > This is what I am gettinng from php: > > > > > > Warning: Can't connect to local MySQL server through socket > > > '/var/lib/mysql/mysql.sock' (2) in > > > > > > Server is definatelly running. Not the old one though! I killed the old > > > process which was anyhow running. > > > > > > Can anybody help on that? > > > > > > Thank you very much in advance, > > > > > > Andy > > > > > > > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    Hello,

    I have installed the Netscape FastTrack and mySql on Unit Tru64. Now I want to install php also, Since our FastTrack and mySql have been used a year. I want to keep FastTrack and mysql, Does anybody have suggestion about how to make php under this circumstance?

    Thank you very much.

    Grace

    attached mail follows:


    Hi, Jason.

    I'm developing some really cool line/point and bar graphs. While the Image stuff is definitely quite different, I think you'd really like it once you get into it. Our graphs are generated dynamically from data in a database. I can't show you the graphs because they aren't ready for the public yet, but on the line/point graph we actually have the points as different shapes and stuff - circles, triangles, squares... Once we get the new version of PHP we'll be using styled lines (dot dash dash kinds of things) with a width, so they will be easily copied in to PowerPoint presentations.

    It's a lot of work to get it started, because you have to figure out where you're going to want everything to go, but I recommend trying it. Start by drawing some rectangles and filled rectangles and stuff like that.

    Oh, and when you use ImageTTFText, I recommend that for smaller fonts you use -$fontColor instead of just $fontColor - it comes out clearer. For bigger fonts sometimes the blurry one is better because it's less pixilated.

    Good luck! If you need anything else, let me know!

    -Natalie

    -----Original Message----- From: Jason Soza [mailto:soljagci.net] Sent: Friday, May 31, 2002 1:09 AM To: php-generallists.php.net Subject: [PHP] Graphs using PHP

    Just want to run this by you all to check the feasibility of it.

    I run a site that deals with cars, people can upload pics of their vehicle and tell everyone else its year, color, 'generation', and where they're located.

    What I'd like to do is make some graphs on the front page that look like gauges you'd see in a car, i.e. speedometer, tachometer, oil, etc. but these would actually be graphs showing, for instance, how many of the cars on the site are red, or whatever the most popular color is. So if a majority of the cars were red, and red cars made up 57% of the total cars on the site, I'd want a graphic of a speedometer with a needle that would be in a position that represented 57%.

    How difficult is this? I looked at some of the imagecreate() functions in the manual, but they look like a language all their own and I'd like to know if there's any easier way to do this that I'm overlooking. I'm thinking doing some kind of image overlay is the way to go, but not sure. Any ideas or pointers would be great, links to sample scripts would be excellent. Thanks!

    Jason Soza

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

    attached mail follows:


    Heya:

    On Fri, May 31, 2002 at 09:55:27AM +0100, Caspar Kennerdale wrote:

    > I have one table, with a name and info about the project and upto 5 > urls of where the jpeg lies.

    Are you talking about five fields in the table containing up to five URI's for each project? That's not cool. You should "normalize" that structure. Put the project info in one table and then the URI's in anohter. This allows you to efficiently store as few or as many URI's as your heart desires.

    > Now, I then have a piece of javascript which tells frame 2 to update > itself.

    And what about people looking at your site who don't have Java'sCrap running?

    > So I have parsed the record ID to it and it then open a query to the > database and outputs the relevant information about the artworks. Lastly a > third query is also sent to the database to see if there are any other > projects in the gallery by the same artist- and then create a list of > related links.

    Sounds right.

    --Dan

    -- 
                   PHP classes that make web design easier
            SQL Solution  |   Layout Solution   |  Form Solution
        sqlsolution.info  | layoutsolution.info |  formsolution.info
     T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
     4015 7 Av #4AJ, Brooklyn NY     v: 718-854-0335     f: 718-854-0409
    

    attached mail follows:


    I'm using the mail() function, it sends the message properly but the page hangs. Has anyone else had this problem? I'm not trying to send any bulk mail, just one message to one mailbox. Thanks!!

    attached mail follows:


    Did you check your error log?

    -----Original Message----- From: Phil Schwarzmann [mailto:pschwarjhmi.edu] Sent: Friday, May 31, 2002 9:43 AM To: php-generallists.php.net Subject: [PHP] Why does the mail() function hang ?!?

    I'm using the mail() function, it sends the message properly but the page hangs. Has anyone else had this problem? I'm not trying to send any bulk mail, just one message to one mailbox. Thanks!!

    attached mail follows:


    Hi all,

    I have downloaded PHP4.2.1 because I want to use it with apache 2.0.36 But there is no php/experimental/apache2filter.dll file in PHP4.2.1 Did I miss something?

    With kind regards,

    Herman

    ********************************************************************** Dit bericht en alle eventueel meegestuurde documenten zijn vertrouwelijk en alleen bestemd voor degene aan wie het bericht geadresseerd is. Indien u dit bericht heeft ontvangen terwijl u niet de geadresseerde bent, verzoeken wij u het bericht te vernietigen en ons daarvan in kennis te stellen.

    Dit bericht is tevens gecontroleerd op computervirussen.

    This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this e-mail in error, please delete the message and notify us.

    This e-mail message has been swept by MIMEsweeper for the presence of computer viruses. **********************************************************************

    attached mail follows:


    It is called php4apache2.dll

    Mikey

    "Herman Pool" <herman.erdpostcodeloterij.nl> wrote in message news:JJEHLNDCPHLPGOPGHPFLKEFICBAA.herman.erdpostcodeloterij.nl... > Hi all, > > I have downloaded PHP4.2.1 because I want to use it with apache 2.0.36 > But there is no php/experimental/apache2filter.dll file in PHP4.2.1 > Did I miss something? > > With kind regards, > > Herman > > > > > > ********************************************************************** > Dit bericht en alle eventueel meegestuurde documenten > zijn vertrouwelijk en alleen bestemd voor degene aan wie > het bericht geadresseerd is. Indien u dit bericht heeft > ontvangen terwijl u niet de geadresseerde bent, verzoeken > wij u het bericht te vernietigen en ons daarvan in kennis te > stellen. > > Dit bericht is tevens gecontroleerd op computervirussen. > > This e-mail and any files transmitted with it are confidential > and intended solely for the use of the individual or entity to > whom they are addressed. If you have received this e-mail > in error, please delete the message and notify us. > > This e-mail message has been swept by MIMEsweeper for > the presence of computer viruses. > **********************************************************************

    attached mail follows:


    It's moved to the sapi directory in the most recent release instead of the experimental directory.

    Michael Davey wrote: > It is called php4apache2.dll > > Mikey > > "Herman Pool" <herman.erdpostcodeloterij.nl> wrote in message > news:JJEHLNDCPHLPGOPGHPFLKEFICBAA.herman.erdpostcodeloterij.nl... > >>Hi all, >> >>I have downloaded PHP4.2.1 because I want to use it with apache 2.0.36 >>But there is no php/experimental/apache2filter.dll file in PHP4.2.1 >>Did I miss something? >> >>With kind regards, >> >>Herman >> >> >> >> >> >>********************************************************************** >>Dit bericht en alle eventueel meegestuurde documenten >>zijn vertrouwelijk en alleen bestemd voor degene aan wie >>het bericht geadresseerd is. Indien u dit bericht heeft >>ontvangen terwijl u niet de geadresseerde bent, verzoeken >>wij u het bericht te vernietigen en ons daarvan in kennis te >>stellen. >> >>Dit bericht is tevens gecontroleerd op computervirussen. >> >>This e-mail and any files transmitted with it are confidential >>and intended solely for the use of the individual or entity to >>whom they are addressed. If you have received this e-mail >>in error, please delete the message and notify us. >> >>This e-mail message has been swept by MIMEsweeper for >>the presence of computer viruses. >>********************************************************************** > > >

    attached mail follows:


    Can anyone here shed some light on this issue?

    I have a class which is responsible for it's own database access and (some of it) is initalised as below:

    <? class myClass { var $conn; var $sth; // etc...

    function myClass ($db) { $host = "localhost"; $user = "user_name"; $password = "password"; $this->conn = mysql_connect ($host, $user, $pwd) or die ("Unable to connect to database"); $sel = mysql_select_db ($db, $this->conn); if (!$sel) die ("Unable to select database"); return true; }

    // rest of the class } ?>

    Now, say for example the class is used as per the script below:

    <? require ("myClass.class"); $c1 = new myClass ("first_database"); $c2 = new myClass ("second_database");

    // error here $c1->doSomething(); ?>

    When I try to work with the first instance of my class, I get an error which I finally tracked down to it trying to run it's SQL queries against the database defined in $c2. Now, I was under the impression that class variables were private to each instance, however, this seems to be acting like a static var.

    Help?!?

    Mikey

    attached mail follows:


    On Friday, May 31, 2002 at 4:11:42 PM, you wrote: > When I try to work with the first instance of my class, I get an error which > I finally tracked down to it trying to run it's SQL queries against the > database defined in $c2. Now, I was under the impression that class > variables were private to each instance, however, this seems to be acting > like a static var.

    You need to specify $this->conn in each mysql_* function you call otherwise it will be called against the last connection made.

    -- 
    Stuart
    

    attached mail follows:


    I am doing that - sorry, should have given you a bit more code...

    <? class myClass { var $conn; var $sth; // etc...

    function myClass ($db) { $host = "localhost"; $user = "user_name"; $password = "password"; $this->conn = mysql_connect ($host, $user, $pwd) or die ("Unable to connect to database"); $sel = mysql_select_db ($db, $this->conn); if (!$sel) die ("Unable to select database"); return true; }

    function doSomething () { $sql = "select * from table"; $this->sth = mysql_query ($sql, $this->conn); // do something with query... } } ?>

    Is there something inherently static about msql connections?

    Mikey

    "Stuart Dallas" <stuartsharedserver.net> wrote in message news:165163457549.20020531161630sharedserver.net... > On Friday, May 31, 2002 at 4:11:42 PM, you wrote: > > When I try to work with the first instance of my class, I get an error which > > I finally tracked down to it trying to run it's SQL queries against the > > database defined in $c2. Now, I was under the impression that class > > variables were private to each instance, however, this seems to be acting > > like a static var. > > You need to specify $this->conn in each mysql_* function you call otherwise it > will be called against the last connection made. > > -- > Stuart >

    attached mail follows:


    I have the following issue:

    I am making a "gas guage" based on a percentage. ie. - a 180 degree arc is created - the range will be 0 to n (undetermined ammount) - there will be x number of entries - the needle will pount to a a percentage for (int)floor((x / n) * 100)

    The issue is, I have the starting pt for the needle (imagefilledarc needs the center of the 'circle' as the starting pt, which is where the needle will start too), but how would I get the x|y coordinates for the end of the needle based on a perentage of a half-circle (180 degree arc)? Appreciate any clues or ideas.

    ---
    Michael Geier
    

    attached mail follows:


    I believe you will need to use sin and cos to do this...

    I experimented with drawing circles in javascript (sorry, it's not PHP but you can see the concept) and ended up with this:

    for (j = 0; j <= 360; j += (360 / 10)) { // x1 & y1 are offset values var s = x1 + radius * Math.cos (j); var t = y1 + radius * Math.sin (j); setLayer (layer_count, s, t); layer_count++; }

    You would be able to work out the angle by making it a percentage of 180 degrees - although for horizontal gauges, you would need to offset it by -90.

    Hope this helps...

    Mikey

    "Michael Geier" <mgeiercdmsports.com> wrote in message news:CDEMKNODHLIIOKOJNIHGCEPECMAA.mgeiercdmsports.com... > I have the following issue: > > I am making a "gas guage" based on a percentage. > ie. > - a 180 degree arc is created > - the range will be 0 to n (undetermined ammount) > - there will be x number of entries > - the needle will pount to a a percentage > for (int)floor((x / n) * 100) > > The issue is, I have the starting pt for the needle (imagefilledarc > needs the center of the 'circle' as the starting pt, which is where > the needle will start too), but how would I get the x|y coordinates > for the end of the needle based on a perentage of a half-circle > (180 degree arc)? > > Appreciate any clues or ideas. > > --- > Michael Geier >

    attached mail follows:


    Good day,

    Wow, a high school math question.

    You should use asin() and acos() of the angle to get the y and x differentials, respectively. Multiply the result by the size of the needle.

    This assumes that your guage is oriented horizontally, and the needle sweeps from right to left, pointing upwards. Adjust the sign or switch the functions around if your gauge is different.

    Note that the functions operate in radians (2*pi radians == 360 degrees).

    ============================ Darren Gamble Planner, Regional Services Shaw Cablesystems GP 630 - 3rd Avenue SW Calgary, Alberta, Canada T2P 4L4 (403) 781-4948

    > -----Original Message----- > From: Michael Geier [mailto:mgeiercdmsports.com] > Sent: Friday, May 31, 2002 9:18 AM > To: Php-General > Subject: [PHP] gd project question > > > I have the following issue: > > I am making a "gas guage" based on a percentage. > ie. > - a 180 degree arc is created > - the range will be 0 to n (undetermined ammount) > - there will be x number of entries > - the needle will pount to a a percentage > for (int)floor((x / n) * 100) > > The issue is, I have the starting pt for the needle > (imagefilledarc > needs the center of the 'circle' as the starting pt, > which is where > the needle will start too), but how would I get the x|y > coordinates > for the end of the needle based on a perentage of a half-circle > (180 degree arc)? > > Appreciate any clues or ideas. > > --- > Michael Geier > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    Did I mention I hate math [grin]... ok...so here we go so far...

    I am passing a variable diameter of the arc ($d), the total number of widgets possible ($n), and the number of current widgets ($x)

    so let's say $d = 100 $n = 100 $x = 50

    $perc = $x / $n (0.50 or 50 %)

    degree conversion = # * (180/M_PI)

    asin($perc) converted to degrees = 30 acos($perc) converted to degrees = 60

    my arc runs from 180 deg. to 360/0 degree, or left to right, pointing upwards (upside down U). i guess I am not getting my head around the numbers...is there anywhere on the net that has a good thorough description about a process like this?

    Thx. mike

    > -----Original Message----- > From: Darren Gamble [mailto:Darren.Gamblesjrb.ca] > Sent: Friday, May 31, 2002 11:40 AM > To: 'Michael Geier'; Php-General > Subject: RE: [PHP] gd project question > > > Good day, > > Wow, a high school math question. > > You should use asin() and acos() of the angle to get the y and x > differentials, respectively. Multiply the result by the size of > the needle. > > This assumes that your guage is oriented horizontally, and the > needle sweeps > from right to left, pointing upwards. Adjust the sign or switch the > functions around if your gauge is different. > > Note that the functions operate in radians (2*pi radians == 360 degrees). > > ============================ > Darren Gamble > Planner, Regional Services > Shaw Cablesystems GP > 630 - 3rd Avenue SW > Calgary, Alberta, Canada > T2P 4L4 > (403) 781-4948 > > > > -----Original Message----- > > From: Michael Geier [mailto:mgeiercdmsports.com] > > Sent: Friday, May 31, 2002 9:18 AM > > To: Php-General > > Subject: [PHP] gd project question > > > > > > I have the following issue: > > > > I am making a "gas guage" based on a percentage. > > ie. > > - a 180 degree arc is created > > - the range will be 0 to n (undetermined ammount) > > - there will be x number of entries > > - the needle will pount to a a percentage > > for (int)floor((x / n) * 100) > > > > The issue is, I have the starting pt for the needle > > (imagefilledarc > > needs the center of the 'circle' as the starting pt, > > which is where > > the needle will start too), but how would I get the x|y > > coordinates > > for the end of the needle based on a perentage of a half-circle > > (180 degree arc)? > > > > Appreciate any clues or ideas. > > > > --- > > Michael Geier > > > > > > -- > > 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 Fri, 31 May 2002, Michael Geier wrote: > my arc runs from 180 deg. to 360/0 degree, or left to right, pointing > upwards (upside down U). > i guess I am not getting my head around the numbers...is there anywhere on > the net that has a good thorough description about a process like this?

    http://www.google.com/search?hl=en&lr=&q=%22trigonometry+tutorial%22

    miguel

    attached mail follows:


    How do you fetch posted form variables from a request that does not have content type in the headers? I mean, instead of having Content-Type: x-www-form-urlencoded or something similar, there is nothing - just the raw data. How can I parse that?

    Regards

    SImon

    attached mail follows:


    Simon:

    <form method="post"> <input type="submit" name="Foo" value="Boo" /> </form> <?php if ( isset($_POST['Foo']) ) { echo '<p>' . $_POST['Foo'] . '</p>'; } ?>

    Viewing that the first time will show the form. Submitting the form will show you the form again and then the value of Foo.

    --Dan

    -- 
                   PHP classes that make web design easier
            SQL Solution  |   Layout Solution   |  Form Solution
        sqlsolution.info  | layoutsolution.info |  formsolution.info
     T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
     4015 7 Av #4AJ, Brooklyn NY     v: 718-854-0335     f: 718-854-0409
    

    attached mail follows:


    Hello to everyone. This email will probably be quite lengthy so please bear with me. What I am asking is quite important to me, so I will try to be as detailed as possible.

    I have spent the last hour pouring over this list's archive. I have found some great information and a lot of you appear to be quite helpful. I just want to thank everyone in advance for their help. If I have missed something obvious or my question is redundant, then please point me towards the appropriate links and I will read them right away.

    I, along with several other people am starting a business which will depend heavily on its web presence. Unfortunately, I am in the all too common position of having to make technical decisions that will have repercussions on the future well-being of said business, with little to no budget. It is crucial that the solution I pick, handle what we hope will become a very large load in the not-to-distant future (whether this happens or not is a question for another day, heh). To this end, I am very interested in using the LAMP (Linux+Apache+MySQL+PHP) approach. I have experience with all of these technologies, but I am definitely not in a position to vouch for their worthiness for use in a large scale application running beneath a heavy load.

    To quantify LAMP's ability, is it appropriate for say, sites that generate on the order of 5 million unique hits per day? If not, where would you draw the line? At 500,000? Or 1 million? If so, how much higher could it go possibly? 10 million? 20?

    Keep in mind that we have no problem heavily optimizing the application (code tweaks, cacheing, etc).

    We looked into and even began development in JSP w/ Tomcat but found Tomcat to be exceedingly unstable for production use (not that it was ever really meant for it). And of course, the other available application servers were well beyond our budget. Also, time constraints have forced us to look for a faster-to-develop alternative.

    Just a couple of details about the application we intend to develop. It will be very database intensive (many queries per page) and will also provide real-time payment support (for which transactions are a must).

    So, what say you? Given all that I have said, is LAMP appropriate? Will PHP and maybe even more importantly, MySQL be able to scale well? I have no doubt that MySQL is fast, but just how scaleable is it? Will it die beneath the kind of loads I have described?

    What would be *most* helpful to me is if you could provide web sites that exist currently and experience this load and are using LAMP (http://www.sourceforge.net?).

    I hope you are still with me! Thanks a lot for taking the time to read this and I would appreciate greatly any help that can provide.

    Thanks.

    Justin

    attached mail follows:


    On Fri, 31 May 2002, Justin Felker wrote: > I have spent the last hour pouring over this list's archive.

    (Not a flame, but I keep seeing this recently. The word is "poring".)

    > I, along with several other people am starting a business which will depend > heavily on its web presence. Unfortunately, I am in the all too common > position of having to make technical decisions that will have repercussions > on the future well-being of said business, with little to no budget. It is > crucial that the solution I pick, handle what we hope will become a very > large load in the not-to-distant future (whether this happens or not is a > question for another day, heh). To this end, I am very interested in using > the LAMP (Linux+Apache+MySQL+PHP) approach. I have experience with all of > these technologies, but I am definitely not in a position to vouch for > their worthiness for use in a large scale application running beneath a > heavy load. > > To quantify LAMP's ability, is it appropriate for say, sites that generate > on the order of 5 million unique hits per day? If not, where would you > draw the line? At 500,000? Or 1 million? If so, how much higher could it > go possibly? 10 million? 20? > > . . . > > So, what say you? Given all that I have said, is LAMP appropriate? Will > PHP and maybe even more importantly, MySQL be able to scale well? I have > no doubt that MySQL is fast, but just how scaleable is it? Will it die > beneath the kind of loads I have described?

    It's really difficult to answer this question without knowing a lot more about your application. But as a casual guess, if you reach that sort of traffic level, I'd say your stumbling block is going to by MySQL. At some point - granted, that point can be far away if you design your database and queries well - it will buckle under load.

    I'm too busy actually working, unfortunately, to pay attention to the bleeding edge developments in MySQL. But as it stands, there's no serious support for clustering, which means that when you are pushing more transactions than can be handled by the most expensive single machine you can afford, you've hit a brick wall. And as you know, there is a point after which multiple lesser-powered machines are a whole lot cheaper than a single mighty one.

    If your database transactions are mostly read-only, and you can segregate the infrequent write transactions to a separate server, you can do jury-rigged replication of the main data store and scale indefinitely.

    Otherwise, you'll probably have to plan with an eye to a migration path toward Oracle, DB2, or whatever. This doesn't mean you can't start out with MySQL, but it does mean you should develop with a database abstraction layer and shouldn't depend on features that are fast in MySQL but poorly supported by other databases (or emulated in the abstraction layer).

    As for Linux, Apache, and PHP, there's no limit to the transaction volume you can handle with even rudimentary load-balancing tactics, so that's nothing to worry about.

    miguel

    attached mail follows:


    Given enough hardware and an appropriately designed application, yes you will be able to scale up as high as you want to go. The big questions are how much money can you spend vs. what performance, stability and fault tolerance do you want out?

    You have lots of options - Three or four large smp web servers and a one or two replicated mysql servers in a round robin configuration or dozens of moderately powerful servers running both web server and mysql server with a smart load balancing switch in front.

    Both have advantages and disadvantages. Partly it depends on how you write the application, how many sql calls per page you make, how many are writes vs. reads. It may also make sense to write it into a multi tiered app, having the web server make calls to a dedicated php app server that in turn talks to the database server.

    I have ways I like to do things, but it really comes down to what you can afford dollar wise, complexity wise, uptime wise and management wise.

    Jerry

    On Fri, 31 May 2002, Justin Felker wrote:

    > Hello to everyone. This email will probably be quite lengthy so please > bear with me. What I am asking is quite important to me, so I will try to > be as detailed as possible. > > I have spent the last hour pouring over this list's archive. I have found > some great information and a lot of you appear to be quite helpful. I just > want to thank everyone in advance for their help. If I have missed > something obvious or my question is redundant, then please point me towards > the appropriate links and I will read them right away. > > I, along with several other people am starting a business which will depend > heavily on its web presence. Unfortunately, I am in the all too common > position of having to make technical decisions that will have repercussions > on the future well-being of said business, with little to no budget. It is > crucial that the solution I pick, handle what we hope will become a very > large load in the not-to-distant future (whether this happens or not is a > question for another day, heh). To this end, I am very interested in using > the LAMP (Linux+Apache+MySQL+PHP) approach. I have experience with all of > these technologies, but I am definitely not in a position to vouch for > their worthiness for use in a large scale application running beneath a > heavy load. > > To quantify LAMP's ability, is it appropriate for say, sites that generate > on the order of 5 million unique hits per day? If not, where would you > draw the line? At 500,000? Or 1 million? If so, how much higher could it > go possibly? 10 million? 20? > > Keep in mind that we have no problem heavily optimizing the application > (code tweaks, cacheing, etc). > > We looked into and even began development in JSP w/ Tomcat but found Tomcat > to be exceedingly unstable for production use (not that it was ever really > meant for it). And of course, the other available application servers > were well beyond our budget. Also, time constraints have forced us to look > for a faster-to-develop alternative. > > Just a couple of details about the application we intend to develop. It > will be very database intensive (many queries per page) and will also > provide real-time payment support (for which transactions are a must). > > So, what say you? Given all that I have said, is LAMP appropriate? Will > PHP and maybe even more importantly, MySQL be able to scale well? I have > no doubt that MySQL is fast, but just how scaleable is it? Will it die > beneath the kind of loads I have described? > > What would be *most* helpful to me is if you could provide web sites that > exist currently and experience this load and are using LAMP > (http://www.sourceforge.net?). > > I hope you are still with me! Thanks a lot for taking the time to read > this and I would appreciate greatly any help that can provide. > > Thanks. > > Justin > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >

    attached mail follows:


    Start doing some research and testing. Can PHP and MySQL do that? Sure. Are there better solutions? Sure. Too many factors go into decisions like this that's it not a simple email question and answer.

    For one, MySQL only supports transactions if you use InnoDB tables. How reliable are they? I don't know, you'll have to look into it. Do you have a good programmer? If you have a programmer that can write efficient code, then almost any program can be done in PHP. If you get a crappy programmer, then even a simple script can bring your server to it's knees with a little traffic.

    Questions like this are posed every day and there are ariticles all over out there that discuss the benifits and disadvantages. Do some searching on Google.

    Good luck.

    ---John Holmes...

    ----- Original Message ----- From: "Justin Felker" <justindown.cx> To: <php-generallists.php.net> Sent: Friday, May 31, 2002 11:39 AM Subject: [PHP] PHP Decisions and Issues

    > Hello to everyone. This email will probably be quite lengthy so please > bear with me. What I am asking is quite important to me, so I will try to > be as detailed as possible. > > I have spent the last hour pouring over this list's archive. I have found > some great information and a lot of you appear to be quite helpful. I just > want to thank everyone in advance for their help. If I have missed > something obvious or my question is redundant, then please point me towards > the appropriate links and I will read them right away. > > I, along with several other people am starting a business which will depend > heavily on its web presence. Unfortunately, I am in the all too common > position of having to make technical decisions that will have repercussions > on the future well-being of said business, with little to no budget. It is > crucial that the solution I pick, handle what we hope will become a very > large load in the not-to-distant future (whether this happens or not is a > question for another day, heh). To this end, I am very interested in using > the LAMP (Linux+Apache+MySQL+PHP) approach. I have experience with all of > these technologies, but I am definitely not in a position to vouch for > their worthiness for use in a large scale application running beneath a > heavy load. > > To quantify LAMP's ability, is it appropriate for say, sites that generate > on the order of 5 million unique hits per day? If not, where would you > draw the line? At 500,000? Or 1 million? If so, how much higher could it > go possibly? 10 million? 20? > > Keep in mind that we have no problem heavily optimizing the application > (code tweaks, cacheing, etc). > > We looked into and even began development in JSP w/ Tomcat but found Tomcat > to be exceedingly unstable for production use (not that it was ever really > meant for it). And of course, the other available application servers > were well beyond our budget. Also, time constraints have forced us to look > for a faster-to-develop alternative. > > Just a couple of details about the application we intend to develop. It > will be very database intensive (many queries per page) and will also > provide real-time payment support (for which transactions are a must). > > So, what say you? Given all that I have said, is LAMP appropriate? Will > PHP and maybe even more importantly, MySQL be able to scale well? I have > no doubt that MySQL is fast, but just how scaleable is it? Will it die > beneath the kind of loads I have described? > > What would be *most* helpful to me is if you could provide web sites that > exist currently and experience this load and are using LAMP > (http://www.sourceforge.net?). > > I hope you are still with me! Thanks a lot for taking the time to read > this and I would appreciate greatly any help that can provide. > > Thanks. > > Justin > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    Last night, I ran into a problem when using the MS SQL support in PHP under Apache/PHP module/MS SQL 2000. Everything worked well enough. I was able to connect to the server, query data, and a number of other things. However, I found that if I ran my test page (it connects to, queries and displays 20 rows of data, then disconnects) over and over very quickly (hold CTRL+R down basically) PHP would eventually (after about 6 seconds) fail to connect to the MS SQL server. In fact, the web server would have to be completely restarted before it could connect again.

    Has anyone run into this? I mean, if there is no solution to this and is the cause of basically shaky MS SQL support, then the SQL server would be made useless for sites with even a modest amount of traffic (several requests per second). Is this a known problem? If so, could anyone help me out?

    Thanks!

    Justin

    attached mail follows:


    Hiya, were you using the appropriate free_query & close functions to free up the memory & more importantly the socket used to talk to the sql server?

    You might want to try using the _pconnect function if it's available instead of the usual _connect statement.

    I'd guess that PHP ran out of sockets to make outbound connections with. Also, I believe that MSSQL is setup to only have around 1000 max connections open unless you alter the value in the config.

    HTH, Dw

    Sqlcoders.com Dynamic data driven web solutions ----- Original Message ----- From: "Justin Felker" <justindown.cx> To: <php-generallists.php.net> Sent: May 31 2002 08:46 AM Subject: [PHP] MS SQL Problem

    > Last night, I ran into a problem when using the MS SQL support in PHP under > Apache/PHP module/MS SQL 2000. Everything worked well enough. I was able > to connect to the server, query data, and a number of other > things. However, I found that if I ran my test page (it connects to, > queries and displays 20 rows of data, then disconnects) over and over very > quickly (hold CTRL+R down basically) PHP would eventually (after about 6 > seconds) fail to connect to the MS SQL server. In fact, the web server > would have to be completely restarted before it could connect again. > > Has anyone run into this? I mean, if there is no solution to this and is > the cause of basically shaky MS SQL support, then the SQL server would be > made useless for sites with even a modest amount of traffic (several > requests per second). Is this a known problem? If so, could anyone help > me out? > > Thanks! > > Justin > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >

    attached mail follows:


    I have been looking through the documentation for using Bzip2 or zlib compression and have a couple of questions for the group...

    1. Which is best to use on terms of: resultant file size, availability of decompression clients & ease of use?

    2. Both bzip & zlib documentation makes use of *write() functions to add strings to the file, but can this be used to add files?

    3. I intend to add two or more zip files to the archive so that the client only needs to download one file rather than several- which is most suited to this - zlib or bzip2?

    Mikey

    attached mail follows:


    On Fri, 31 May 2002, Michael Davey wrote: > I have been looking through the documentation for using Bzip2 or zlib > compression and have a couple of questions for the group... > > 1. Which is best to use on terms of: resultant file size, availability > of decompression clients & ease of use?

    File size: bzip2 wins, hands down Client availability: zlib wins, hands down Easy of use: tie.

    miguel

    attached mail follows:


    So does anyone have any advice on adding files rather than strings?

    On Fri, 31 May 2002, Michael Davey wrote:

    > I have been looking through the documentation for using Bzip2 or zlib

    > compression and have a couple of questions for the group...

    >

    > 1. Which is best to use on terms of: resultant file size, availability

    > of decompression clients & ease of use?

    File size: bzip2 wins, hands down

    Client availability: zlib wins, hands down

    Easy of use: tie.

    miguel

    > 2. Both bzip & zlib documentation makes use of *write() functions to add > strings to the file, but can this be used to add files? > > 3. I intend to add two or more zip files to the archive so that the > client only needs to download one file rather than several- which is most > suited to this - zlib or bzip2? > > Mikey

    attached mail follows:


    Im still green with writing with class, but I just want to check with you all. I started creating a class file that also using 2 other classes. class.php ----------------------------------- <?php

    class foo { function foo() { require_once('./this.class.php'); $this->db_obj = &new abc($db);

    require_once('./that.class.php'); $this->tpl_obj = &new xwy; } }

    ?> ----------------------------------

    Then in my actual page I started this ---------------------------------- <?php

    require_once('./class.php'); $bar = new foo();

    $bar->db_obj->run_some_code($bar); $bar->tpl_obj->do_this_for_me($bar);

    ?> ------------------------------------

    It works but was wondering if its 'legal' to use it like this -> $lcre->db_obj->run_some_code($bar); $lcre->tpl_obj->do_this_for_me($bar);

    Im not extending the classes, just using them, so is what Im doing ok?? Thanks

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

    attached mail follows:


    I believe so - but why are you passing a the object a reference to itself?

    > $bar->db_obj->run_some_code($bar); > $bar->tpl_obj->do_this_for_me($bar);

    If you need to access parts of the object from within, use the $this-> pointer.

    > It works but was wondering if its 'legal' to use it like this -> > $lcre->db_obj->run_some_code($bar); > $lcre->tpl_obj->do_this_for_me($bar);

    This looks like it makes more sense as you are passing a reference to $bar into $lcre - as long as your function is setup to accept this type of object and knows what to do with it.

    Mikey

    attached mail follows:


    The first example was a mistake. The second is a correct example. I just wasn't sure on the proper format $this->that->foo($bar), if it is technically correct... Thanks

    Michael Davey wrote:

    >I believe so - but why are you passing a the object a reference to itself? > > > >>$bar->db_obj->run_some_code($bar); >>$bar->tpl_obj->do_this_for_me($bar); >> >> >. >If you need to access parts of the object from within, use the $this-> >pointer. > > > >>It works but was wondering if its 'legal' to use it like this -> >>$lcre->db_obj->run_some_code($bar); >>$lcre->tpl_obj->do_this_for_me($bar); >> >> > >This looks like it makes more sense as you are passing a reference to $bar >into $lcre - as long as your function is setup to accept this type of object >and knows what to do with it. > >Mikey > > > > >

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

    attached mail follows:


    It a BASIC question,

    With the following:

    <FORM NAME='Job_Application' ACTION="job_action.php" METHOD=post ENCTYPE="multipart/form-data"> <INPUT TYPE="text" NAME="name"> Name : <BR> <INPUT TYPE=HIDDEN NAME=MAX_FILE_SIZE VALUE=200000> <INPUT TYPE=FILE NAME="userfile"><BR><BR> <INPUT TYPE="submit" NAME="enter" VALUE="Send"><BR> <INPUT TYPE="reset" value="reset" name="reset"><BR> </FORM>

    With the job_action.php I want to display the resaults to the user.

    But the variable name is empty.

    What's the problem?

    Thanks

    Frédérick St-Hilaire

    attached mail follows:


    Can you send the code that is failing to the list - it will help in working out the problem...

    Mikey

    "FréDéRick St-Hilaire" <switch_bladeoperamail.com> wrote in message news:20020530182445.93545.qmailpb1.pair.com... > It a BASIC question, > > With the following: > > <FORM NAME='Job_Application' ACTION="job_action.php" METHOD=post > ENCTYPE="multipart/form-data"> > <INPUT TYPE="text" NAME="name"> > Name : <BR> > <INPUT TYPE=HIDDEN NAME=MAX_FILE_SIZE VALUE=200000> > <INPUT TYPE=FILE NAME="userfile"><BR><BR> > <INPUT TYPE="submit" NAME="enter" VALUE="Send"><BR> > <INPUT TYPE="reset" value="reset" name="reset"><BR> > </FORM> > > With the job_action.php I want to display the resaults to the user. > > But the variable name is empty. > > What's the problem? > > Thanks > > Frédérick St-Hilaire > >

    attached mail follows:


    On Friday, May 31, 2002, 5:17:49 PM, you wrote: > Can you send the code that is failing to the list - it will help in working > out the problem...

    And include your platform details (OS, PHP version, etc).

    -- 
    Stuart
    

    attached mail follows:


    Is there a variable/function in php that will display the url location of the hyper-link that brought them to the current page. Thanks in advance. Kris Vose

    attached mail follows:


    $_SERVER['HTTP_REFERRER']

    "Kris Vose" <KVosealidaconnection.com> wrote in message news:0D192E12994BF64B84EB7BE6D960E3900E3A1Ealidamail.alidaconnection.com... > Is there a variable/function in php that will display the url location of the hyper-link that brought them to the current page. Thanks in advance. > > Kris Vose >

    attached mail follows:


    depending on what version of php you are running, you can use $GLOBALS['HTTP_REFERER'] or on newer versions you can use $_SERVER['HTTP_REFERER']

    Jim Lucas ----- Original Message ----- From: "Kris Vose" <KVosealidaconnection.com> To: <php-generallists.php.net> Sent: Friday, May 31, 2002 9:19 AM Subject: [PHP] diplaying the path

    > Is there a variable/function in php that will display the url location of the hyper-link that brought them to the current page. Thanks in advance. > > Kris Vose >

    attached mail follows:


    actually:

    If the php directive register_globals is on, then $HTTP_REFERER will exist. Otherwise it will not. (or course that assumes a value exists at all).

    Regardless of the register_globals setting, you can do:

    // Works since PHP 3 (forever)* print $HTTP_SERVER_VARS['HTTP_REFERER'];

    // Works since PHP 4.1.0 print $_SERVER['HTTP_REFERER'];

    Btw, $GLOBALS['HTTP_REFERER'] === $HTTP_REFERER. And lastly, since PHP 4.2.0 the register_globals directive defaults to off, which is what Jim was indirectly referring to. See also extract().

    Regards, Philip Olson

    * For versions older then 4.0.3 see also the track_vars directive, it should be on.

    On Fri, 31 May 2002, Jim lucas wrote:

    > depending on what version of php you are running, you can use > $GLOBALS['HTTP_REFERER'] or on newer versions you can use > $_SERVER['HTTP_REFERER'] > > Jim Lucas > ----- Original Message ----- > From: "Kris Vose" <KVosealidaconnection.com> > To: <php-generallists.php.net> > Sent: Friday, May 31, 2002 9:19 AM > Subject: [PHP] diplaying the path > > > > Is there a variable/function in php that will display the url location of > the hyper-link that brought them to the current page. Thanks in advance. > > > > Kris Vose > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    the bad thing about the BTW seciton is, is that it is not true inside of a function, that is the reason I refered to it as $GLOBALS['HTTP_REFERER']

    Jim lucas ----- Original Message ----- From: "Philip Olson" <philipcornado.com> To: "Jim lucas" <phplistzonedzero.net> Cc: "Kris Vose" <KVosealidaconnection.com>; <php-generallists.php.net> Sent: Friday, May 31, 2002 11:03 AM Subject: Re: [PHP] diplaying the path

    > actually: > > If the php directive register_globals is on, then > $HTTP_REFERER will exist. Otherwise it will not. > (or course that assumes a value exists at all). > > Regardless of the register_globals setting, you > can do: > > // Works since PHP 3 (forever)* > print $HTTP_SERVER_VARS['HTTP_REFERER']; > > // Works since PHP 4.1.0 > print $_SERVER['HTTP_REFERER']; > > Btw, $GLOBALS['HTTP_REFERER'] === $HTTP_REFERER. > And lastly, since PHP 4.2.0 the register_globals > directive defaults to off, which is what Jim was > indirectly referring to. See also extract(). > > Regards, > Philip Olson > > * For versions older then 4.0.3 see also the > track_vars directive, it should be on. > > > On Fri, 31 May 2002, Jim lucas wrote: > > > depending on what version of php you are running, you can use > > $GLOBALS['HTTP_REFERER'] or on newer versions you can use > > $_SERVER['HTTP_REFERER'] > > > > Jim Lucas > > ----- Original Message ----- > > From: "Kris Vose" <KVosealidaconnection.com> > > To: <php-generallists.php.net> > > Sent: Friday, May 31, 2002 9:19 AM > > Subject: [PHP] diplaying the path > > > > > > > Is there a variable/function in php that will display the url location of > > the hyper-link that brought them to the current page. Thanks in advance. > > > > > > Kris Vose > > > > > > > > > -- > > PHP General Mailing List (http://www.php.net/) > > To unsubscribe, visit: http://www.php.net/unsub.php > > > >

    attached mail follows:


    Another similar way, using an array (very simple to add tasks):

    $tasks = array('ShowVersion','GetData','CreateImage');

    if (in_array($_REQUEST['Task'], $tasks)) { // add some error checking here (function_exists()) $$Task(); } else { // maybe run a default task here print "unknown task"; }

    Am using in case 'Task' doesn't exist at all, so no error will be seen (undefined variables create E_NOTICE level errors). Although you may want to check this before Task even reaches in_array(), with empty(). See also:

    http://www.php.net/error_reporting

    $$Task() is a variable function:

    http://uk.php.net/manual/functions.variable-functions.php

    And $_REQUEST is a PHP predefined/reserved variable that contains a mix of Get, Post and Cookie data. This may or may not be appropriate here: http://au.phpz.net/manual/language.variables.predefined.php

    On a sidenote (picky), consider making variables all lowercase. Also when printing a single var, no need to surround it with quotes. print $foo.

    Regards, Philip Olson

    On Fri, 31 May 2002, Christopher J. Crane wrote:

    > I like this piece of code. In fact, I convert all my scripts that use the > older If/Else code. What would happen if the "break; " wasn't used. Would > it just continue through the rest of the function to find another match??? > > "Miguel Cruz" <mncstoic.net> wrote in message > news:Pine.LNX.4.44.0205302126560.28702-100000stoic.net... > > On Thu, 30 May 2002, Crane, Christopher wrote: > > > if ($Task == "ShowVersion") { function ShowVersion(); } > > > elseif ($Task == "GetData") { function GetData(); print "$DataOutput"; } > > > elseif ($Task == "CreateImage") { function CreateImage(); } > > > else { print "Incorrect Variable or no Variable Supplies<br>"; } > > > > if (isset($Task)) > > { > > switch($Task) > > { > > case 'ShowVersion': > > ShowVersion(); > > break; > > case 'GetData': > > GetData; > > print $DataOutput; > > break; > > case 'CreateImage': > > CreateImage(); > > break; > > default: > > print 'Unknown function'; > > } > > } else { > > print 'No function supplied'; > > } > > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    Good day,

    I don't have a piece of code off the top of my head, but you'll get lots of results and examples if you enter those variables into www.php.net 's search field and search the online documentation (which is very, very good, I should add).

    Hope that helps.

    ============================ Darren Gamble Planner, Regional Services Shaw Cablesystems GP 630 - 3rd Avenue SW Calgary, Alberta, Canada T2P 4L4 (403) 781-4948

    > -----Original Message----- > From: Christopher J. Crane [mailto:ccraneinxdesign.com] > Sent: Thursday, May 30, 2002 8:06 PM > To: php-generallists.php.net > Subject: Re: [PHP] Undefined variables > > > Darren, > Thanks for the tip on direction to head in. Could you provide > an example of > what you are referring to? > > > "Darren Gamble" <Darren.Gamblesjrb.ca> wrote in message > news:078EC26E265CD411BD9100508BDFFC860ED3E64Eshawmail02... > > Good day, > > > > Just to clarify, Perl will, in fact, complain if you have undefined > > variables (or variables that you use once) if you have > warnings and/or > > strict mode in effect. Using at least one is strongly recommended. > > > > In PHP, the method you're using for getting form data is > deprecated. You > > should use $HTTP_POST_VARS or $_POST, depending on your > version. Check > the > > docco for more info on those. > > > > If you really have to check variables using this method, > use isset() to > see > > if the variables ... have been set. =) > > > > ============================ > > Darren Gamble > > Planner, Regional Services > > Shaw Cablesystems GP > > 630 - 3rd Avenue SW > > Calgary, Alberta, Canada > > T2P 4L4 > > (403) 781-4948 > > > > > > > -----Original Message----- > > > From: Crane, Christopher [mailto:CCraneIKON.com] > > > Sent: Thursday, May 30, 2002 3:07 PM > > > To: 'php-generallists.php.net' > > > Subject: [PHP] Undefined variables > > > > > > > > > I have an annoying problem, that I know is my own ignorance > > > to PHP. I came > > > from PERL and this was not a problem there but is with PHP. > > > > > > Here's the issue. > > > I have a number of scripts that use a "index.php?Task='some > > > sort of task > > > name'", for example, http://www.foo.com/index.php?Task=ShowVersion > > > <http://www.foo.com/index.php?Task=ShowVersion> . Then I use > > > an if/else > > > statement to tell the script what to do if it sees the > > > ShowVersion variable. > > > In the ShowVersion example, I would call a function that > displays the > > > version information I defined in the script. As a back up, I > > > always provide > > > an else statement to catch variables I have no functions for. > > > > > > If I have a ShowVersion function, GetData function and a > CreateImage > > > function and the Task variable is empty or a variable that > > > does not exists > > > comes in like http://www.foo.com/index.php?Task=SomethingDumb > > > <http://www.foo.com/index.php?Task=SomethingDumb> it > would go to the > > > default function of something by using the ELSE part of > the if/else > > > statements. > > > > > > I hope I am describing this correctly.....now here is the > > > problem. If I have > > > warnings turned on, or if I have a log written for warnings, > > > the log fills > > > up if someone goes to http://www.foo.com/index.php > > > <http://www.foo.com/index.php> or http://www.foo.com > > <http://www.foo.com> > > will error messages like undefine variable TASK on line > 255. I understand > > the reason, that PHP was expecting the variable Task when > it got to the > > if/else statements. So I put in something like if(!($Task)) > { function > > Something(); } but it still is looking for the variable so it still > errors. > > > > In Perl, it would simply be ignored. What do I do here. > > > > Here is a simple example of the code. > > > > if ($Task == "ShowVersion") { function ShowVersion(); } > > elseif ($Task == "GetData") { function GetData(); print > "$DataOutput"; } > > elseif ($Task == "CreateImage") { function CreateImage(); } > > else { print "Incorrect Variable or no Variable Supplies<br>"; } > > > > > > > > > > > > Christopher J. Crane > > Network Operations Manager > > > > IKON Office Solutions > > 860.659.6464 > > > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    Hi all,

    anyone know of any good pre-written classes or functions to work with IP address space?

    I'm looking for things which can verify correct notation of IP addresses (fine, that's easy enough), but also verify things like network addresses, broadcast addresses, and work out subnet masks when a start and end IP address is given...

    Any ideas? I'm sure I can just write my own... But it's going to save me allot of time if something like this is out there already for me to use.

    --
    me
    

    attached mail follows:


    ip2long and long2ip and a bit of bitwise logic is really all you need.

    -Rasmus

    On Fri, 31 May 2002, Chris Knipe wrote:

    > Hi all, > > anyone know of any good pre-written classes or functions to work with IP > address space? > > I'm looking for things which can verify correct notation of IP addresses > (fine, that's easy enough), but also verify things like network addresses, > broadcast addresses, and work out subnet masks when a start and end IP > address is given... > > Any ideas? I'm sure I can just write my own... But it's going to save me > allot of time if something like this is out there already for me to use. > > -- > me > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php >

    attached mail follows:


    I just tried to open the PHP link about the Navy. I'm running IE6 (freshly installed today, so no tweaks have been made) with Win2000. When I clicked on the link in the email, a "locate link" window came up (similar to an open file window). This does not happen on my coworker's machine. The only obvious difference between my computer and my coworker's computer is that I'm running Office XP and he's got Office 2000, so we've got different versions of Outlook.

    We are currently redoing our website so that the URL has all of the unique identifiers for each graph, so the whole point is to have people graph something, copy it into an email, and send it to someone so they get the same graph.

    Does this happen to anyone else? Is there something we can do to prevent it from happening?

    Thanks!

    -Natalie

    PS Here's the link that was sent, if you want to try it:

    http://www.zend.com/zend/cs/csnavalready.php

    Natalie S. Leotta Information Management Services, Inc. (301) 680-9770 LeottaNims.nci.nih.gov

    attached mail follows:


    Natalie, I'm using Outlook XP here and the link opens just fine. The only time I get that "locate link browser" window is if I hold the shift-key down when clicking on the link. (I typically link to open links in new windows, so I hold the shift-key when clicking links - It will open the link in a new browser window.)

    If you weren't hitting the shift-key, it could be possible that one of your shift-keys are stuck, which is "emulating" the shift-click. Not much more I can tell you other than that, since the link (and all others) work just fine for me in Outlook XP.

    Jaime Bozza

    -----Original Message----- From: Leotta, Natalie (NCI/IMS) [mailto:LeottaNims.nci.nih.gov] Sent: Friday, May 31, 2002 12:16 PM To: php-generallists.php.net Cc: Jeans, Matt (NCI/IMS); Cucinelli, James (NCI/IMS) Subject: [PHP] PHP URLs not opening from email in Outlook XP

    I just tried to open the PHP link about the Navy. I'm running IE6 (freshly installed today, so no tweaks have been made) with Win2000. When I clicked on the link in the email, a "locate link" window came up (similar to an open file window). This does not happen on my coworker's machine. The only obvious difference between my computer and my coworker's computer is that I'm running Office XP and he's got Office 2000, so we've got different versions of Outlook.

    We are currently redoing our website so that the URL has all of the unique identifiers for each graph, so the whole point is to have people graph something, copy it into an email, and send it to someone so they get the same graph.

    Does this happen to anyone else? Is there something we can do to prevent it from happening?

    Thanks!

    -Natalie

    PS Here's the link that was sent, if you want to try it:

    http://www.zend.com/zend/cs/csnavalready.php

    Natalie S. Leotta Information Management Services, Inc. (301) 680-9770 LeottaNims.nci.nih.gov

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

    attached mail follows:


    My shift key isn't stuck. I don't know what's wrong. I found out that one other person had a problem with it at my company and apparently one of the techies put it on MS's technet group. Hopefully something will come of it.

    Thanks for your help!

    -Natalie

    -----Original Message----- From: Jaime Bozza [mailto:jbozzathinkburst.com] Sent: Friday, May 31, 2002 1:49 PM To: Leotta, Natalie (NCI/IMS) Cc: Jeans, Matt (NCI/IMS); Cucinelli, James (NCI/IMS); php-generallists.php.net Subject: RE: [PHP] PHP URLs not opening from email in Outlook XP

    Natalie, I'm using Outlook XP here and the link opens just fine. The only time I get that "locate link browser" window is if I hold the shift-key down when clicking on the link. (I typically link to open links in new windows, so I hold the shift-key when clicking links - It will open the link in a new browser window.)

    If you weren't hitting the shift-key, it could be possible that one of your shift-keys are stuck, which is "emulating" the shift-click. Not much more I can tell you other than that, since the link (and all others) w