Contact Us Form Script not working

Discussion in 'PHP' started by undertaker1, Sep 9, 2011.

  1. #1
    Hi I tried to use the contact form script here hxxp://forums.digitalpoint.com/showthread.php?t=46366 I obviously replaced the "xxxx" But when I submit the form, it does not work. The HTTP 404 Not found error page comes up: The webpage cannot be found. When I look at my url, it shows: hxxp://www.xxxxxxxxxx.co.uk/%3C?php echo $_SERVER['REQUEST_URI']; ?>

    I tried using the same code on a free web hosting space, and it works. But not on my paid web space host.
     
    Solved! View solution.
    undertaker1, Sep 9, 2011 IP
  2. babushkyn

    babushkyn Member

    Messages:
    38
    Likes Received:
    0
    Best Answers:
    2
    Trophy Points:
    26
    #2
    Do you use it in .html file? There could be problem with PHP not parsing htm/html files. You can change the file extension to .php or add the line below to your .htaccess:
    AddType application/x-httpd-php .html
    Code (markup):
    but that might not work on every hosting.
    Also check the page source, to see if PHP is parsed properly - you shouldn't see any of the PHP code.
     
    babushkyn, Sep 9, 2011 IP
  3. undertaker1

    undertaker1 Greenhorn

    Messages:
    31
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #3
    Yes I do use it in the .html file, more specifically on the contact html page so it wouldnt be wise to change the file extension to .php. Where can i find .htaccess? I dont have ssh access. I do see php code when I rollover the send message button
     
    Last edited: Sep 9, 2011
    undertaker1, Sep 9, 2011 IP
  4. babushkyn

    babushkyn Member

    Messages:
    38
    Likes Received:
    0
    Best Answers:
    2
    Trophy Points:
    26
    #4
    .htaccess can be uploaded through ftp, it's hidden, so you would need to enable showing hidden files in your ftp client. If there is no .htaccess file on your ftp, just create it and put there the line I wrote in previous post.
     
    babushkyn, Sep 9, 2011 IP
  5. undertaker1

    undertaker1 Greenhorn

    Messages:
    31
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #5
    That didnt work :(
     
    undertaker1, Sep 9, 2011 IP
  6. #6
    So change the extension of that file to .php and rewrite it to .html with .htaccess, like:
    RewriteEngine on
    RewriteRule ^yourfile.html$ yourfile.php
    Code (markup):
     
    babushkyn, Sep 9, 2011 IP
  7. undertaker1

    undertaker1 Greenhorn

    Messages:
    31
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #7
    oh my god, that actually worked! Thank you very much for your kindness of helping me out. Seriously stressed me out. I wish there were more people like you willing to help. I am ever so grateful! Thank you :)
     
    undertaker1, Sep 9, 2011 IP