Page 2 of 2 FirstFirst 12
Results 11 to 14 of 14

Thread: form problem

  1. #11
    Join Date
    Jan 2007
    Posts
    629
    Thanks
    10
    Thanked 28 Times in 28 Posts

    Default

    I do see your point theTestingSite, but I still think it's advantageous. If you are only using the information for a short amount of time, and you have lots of it-- which appears to be the case in this script-- I don't see the problem. What's the difference in that and $var = $_POST['var'] ? Extract doesn't actually make them global does it?
    --Jas
    function GreatMinds(){ return "Think Like Jas"; }
    I'm gone for a while, but in the meantime: Try using my FTP script | Fight Bot Form Submissions

  2. #12
    Join Date
    Sep 2006
    Location
    St. George, UT
    Posts
    2,769
    Thanks
    3
    Thanked 157 Times in 155 Posts

    Default

    If you look at the documentation on php.net (http://php.net/extract), you can see that it in fact does make it a "global" variable for the script/page that you send the data to.

    Hope this helps.
    "Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
    TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design

  3. #13
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Yes, it does make them global. Cluttering up the global namespace is always a bad idea, in any language. Generally you should try to have only necessary entry points in the global namespace. PHP's scoping system is pants, so there are quite a few cases in which it's necessary to make more global variables than should strictly be needed, but still you should avoid doing so where possible.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  4. #14
    Join Date
    Jan 2007
    Posts
    629
    Thanks
    10
    Thanked 28 Times in 28 Posts

    Default

    Thanks guys. I see the problem now. But, is there a way to do the same thing without global vars?
    --Jas
    function GreatMinds(){ return "Think Like Jas"; }
    I'm gone for a while, but in the meantime: Try using my FTP script | Fight Bot Form Submissions

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •