Results 1 to 2 of 2

Thread: PHP Help needed

  1. #1
    SWestwood is offline New Member: Posts Will Be Moderated
    Join Date
    Mar 2011
    Posts
    1

    PHP Help needed

    Hi Guys,

    I need to make a page of a website with a form and then the form details emailed to someone.

    I believe that there is no way to do this via CSS & HTML alone, is this correct?

    I do not know php at all, although I have given this a bash via a coding book I have, but it does not seem to work.

    Can someone tell me what I have done wrong or help me in any way as I am starting to get frustrated?

    Cheers

    Sarah

    Code:-

    <?php
    if (array_key_exists('Notify', $_POST)) {
    $to = 'notify@got-the-concept.co.uk';
    $subject = 'Notify when Live';
    $expected = array('Name', 'Email Address');
    $required = array('Name', 'Email Address');
    $headers = 'From: My website<notify@got-the-concept.co.uk>';
    $process = 'process_mail.inc.php';
    if (file_exists($process) && is_readable($process)) {
    include($process);
    }
    else {
    $mailSent = false;
    mail($to, 'Server Problem', "$process cannot be read", $headers);
    }
    }
    ?>
    <?php
    if ($POST && isset($missing) && (!empty($missing)) {
    ?>
    <p class="warning"> Not all required fields were filled in. </p>
    <?php
    }else if ($POST && !$mailSent) {
    ?>
    <p class="warning">Sorry, there was a problem sending your message. Please try later. </p>
    <?php
    }
    elseif ($POST && $mailSent) {
    ?>
    <p> <strong>Your message has been sent. Thank you for your feedback. </strong> </p>
    <?php } ?>
    <form action="<?php echo $_SERVER['PHP SELF']; ?>" method="post">
    <input type="hidden" name="subject" value="notify me from site" />
    <input type="hidden" name="redirect" value="http://www.got-the-concept.co.uk/notify2.html" />
    <p> <strong> Name </strong> </p> <br /> <input type="text" name="Name" size="30" />
    <p> <strong> Email Address </strong> </p> <br /> <input type="text" name="Email Address" size="30" />
    <p> <input type="button" name="Notify" value="Notify" /> </p>
    </form>

  2. #2
    Join Date
    Feb 2007
    Location
    Ireland
    Posts
    1,007
    Issue has been solved off site.
    “The best thing about a boolean is even if you are wrong, you are only off by a bit.”

Similar Threads

  1. Help Needed Installing Mcrypt for PHP
    By frank727 in forum Web Hosting and Domain Names
    Replies: 0
    Last Post: 28 Jun 2007, 04:01 PM
  2. PHP mod_Rewrite needed
    By Rickzkm in forum Client & Server Side Scripting (PHP, ASP, JavaScript)
    Replies: 0
    Last Post: 14 Aug 2006, 04:47 PM

Posting Permissions

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