Jump to content
xisto Community
Sign in to follow this  
Jesse

Help With Html Code Feedback Form

Recommended Posts

I have this HTML Code:

  <br><br><font class="content">All comments and suggestions about this web site are very welcome and a valuable source of information for us. Thanks!</font>    <FORM METHOD="post" ACTION="modules.php?name=Feedback">
    <P><strong>Your Name:</strong><br>
    <INPUT type="text" NAME="sender_name" VALUE="" SIZE=30></p>
    <P><strong>Your Email:</strong><br>
    <INPUT type="text" NAME="sender_email" VALUE="" SIZE=30></p>
    <P><strong>Message:</strong><br>
    <TEXTAREA NAME="message" COLS=30 ROWS=5 WRAP=virtual></TEXTAREA></p>
    <INPUT type="hidden" name="opi" value="ds">
    <P><INPUT TYPE="submit" NAME="submit" VALUE="Send"></p>
    </FORM></center>


However, a problem that I have is the fact that I dont know how to set up the code to send it to an Email address. I am not that good with HTML Coding and would be grateful for assistance in setting this up. Thank you.

Share this post


Link to post
Share on other sites

I have this HTML Code:

However, a problem that I have is the fact that I dont know how to set up the code to send it to an Email address. I am not that good with HTML Coding and would be grateful for assistance in setting this up. Thank you.

207590[/snapback]


you would also have to find a script that translates the input fields in to an easy to read format when you get it sent to your inbox.

 

i believe trap 17 has a free form handler script with their free hosting (not sure).

 

i am not an expert in forms or html but i do know that if you don't format the results, what shows up in your inbox will be a complete mess.

 

i know this may not have helped, but you were asking about how to get the results to your inbox, but you also need to format the results. i believe bravenet and other websites are good for doing this for you for free(but unprofessional with the ads they put up after someone fills out the forum(but they still work great)

Share this post


Link to post
Share on other sites

you would also have to find a script that translates the input fields in to an easy to read format when you get it sent to your inbox.

 

i believe trap 17 has a free form handler script with their free hosting (not sure).

 

i am not an expert in forms or html but i do know that if you don't format the results, what shows up in your inbox will be a complete mess.

 

i know this may not have helped, but you were asking about how to get the results to your inbox, but you also need to format the results. i believe bravenet and other websites are good for doing this for you for free(but unprofessional with the ads they put up after someone fills out the forum(but they still work great)

207606[/snapback]

Yea the have free form handler in CGI and I agree it would still be great.

Share this post


Link to post
Share on other sites

I dont have a PHP Source Code. I got a template of a website and that is what I am using. However there is no PHP information in there with any of the files.Is there a way that I can keep this template and add in a PHP code or something like that. I have not much idea of HTML and absolutley NO knowledge of ANY PHP at all.It is something that I am wanting to learn, just dont have the time to learn it and get my site ready for its Grand Opening.

Share this post


Link to post
Share on other sites

1. Change your code to the following, only change i have made is .php file name and handler. Instead of Modules.php?name=feedback i have put process.php.

<br><br><font class="content">All comments and suggestions about this web site are very welcome and a valuable source of information for us. Thanks!</font>    <FORM METHOD="post" ACTION="process.php">    <P><strong>Your Name:</strong><br>    <INPUT type="text" NAME="sender_name" VALUE="" SIZE=30></p>    <P><strong>Your Email:</strong><br>    <INPUT type="text" NAME="sender_email" VALUE="" SIZE=30></p>    <P><strong>Message:</strong><br>    <TEXTAREA NAME="message" COLS=30 ROWS=5 WRAP=virtual></TEXTAREA></p>    <INPUT type="hidden" name="opi" value="ds">    <P><INPUT TYPE="submit" NAME="submit" VALUE="Send"></p>    </FORM></center>

2. Load a new page and enter the following code.
<?php// The error message if there are one or more fields not filled in$error = "There are some fields not filled in, <a href="javascript:history.go(-1)">Click here to go back</a>";// Let's check if all fields are filled in!if($sender_name == "" || $sender_email == "" || $message == ""){// Lets echo that error!;)  echo $error;}/*  if after all everything is filled in correct, lets start doing the mailscript...  Edit the variable's below to make them fit your needs*/else{$yourwebsite = "http://something.com"; // Your website$recipientname = "Yourname"; // Whats your name ?!$subject="E-mail from yoursite";  // The subject of the mail thats being sended$recipient="you@something.com"; // the recipient/*  The headers for the e-mail, no need to change it unless you know what you're doing*/$header = "From: $nickname <$email>rn";$header .= "MIME-Version: 1.0rn";$header .= "Content-Type: text/html; charset=iso-8859-1rn";$header .= "X-Priority: 3rn";$header .= "X-MSMail-Priority: Normalrn";$header .= "X-Mailer: PHP / ".phpversion()."rn";/*  You can change the text below to whatever you wish to have  for the way the mail is gonne be outputted, you can use HTML!*/$content= "Dear $recipientname, $sender_name has sended you an e-mail from $yourwebsite.<br /><b>Message:</b>$message<hr noshade="true" size="1" color="#000000" />You can contact $sender_name back at $sender_email.";// Lets send the e-mail by using the mail() function, no need to change below...this can be edited above!mail($recipient, $content, $header);// Message the user will see if the e-mail is succesfully sended :)echo "Thanks! Your comments has been sended succesfull $sender_name.";}?>

3. Name this file 'process.php', without qoutation marks.
4. Upload to a directory.

You can insert the code into any HTML document between the <body> tages. This allows you to make the page look & feel like the rest of your site. REMEMBER TO CHANGE THINGS IN THE CODE!!

This is how it will work, visiters will fillin the form, then click submit. The browser will then load the process.php page and run the script, the script will check to make sure all fields are filled out. Then it will send the email to your email address that you change above!

Code above in step 2 edited from HERE

Share this post


Link to post
Share on other sites

Ok I have done everything that you said there and uploaded it all to my website. Now when I try to send in a Feedback Form I get this message:


Parse error: parse error, unexpected T_STRING in /home/zcnet/public_html/process.php on line 3

Any idea on how I can fix this? This is what the code looks like in my: process.php file:

<?php// The error message if there are one or more fields not filled in
$error = "There are some fields not filled in, <a

href="javascript:http://forums.xisto.com/no_longer_exists/ here to go back</a>";

// Let's check if all fields are filled in!
if($sender_name == "" || $sender_email == "" || $message == ""){
// Lets echo that error!B)
echo $error;
}

/*
if after all everything is filled in correct, lets start doing the mailscript...
Edit the variable's below to make them fit your needs
*/
else{
$yourwebsite = "http://forums.xisto.com/no_longer_exists/;; // Your website
$recipientname = "ZN Support"; // Whats your name ?!
$subject="Support Form";  // The subject of the mail thats being sended
$recipient="support@zaccynetwork.com"; // the recipient

/*
The headers for the e-mail, no need to change it unless you know what you're doing
*/
$header = "From: $nickname <$email>rn";
$header .= "MIME-Version: 1.0rn";
$header .= "Content-Type: text/html; charset=iso-8859-1rn";
$header .= "X-Priority: 3rn";
$header .= "X-MSMail-Priority: Normalrn";
$header .= "X-Mailer: PHP / ".phpversion()."rn";

/*
You can change the text below to whatever you wish to have
for the way the mail is gonne be outputted, you can use HTML!
*/
$content= "
Dear $recipientname, $sender_name has sended you an e-mail from $yourwebsite.<br />
<b>Message:</b>
$message
<hr noshade="true" size="1" color="#000000" />
You can contact $sender_name back at $sender_email.";

// Lets send the e-mail by using the mail() function, no need to change below...this can be

edited above!
mail($recipient, $content, $header);

// Message the user will see if the e-mail is succesfully sended B)
echo "Thanks! Your comments has been sended succesfull $sender_name.";
}
?>


Share this post


Link to post
Share on other sites

Try this code fix:

<?php// The error message if there are one or more fields not filled in$error = "There are some fields not filled in, <ahref=\"http://forums.xisto.com/no_longer_exists/ here to go back</a>";// Let's check if all fields are filled in!if($sender_name == "" || $sender_email == "" || $message == ""){// Lets echo that error!;)echo $error;}/*if after all everything is filled in correct, lets start doing the mailscript...Edit the variable's below to make them fit your needs*/else{
$yourwebsite = "zaccynetwork.com"; // Your website$recipientname = "ZN Support"; // Whats your name ?!$subject="Support Form";  // The subject of the mail thats being sended$recipient="support@zaccynetwork.com"; // the recipient/*The headers for the e-mail, no need to change it unless you know what you're doing*/$header = "From: $nickname <$email>\r\n";$header .= "MIME-Version: 1.0\r\n";$header .= "Content-Type: text/html; charset=iso-8859-1\r\n";$header .= "X-Priority: 3\r\n";$header .= "X-MSMail-Priority: Normal\r\n";$header .= "X-Mailer: PHP / ".phpversion()."\r\n";/*You can change the text below to whatever you wish to havefor the way the mail is gonne be outputted, you can use HTML!*/$content= "Dear " . $recipientname . "," . $sender_name . " has sended you an e-mail from " . $yourwebsite . ".<br /><b>Message:</b>" . $message . "<hr noshade=\"true\" size=\"1\" color=\"#000000\" />You can contact " . $sender_name . " back at " . $sender_email . ".";// Lets send the e-mail by using the mail() function, no need to change below...this // can be edited above!mail($recipient, $subject, $content, $header);// Message the user will see if the e-mail is succesfully sended :)echo "Thanks! Your comments has been sended succesfully, " . $sender_name . ".";}?>
Okay should be fixed now B) The main problem was that backslashes weren't used.

Share this post


Link to post
Share on other sites

Nope, your problem is where you have replaceed the small Java part at the top to send users back. Try the following:

<?php// The error message if there are one or more fields not filled in$error = "There are some fields not filled in, <a href="javascript:history.go(-1)">Click here to go back</a>";// Let's check if all fields are filled in!if($sender_name == "" || $sender_email == "" || $message == ""){// Lets echo that error!;)echo $error;}/*if after all everything is filled in correct, lets start doing the mailscript...Edit the variable's below to make them fit your needs*/else{
$yourwebsite = "zaccynetwork.com"; // Your website$recipientname = "ZN Support"; // Whats your name ?!$subject="Support Form";  // The subject of the mail thats being sended$recipient="support@zaccynetwork.com"; // the recipient/*The headers for the e-mail, no need to change it unless you know what you're doing*/$header = "From: $nickname <$email>rn";$header .= "MIME-Version: 1.0rn";$header .= "Content-Type: text/html; charset=iso-8859-1rn";$header .= "X-Priority: 3rn";$header .= "X-MSMail-Priority: Normalrn";$header .= "X-Mailer: PHP / ".phpversion()."rn";/*You can change the text below to whatever you wish to havefor the way the mail is gonne be outputted, you can use HTML!*/$content= "Dear $recipientname, $sender_name has sended you an e-mail from $yourwebsite.<br /><b>Message:</b>$message<hr noshade="true" size="1" color="#000000" />You can contact $sender_name back at $sender_email.";// Lets send the e-mail by using the mail() function, no need to change below...this can be edited above!mail($recipient, $content, $header);// Message the user will see if the e-mail is succesfully sended echo "Thanks! Your comments has been sended succesfull $sender_name.";}?>

Share this post


Link to post
Share on other sites

Sorry guys just one more thing with this php script. Is there a way to add to this bit:

// Message the user will see if the e-mail is succesfully sended echo "Thanks! Your comments has been sended succesfull $sender_name.";
}


What I want to add in a A Return Link to the Main Website Address. Thanx again for all your help with this one B)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.