Create FORM in RSD with out using WFD...

User 2699991 Photo


Registered User
5,402 posts
Online Now

Hello everybody

I really need someones help with this.

I have done a form and put it into a site temporarily
I have done a .php thing.

All works fine the fields on the form the send button etc etc, I get the e-mail as expected the problem is that although the e-mail turns up and the fields are listed there is nothing to see, just seems empty.

I have looked at it for a while now and don't really understand whats going on. My problem is the client requires forms now (after years of just using mailto: ) but needs to see something in operation and is pressing me. hopefully someone can help point me in the right direction

here is the html code for the actual form
<div class="wrapper">
<div id="main" style="padding:50px 0 0 0;">

<!-- Form -->
<form id="contact-form" action="mail.php" method="POST">
<h3b>Get In Touch</h3b>
<div>
<label>
<span>Name: (required)</span>
<input placeholder="Please enter your name" type="text" tabindex="1" required autofocus>
</label>
</div>
<div>
<label>
<span>Email: (required)</span>
<input placeholder="Please enter your email address" type="email" tabindex="2" required>
</label>
</div>
<div>
<label>
<span>Telephone: </span>
<input placeholder="Please enter your number" type="tel" tabindex="3" >
</label>
</div>
<div><label>
<span> Subject</span>
<div>
<select id="subject2" name="subject2" class="field select medium" tabindex="11">
<option value="Say Hello">Say Hello</option>
<option value="Get Into Gossip">Get Into Gossip</option>
<option value="Advertise">Advertise</option>
</select>
</div>
</label>
</div>
<div>
<label>
<span>Anything Else To Say: </span>
<textarea placeholder="Keep It Fairly Short &amp; Sweet" tabindex="5" ></textarea>
</label>
</div>
<div>
<button name="submit" type="submit" id="contact-submit">Send Email</button>
</div>
</form>
<!-- /Form -->

</div>
</div>

here is the code for the php

<?php
$name = $_POST['name'];
$email = $_POST['email'];
$subject2 = $POST['subject2'];
$message = $_POST['message'];
$formcontent=" From: $name ";
$recipient = "wayanjayainbali@gmail.com";
$subject = "Contact Form";
$mailheader = "From: $email \r\n";
mail($recipient, $subject, $formcontent, $mailheader) or die("Error!");
echo "Thank You! We Will Get Back To You As Soon as Humanly Possible";
?>

Here is an attached image of the email I receive when the form has been submitted


Attachments:
Mastering The Understanding With Hands-On Learning
NEW TO "COFFEECUP SITE DESIGNER" FOUNDATION 6 FRAMEWORK?
STUCK ON SOMETHING?

LEARNING & UNDERSTANDING "THE HOW TO"? THE WHY'S & THE WHEREFORE'S?
WITH WAYAN'S STEP BY STEP TUTORIALS


A simple quick way to contact me
https://rsd-tutorialscom.coffeecup.com/index.html
User 2623310 Photo


Ambassador
282 posts

Give Me Couple minutes to look your code.

Can you post your files? I need to edit them for you.

Thanks
User 2623310 Photo


Ambassador
282 posts

Wayanjaya wrote:
Hello everybody

I really need someones help with this.

I have done a form and put it into a site temporarily
I have done a .php thing.

All works fine the fields on the form the send button etc etc, I get the e-mail as expected the problem is that although the e-mail turns up and the fields are listed there is nothing to see, just seems empty.

I have looked at it for a while now and don't really understand whats going on. My problem is the client requires forms now (after years of just using mailto: ) but needs to see something in operation and is pressing me. hopefully someone can help point me in the right direction

here is the html code for the actual form
<div class="wrapper">
<div id="main" style="padding:50px 0 0 0;">

<!-- Form -->
<form id="contact-form" action="mail.php" method="POST">
<h3b>Get In Touch</h3b>
<div>
<label>
<span>Name: (required)</span>
<input placeholder="Please enter your name" type="text" tabindex="1" required autofocus>
</label>
</div>
<div>
<label>
<span>Email: (required)</span>
<input placeholder="Please enter your email address" type="email" tabindex="2" required>
</label>
</div>
<div>
<label>
<span>Telephone: </span>
<input placeholder="Please enter your number" type="tel" tabindex="3" >
</label>
</div>
<div><label>
<span> Subject</span>
<div>
<select id="subject2" name="subject2" class="field select medium" tabindex="11">
<option value="Say Hello">Say Hello</option>
<option value="Get Into Gossip">Get Into Gossip</option>
<option value="Advertise">Advertise</option>
</select>
</div>
</label>
</div>
<div>
<label>
<span>Anything Else To Say: </span>
<textarea placeholder="Keep It Fairly Short &amp; Sweet" tabindex="5" ></textarea>
</label>
</div>
<div>
<button name="submit" type="submit" id="contact-submit">Send Email</button>
</div>
</form>
<!-- /Form -->

</div>
</div>

here is the code for the php

<?php
$name = $_POST['name'];
$email = $_POST['email'];
$subject2 = $POST['subject2'];
$message = $_POST['message'];
$formcontent=" From: $name ";
$recipient = "wayanjayainbali@gmail.com";
$subject = "Contact Form";
$mailheader = "From: $email \r\n";
mail($recipient, $subject, $formcontent, $mailheader) or die("Error!");
echo "Thank You! We Will Get Back To You As Soon as Humanly Possible";
?>

Here is an attached image of the email I receive when the form has been submitted




Give this a try:

Find this in your code

$formcontent=" From: $name ";

replaced it with this

$formcontent=" From: $name \n Email: $email \n Subject2: $subject2 \n Message: $message";
User 2699991 Photo


Registered User
5,402 posts
Online Now

Ok trhank you Scott Im on with getting then to you now
Mastering The Understanding With Hands-On Learning
NEW TO "COFFEECUP SITE DESIGNER" FOUNDATION 6 FRAMEWORK?
STUCK ON SOMETHING?

LEARNING & UNDERSTANDING "THE HOW TO"? THE WHY'S & THE WHEREFORE'S?
WITH WAYAN'S STEP BY STEP TUTORIALS


A simple quick way to contact me
https://rsd-tutorialscom.coffeecup.com/index.html
User 2699991 Photo


Registered User
5,402 posts
Online Now

have a look at these whilst I try your suggestion,
Get this going and the Beers are on me next time you are in Bali :D:D:D:D:D:D:D:D:D:D:D:D:D
Attachments:
Mastering The Understanding With Hands-On Learning
NEW TO "COFFEECUP SITE DESIGNER" FOUNDATION 6 FRAMEWORK?
STUCK ON SOMETHING?

LEARNING & UNDERSTANDING "THE HOW TO"? THE WHY'S & THE WHEREFORE'S?
WITH WAYAN'S STEP BY STEP TUTORIALS


A simple quick way to contact me
https://rsd-tutorialscom.coffeecup.com/index.html
User 2699991 Photo


Registered User
5,402 posts
Online Now

got this
Attachments:
Mastering The Understanding With Hands-On Learning
NEW TO "COFFEECUP SITE DESIGNER" FOUNDATION 6 FRAMEWORK?
STUCK ON SOMETHING?

LEARNING & UNDERSTANDING "THE HOW TO"? THE WHY'S & THE WHEREFORE'S?
WITH WAYAN'S STEP BY STEP TUTORIALS


A simple quick way to contact me
https://rsd-tutorialscom.coffeecup.com/index.html
User 2623310 Photo


Ambassador
282 posts

I'm testing the code now. Waiting for the email to show up.
User 2699991 Photo


Registered User
5,402 posts
Online Now

Good Morning, Afternoon or Evening depending on where in the world you are

First of all Scott I really hope I didn't cause you too much trouble yesterday

I finally got all the fields to work except the multiple choice subject field no matter what I tried just keeps returning blank. I even changed it to tick boxes, same thing, I just can't get it to work on that fields. I was really wanting just to have one form that covered all of the reasons visitors would use the form (i.e Just general chit chat, Advertising Inquiry (Enquiry depending on your style of English) or Newsletter registration.

Still looking for some help with how to solve the multiple choice problem

Thanks

Wayan
Mastering The Understanding With Hands-On Learning
NEW TO "COFFEECUP SITE DESIGNER" FOUNDATION 6 FRAMEWORK?
STUCK ON SOMETHING?

LEARNING & UNDERSTANDING "THE HOW TO"? THE WHY'S & THE WHEREFORE'S?
WITH WAYAN'S STEP BY STEP TUTORIALS


A simple quick way to contact me
https://rsd-tutorialscom.coffeecup.com/index.html
User 2699991 Photo


Registered User
5,402 posts
Online Now

Hello again everybody,

Final Update (I Hope)

Got It working Phew!!!!!!!! except for the multiple choice I would like it so that the visitors can only select one of the choices (at the moment all can be selected but it only delivers the last choice) obviously some sort of check/validation needed anyone know how to do that, also while we are at it how about a validation check for proper e-mail format, telephone number etc I have sorted out the required fields such that if they don't fill the field it comes up with a message to remind them they need fill the required field.

Thanks again for any help that you can give or suggestions for where to look

Wayan

Mastering The Understanding With Hands-On Learning
NEW TO "COFFEECUP SITE DESIGNER" FOUNDATION 6 FRAMEWORK?
STUCK ON SOMETHING?

LEARNING & UNDERSTANDING "THE HOW TO"? THE WHY'S & THE WHEREFORE'S?
WITH WAYAN'S STEP BY STEP TUTORIALS


A simple quick way to contact me
https://rsd-tutorialscom.coffeecup.com/index.html
User 13432 Photo


Registered User
7 posts

Here's where I got my form data:
HTML Form provided by: www.freecontactform.com

Please paste the code from htmlform.htm into your webpage.

Open the file html_form_send.php in your code editor and add your Email Address and Subject Line to the places indicated by code comments.

Enjoy your free script.


I did modify it. I figured that if the form had errors then I'd want them to see my error page. The authors had a simple one.

http://dba2020.com/images/thankyou.png

So I added to their script:

function died($error) {
// your error code can go here
echo "<!DOCTYPE html>";

echo " <head>";
echo " <link href=\"/favicon.ico\" rel=\"shortcut icon\" />";
echo " <meta charset=\"utf-8\">";
echo " <title>Doing Business At 2020 Insight\!</title>";
echo "<style>";
echo " .wrap { width:960px; margin:0 auto;}";
echo "</style>";
echo " </head>";
echo " <body style=\"background-image:url('images/contactus2.jpg');background-repeat:no-repeat;background-position:center;\">";
echo " <div class=\"wrap\">";
echo "<center>";
echo "<img src=\"http://www.dba2020.com/images/header.jpg\" width=\"480px\" height=\"120px\">";
echo "<br><br>";
echo "<h3>Doing business At 2020 Insight!</h3>";
echo "<br><br><br>";
echo "We're sorry, but there's errors found with the form you submitted.<br /><br />";
echo $error."<br /><br />";
echo "Please go back and fix these errors.<br /><br />";
echo "&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ";
echo "<a href=\"javascript:history.back()\"><img src=\"images\backswirl.gif\"></a>";
echo "</center>";

echo " </div>";

echo " </body>";
echo "</html>";
die();
}


If the submitter entered good information then I redirected them to a page of my choice - ThankYou.html. Firefox seems to balk since I have NoScript active.

<meta http-equiv="refresh" content="1; URL=http://www.dba2020.com/thankyou.html">


http://dba2020.com/images/thankyousuccess.png

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.