Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New Coder
    Join Date
    Jun 2008
    Posts
    76
    Thanks
    11
    Thanked 0 Times in 0 Posts

    My form? Links and Code

    Basically, I'm trying to create a contact form for my site.. Here's a link to the site:

    http://aboutchris.co.uk/Reflex/contact.php

    It all seems to work, except when i recieve the mail all i get is "Inquiry" But no $message. And I can't work out why maybe you guys with more php knowledge might know why?

    Here's the sendmail.php:
    Code:
          <?
          $author = $_GET['author'] ;
          $email = $_GET['email'] ;
          $url = $_GET['url'] ;
          $message = $_GET['message'] ;
          mail('crispy.uk@gmail.com', 'Inquiry', $message);
          print "Congratulations your email has been sent";
          ?>
    Here's the form HTML:
    Code:
    <form action="sendmail.php" method="post" id="commentform">
    
    
    <p><label for="author">Name (required)</label>
    
    <input type="text" name="author" id="author" value="" size="22" tabindex="1" class="required" minlength="4" />
    </p>
    
    <p><label for="email">Mail (required)</label>
    
    <input type="text" name="email" id="email" value="" size="22" tabindex="2" class="required email"  />
    </p>
    
    <p><label for="url">Website</label>
    <input type="text" name="url" id="url" value="" size="22" tabindex="3" class="url" />
    </p>
    
    <p><label for="message">Message</label>
    
    <textarea name="message" id="message" cols="5" rows="10" tabindex="4" class="required" minlength="10" maxlength="100"></textarea>
    </p>
    <br />
    <p>
    <input name="submit" type="submit" id="submit" tabindex="5" value="Send Message" />
    
    <input type="hidden" name="comment_post_ID" value="1" />
    </p>
    </form>
    Really stuck on this one guys any help much appreciated!

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,801
    Thanks
    160
    Thanked 2,216 Times in 2,203 Posts
    Blog Entries
    1
    <form action="sendmail.php" method="post" id="commentform">
    $author = $_GET['author'] ;
    $email = $_GET['email'] ;
    $url = $_GET['url'] ;
    $message = $_GET['message'] ;
    How do you expect it to work?
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • Users who have thanked abduraooft for this post:

    Crispy (07-24-2008)

  • #3
    Senior Coder djm0219's Avatar
    Join Date
    Aug 2003
    Location
    Wake Forest, North Carolina
    Posts
    1,285
    Thanks
    4
    Thanked 201 Times in 198 Posts
    It's also extremely dangerous to use form variables directly without checking them for validity (especially when creating mail).
    Dave .... HostMonster for all of your hosting needs

  • #4
    New Coder
    Join Date
    Jun 2008
    Posts
    76
    Thanks
    11
    Thanked 0 Times in 0 Posts
    Sorry I haven't really learnt php, this is really the first I've done and was trying to follow a tutorial

  • #5
    New Coder
    Join Date
    Jun 2008
    Posts
    76
    Thanks
    11
    Thanked 0 Times in 0 Posts
    It was a tutorial using jquery to validate, in what was is it dangerous dave ? is there bits i should delete from the html?

  • #6
    Senior Coder djm0219's Avatar
    Join Date
    Aug 2003
    Location
    Wake Forest, North Carolina
    Posts
    1,285
    Thanks
    4
    Thanked 201 Times in 198 Posts
    Quote Originally Posted by Crispy View Post
    It was a tutorial using jquery to validate
    What is jquery and what validation does it do (and of what)?

    Quote Originally Posted by Crispy View Post
    is there bits i should delete from the html?
    Since you don't appear to be using the author, email or url form variables you probably don't need to ask for them in the first place. You might want to consider removing any HTML from the message variable unless you are expecting the message to include HTML.
    Dave .... HostMonster for all of your hosting needs


  •  

    Posting Permissions

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