#31
  1. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    Solution to the "nothing works" problem


    Hi all...

    for those of you that had the problem where nothing was working with the .php4 extension using PWS.

    run 'regedit'
    goto -> HKEY_LOCAL_MACHINE -> SYSTEM -> CURRENTCONTROLSET -> SERVICES -> W3SVC -> PARAMETERS -> SCRIPT MAP

    there you should see the '.php' string.
    right-click add a new string called '.php4'.
    Double click on it and add in the value data 'C:\PHP\php.exe' or wherever you installed PHP to.

    also add the key '.php4' with the value data being 'phpfile' into the HKEY_CLASSES_ROOT.

    It says to do this in the online manual...my problem was forgetting to install .php4 into the LOCAL MACHINE thingy...

    hope this helps.
  2. #32
  3. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    Undefined variable: submit


    Everytime "if (!$submit)" is used i get this msg: "Warning: Undefined variable: submit in C:/XITAMI/webpages/today.php on line 3"
    <br>
    <br>
    What haven't I understood?
  4. #33
  5. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    Won't process


    After checking and double checking, whenever I upload the cookie page the info shows up, with the extra line at the bottom on "Here is your fortune for " - but whenever I select a day and hit the submit key, I get referred back to the same page and the fortune never shows up.
  6. #34
  7. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    Re: hmm, nothing is working :(


    I had the same problem. In my case, I forgot that php was case sensitive. While in the form I was using "Name" with a capital N, the receiving script was looking for $name with a lower case n.
  8. #35
  9. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    Re: This is great stuff!


    I haven't read any books, all i knew about php was that it's a server-side scripting language. these tutorials are exactly what people need! very easy to understand and get right to the point. now all i need is to find a good web host that supports php and isn't down all the time like the one i'm using (www.f2s.com)
  10. #36
  11. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    Great Job guys..


    A few things that could be done better is highlighting certain things, such as the file is assuming it is named "cookie.php4" etc.. but otherwise EXCELLENT!!!!
  12. #37
  13. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    Re: Undefined variable: submit


    Yeah me too, i'm running IIS 5 and w2k.
    It's weird, shoundl't $submit default to false when not initialised ?
  14. #38
  15. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    fix


    I got around this problem : just put a @ before the !submit, like this :

    <?
    if (@!$submit)
    {
    // if $submit doesn't exist, it implies that the form
    // has not yet been submitted
    // so display the first page

    ?>

    The error message doesn't display that way. Sure, it's a patch, but hey.... :)
  16. #39
  17. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    Re: Won't process


    i faced a similar problem however, I had juss forgot to put name="Submit" and i faced the same thing as urself...u may wanna look out for that...

    1
  18. #40
  19. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    Fix for login.php4 and form.html


    open up your httpd.conf file and search for AddType ... after

    AddType application/x-httpd-php .php
    AddType application/x-httpd-php .phtml

    add this line:

    AddType application/x-httpd-php .php4

    now it'll work!!!
    email me if you cant get it to work.
  20. #41
  21. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    POST does not work


    I changed the the METHOD="get" to METHOD="post" and I get this:
    <br>
    <br>
    There is a problem with the page you are trying to reach and it cannot be displayed.
    <br>
    <br>
    ...etc.
    <br>
    <br>
    HTTP 500 - Internal server error
    <br>
    <br>
    What would be casuing this?
    <br>
    <br>
    Using PWS & WinNT
    <br>
    ~Dan
    <br>
  22. #42
  23. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    Re: fix


    Use

    if (!isset($variable))



    This works as intended and is very clean :)

    (see php-manual).



    Dave
  24. #43
  25. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    Re: fix-undefined variable


    What could be making this problem. I am getting the same thing... Maybe there is something in php.ini that could change this. why did the author wrote it like this if it was giving errors???? I've seen this thing in some other examples and they all (!$variable) and it gives an error.... ???????????????????? but thanks for this tip..
  26. #44
  27. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    .php4 and .php - the difference


    The examples about include and require functions have *.php4 as extensions and work fine, why then does login.php4 not work.

    I works when you change it to login.php.

    Confusing or what????

    Please clarify, Thanks
  28. #45
  29. No Profile Picture
    guest
    Guest
    Devshed Newbie (0 - 499 posts)

    Re: fix


    Dave,

    Beautiful fix! Worked right away. Thanks! And I was about to go, "geez another great looking set of code that doesn't work!"

    Bill :)

IMN logo majestic logo threadwatch logo seochat tools logo