Forms

  • Howdy_McGee
  • Novice
  • Novice
  • Howdy_McGee
  • Posts: 16

Post 3+ Months Ago

Ok so I've always used a free form generator to code my forms for me, but the website I've always used updated their policy so that you can only receive 200 email before you have to pay.

I tried coding one myself and connecting it to their server but on Internet Explorer the user would have to enable cookies and I don't know how to fix it so that doesn't happen. So anyway I was wondering if anyone knew a good free form generator?
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • righteous_trespasser
  • Scuffle
  • Genius
  • User avatar
  • Posts: 6230
  • Loc: South-Africa

Post 3+ Months Ago

Why not build your own forms?
  • Howdy_McGee
  • Novice
  • Novice
  • Howdy_McGee
  • Posts: 16

Post 3+ Months Ago

Howdy_McGee wrote:
I tried coding one myself and connecting it to their server but on Internet Explorer the user would have to enable cookies and I don't know how to fix it so that doesn't happen.


This code below looks legit, but whenever I submit the form - for starters it doesn't email me - and it opens the sendmail.php on submit instead of the thank you page that's set up, am i missing something here or should this work?

Form
Code: [ Select ]
<form method="post" action="sendmail.php">
 Email: <input name="email" type="text" /><br />
 Message:<br />
 <textarea name="message" rows="15" cols="40">
 </textarea><br />
 <input type="submit" />
</form>
  1. <form method="post" action="sendmail.php">
  2.  Email: <input name="email" type="text" /><br />
  3.  Message:<br />
  4.  <textarea name="message" rows="15" cols="40">
  5.  </textarea><br />
  6.  <input type="submit" />
  7. </form>


PHP
Code: [ Select ]
<?php
 $email = $_REQUEST['email'] ;
 $message = $_REQUEST['message'] ;

 mail( "", "Feedback Form Results",
  $message, "From: $email" );
 header( "Location: Thank You Page" );
?>
  1. <?php
  2.  $email = $_REQUEST['email'] ;
  3.  $message = $_REQUEST['message'] ;
  4.  mail( "", "Feedback Form Results",
  5.   $message, "From: $email" );
  6.  header( "Location: Thank You Page" );
  7. ?>


-.- I can't post eternal links or the thank you page and mail() would be fill'd out
  • natas
  • PHP Ninja
  • Proficient
  • natas
  • Posts: 308
  • Loc: AFK

Post 3+ Months Ago

Howdy_McGee wrote:
This code below looks legit, but whenever I submit the form - for starters it doesn't email me - and it opens the sendmail.php on submit instead of the thank you page that's set up, am i missing something here or should this work?


When you click the "submit" button, it will send the form data to wherever you specify in your form. In this case you coded action="sendmail.php".

Thus, the form data will be sent to sendmail.php and follow whatever directions that is in this file. EDIT

You can add a thank you note in sendmail.php or you can just change the form action to the url for your thank you page that's already set up.
  • SpooF
  • ٩๏̯͡๏۶
  • Bronze Member
  • User avatar
  • Posts: 3422
  • Loc: Richland, WA

Post 3+ Months Ago

The format for the mail function is:

Code: [ Select ]
mail ( string $to , string $subject , string $message )


The header function needs to be a file or webaddress of somesort, just putting "Thank You Page" doesnt mean anything to it.
  • Howdy_McGee
  • Novice
  • Novice
  • Howdy_McGee
  • Posts: 16

Post 3+ Months Ago

I know I need to specify where the thank you page is, I can't post links on this forum or else it would be different.

Anyway, if I don't put action="sendmail.php" then how does the form know where to look when you click the submit button?
  • SpooF
  • ٩๏̯͡๏۶
  • Bronze Member
  • User avatar
  • Posts: 3422
  • Loc: Richland, WA

Post 3+ Months Ago

You haven't set the to parameter. Thats all that is really wrong.

Code: [ Select ]
<?php
$email = $_REQUEST['email'] ;
$message = $_REQUEST['message'] ;

mail( "", "Feedback Form Results",
 $message, "From: $email" );
header( "Location: Thank You Page" );
?>
  1. <?php
  2. $email = $_REQUEST['email'] ;
  3. $message = $_REQUEST['message'] ;
  4. mail( "", "Feedback Form Results",
  5.  $message, "From: $email" );
  6. header( "Location: Thank You Page" );
  7. ?>

Post Information

  • Total Posts in this topic: 7 posts
  • Users browsing this forum: No registered users and 51 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.