#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2012
    Posts
    1
    Rep Power
    0

    Contact.php not found. Server issue?


    Hello,

    I am not very familiar with php unfortunately.

    I am trying to set up a contact form: uebersee.com.sg/contact.html

    But my server doesn't find the respective contact.php ("Nothing found for contact Php)"

    This is the server:
    Server: Localhost via UNIX socket Server version: 5.5.27-cll Protocol version: 10

    Does anyone have an idea what's missing or what I do wrong?

    Thanks so much!

    Philipp


    PHP Code:
       <?php

        
    // Enter your e-mail address.
        
    $to 'name@name.com';

        
    // Go to your-site.com/contact.php?test to send a testing email.
        
    if ( isset($_GET['test']) ) {
           
    mail($to'Message from contact form''It\'s working!''From: ' $to "\r\n");
           die(
    'Testing e-mail has been sent.');
        }

        
    // Validate e-mail.
        
    function isValidEmail$email null ) {
           return 
    preg_match"/^
              [\d\w\/+!=#|$?%{^&}*`'~-]
              [\d\w\/\.+!=#|$?%{^&}*`'~-]*@
              [A-Z0-9]
              [A-Z0-9.-]{0,61}
              [A-Z0-9]\.
              [A-Z]{2,6}$/ix"
    $email
           
    );
        }

        
    // Validate input.
        
    if ( !empty($_POST['name']) && isValidEmail($_POST['email']) && !empty($_POST['text'])) {
           
           
    // Set e-mail headers.
           
    $message $_POST['text'];
           
    $headers 'From: ' $_POST['name'] . ' <' $_POST['email'] . '>' "\r\n" 'Reply-To: ' $_POST['email'];
           
           
    // Send e-mail.
           
    if ( mail($to'Message from contact form'$message$headers) ) echo 'sent';
           
        } else {

           echo 
    'invalid';

        }
        
    ?>
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Jul 2003
    Posts
    3,461
    Rep Power
    594
    This is not a PHP issue. Assuming contact.php is the code you posted then it means wherever you put it is not in documentroot or the url is wrong. Make sure the URL is correct with respect to documentroot and that you have contact.php in that path.
    There are 10 kinds of people in the world. Those that understand binary and those that don't.

IMN logo majestic logo threadwatch logo seochat tools logo