Results 1 to 4 of 4

Thread: Trouble with a contact form

  1. #1
    ABudgetWebHost is offline Affordable Hosting Services
    Join Date
    Jul 2009
    Blog Entries
    Thanked 6 Times in 2 Posts

    Question Trouble with a contact form

    Hello all! I setup a contact form on one of my websites, and it all worked out just fine but, I am now trying to use that same form on another website, and it is not working.

    Here is the code that is displayed on the page itself:

    <form name="contact_form" action="contact.php" method="get">
    <div class="row">
    Enter your name<br />
    <input name="textfield1"  type="text" class="input" />
    <div class="row">
    Enter your e-mail<br />
    <input name="textfield2"  type="text" class="input" />
    <div class="row1">
    Enter your message<br />
    <textarea name="textfield3" cols="50" rows="10"></textarea>
    <div class="div"><span style="width:97%;">			
    <input name="reset2" type="reset"  value="" style="width:56px; height:20px; background:url(images/button_clear.gif) no-repeat top right;  border:0px none; cursor:hand; cursor:pointer;"/>
    </span>&nbsp;&nbsp;<span style="width:97%;">
    <input name="submit" type="submit"  value="" style="width:56px; height:20px; background:url(images/button_send.gif) no-repeat  top right;  border:0px none; cursor:hand; cursor:pointer;"/>				</span><br />
    </div>								  </div>
    And here is the contact.php code:

    $subject="from ".$_GET['textfield1'];
    $headers= "From: ".$_GET['textfield2']."\n";
     $headers.='Content-type: text/html; charset=iso-8859-1';
    mail("", $subject,  "
     <title>Contact letter</title>
    </html>" , $headers);
    echo ("Your message was successfully sent! <a href="">Click here</a> to go back to our main page.");
    	resizeTo(300, 300)
    The form is placed at but, it should send the emails to admin(AT)afreewebhost(DOT)com.

    The form acts like it's submitting, it says that the message was sent successfully but, I never receive the email? Can any of you tell me what might be the problem here? I looked over and over it but, I'm a beginner when it comes to coding so I'm lost!

    Any help would be GREATLY appreciated! Thanks in advance!

  2. #2
    Will.Spencer's Avatar
    Will.Spencer is offline Retired
    Join Date
    Dec 2008
    Blog Entries
    Thanked 2,329 Times in 1,259 Posts
    It could be a mail setup issue with your hosting company -- unrelated to your source code.

    Instead of rolling my own contact forms, I've usually used nms FormMail.
    Submit Your Webmaster Related Sites to the NB Directory
    I swear, by my life and my love of it, that I will never live for the sake of another man, nor ask another man to live for mine.

  3. #3
    premiumscripts is offline Unknown Net Builder
    Join Date
    Aug 2009
    Thanked 0 Times in 0 Posts
    Yeah, ask your host if you can send mail via PHP if it's another host. Btw, I wouldn't use this script, looks like there are some security vulnerabilities in it.

  4. #4
    SeriousBiz's Avatar
    SeriousBiz is offline Newbie Net Builder
    Join Date
    Jul 2009
    Thanked 8 Times in 7 Posts
    Quote Originally Posted by premiumscripts View Post
    Yeah, ask your host if you can send mail via PHP if it's another host. Btw, I wouldn't use this script, looks like there are some security vulnerabilities in it.
    And very huge indeed. Someone could use it to spam anyone (regardless of you using captcha or not).

    Obviously I'm not releasing how would that be done (to prevent your site from being attacked) - but it's possible.
    Free Male Enhancement Pills Affiliate Program for Webmasters and Internet Marketers
    $25/$30 per free trial. Converts like crazy, even on untargeted traffic (it does for me ).

Similar Threads

  1. any good contact form plugin ?
    By SonnyCooL in forum Wordpress
    Replies: 2
    Last Post: 11 October, 2010, 11:19 AM
  2. [WTS] Business Website Template in PHP with Contact Form
    By yangyang in forum Themes
    Replies: 0
    Last Post: 6 May, 2010, 00:49 AM
  3. How To Create An HTML Contact Us Form?
    By myjimmyjams in forum Web Design
    Replies: 10
    Last Post: 2 March, 2010, 08:47 AM
  4. Contact form module
    By Nazzareno in forum Programming
    Replies: 0
    Last Post: 30 November, 2009, 21:15 PM
  5. How to use a contact form?
    By Logan in forum Blogging
    Replies: 5
    Last Post: 2 July, 2009, 22:12 PM

Tags for this Thread


Posting Permissions

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