Form Question
Hi guys!
I am currently re-designing my site and I have created a form but when tested it doesn't go to my inbox...do you have any idea why???
The URL for the form is:
[URL=http://cmdirector.neosurge.net/stories.shtml ]Form[/URL]
The code for the form is below:
Your Name
Your E-Mail (needs to be valid)
Story Category
CM 01/02
CM 4
The Weird World of CM
My Cup Glory
The Dizzy Heights of Relegation
Story Title
Your Story
I hope you guys can help!
nike_guy_man posted this at 18:07 — 16th November 2002.
They have: 840 posts
Joined: Sep 2000
Take out the first
That seems to be messing it up
Timewell posted this at 18:11 — 16th November 2002.
They have: 344 posts
Joined: Jun 2002
Right...that seems to work but it uses the user's browser...is there another way of doing this???
Timewell posted this at 18:15 — 16th November 2002.
They have: 344 posts
Joined: Jun 2002
Can you test it for me???
What would the title of the e-mail be??? Do I have to put that into the blank space just next to submit???
nike_guy_man posted this at 18:57 — 16th November 2002.
They have: 840 posts
Joined: Sep 2000
What are you trying to do here?
Are you trying to have it open up the user's email program to send it?
If you want it to go through the browser and send to your email, you should use a server-side script in PHP or PERL... There are many already written that you'd just have to upload to your site
If you are trying to have it open in the user's email program, use a link, like
<a href="mailto:[email protected]?Subject=Subject">
The Webmistress posted this at 19:06 — 16th November 2002.
She has: 5,586 posts
Joined: Feb 2001
The best thing to so is first check whether your host has a premade script you can use to handle the form and if so they'll give the path to put in the form action to process it. Alternatively you will have to use a script to process the form, as nike said, using a server-side script. See what the hosting company says and then report back here.
Julia - if life was meant to be easy Michael Angelo would have painted the floor....
Busy posted this at 21:03 — 16th November 2002.
He has: 6,151 posts
Joined: May 2001
add enctype="text/plain" into the form tag and use the subject section
nike_guy_man mentioned and it should send you all the details of the form to you.
if you use similar forms for different topics, add a hidden input for the form title, like so:
Timewell posted this at 23:18 — 16th November 2002.
They have: 344 posts
Joined: Jun 2002
no pre-made script but they told me to get one from HotScripts.com
Timewell posted this at 00:34 — 17th November 2002.
They have: 344 posts
Joined: Jun 2002
I haven't but wonder if you guys can recommend one...
Busy posted this at 03:50 — 17th November 2002.
He has: 6,151 posts
Joined: May 2001
are you able to use PHP or ASP etc?
The Webmistress posted this at 10:24 — 17th November 2002.
She has: 5,586 posts
Joined: Feb 2001
If you can't use php or asp then see if you can install a cgi-script and the most common one is from Matt's Script Archive which you download, modify and upload to your cgi-bin. I believe php or asp are more secure though.
Julia - if life was meant to be easy Michael Angelo would have painted the floor....
Timewell posted this at 13:25 — 17th November 2002.
They have: 344 posts
Joined: Jun 2002
Yes my host supports PHP so can i have a Php script and how do I use it???
The Webmistress posted this at 13:59 — 17th November 2002.
She has: 5,586 posts
Joined: Feb 2001
Do you know anything about php? Often it isn't just a case of using a script, you have to know how to amend it for your purposes and integrate it into your site. Here are a couple of pre-made ones I found on google:
http://php.resourceindex.com/Complete_Scripts/Form_Processing
http://www.cluxa.com/products/afh/doc/index.shtml
Julia - if life was meant to be easy Michael Angelo would have painted the floor....
Timewell posted this at 16:32 — 17th November 2002.
They have: 344 posts
Joined: Jun 2002
No I haven't a clue
Timewell posted this at 20:37 — 18th November 2002.
They have: 344 posts
Joined: Jun 2002
I have been told to place this in my first row:
<form action="mailto:[email protected]" method="POST" enctype="text/plain">
'That won't give me a subject title will it???
no1golfpro.co.uk - High quality golf equipment at competitive prices.
The Webmistress posted this at 20:55 — 18th November 2002.
She has: 5,586 posts
Joined: Feb 2001
If you want the subject line to be entered automatically change the code to this:
<form action="mailto:[email protected]?subject=Whatever" method="POST" enctype="text/plain">
'Julia - if life was meant to be easy Michael Angelo would have painted the floor....
Timewell posted this at 21:14 — 18th November 2002.
They have: 344 posts
Joined: Jun 2002
Thanks for that!
I have added the line but so far I have not recieved any e-mail from someone I asked to test it. Should the e-mail arrive straight away?
no1golfpro.co.uk - High quality golf equipment at competitive prices.
Jack Michaelson posted this at 21:34 — 18th November 2002.
He has: 1,733 posts
Joined: Dec 1999
Yes that email should arrive pretty straight away...
But you could test it yourself, or post the address of the site here so that some of us can help you by testing it .
Shakespeare: onclick || !(onclick)
Suzanne posted this at 22:59 — 18th November 2002.
She has: 5,507 posts
Joined: Feb 2000
The other issues that you'll have using mailto: in the action attribute of a form are:
1. Your+data+will+look+like+this.
2. It's not secure and generates an alert message to the user that you cannot disable telling them this is a very very very insecure method.
It's better to learn how to do this properly (server-side script) than to bother learning how to do it with mailto:, really.
Timewell posted this at 17:16 — 19th November 2002.
They have: 344 posts
Joined: Jun 2002
Ok...but I do not know php. Is it easy to pick up and there are thousands of these form scripts. How do I know which one to choose?
Suzanne posted this at 18:07 — 19th November 2002.
She has: 5,507 posts
Joined: Feb 2000
Good questions. If you're not familiar with server-side languages, or programming in general, I wouldn't say that PHP is easy to pick up. However, the mail application is very easy in PHP if you don't want form validation (which you should want).
If you're going to try to build it yourself, post in the Server-Side forum, otherwise, check out the ones that are available, test them (to see if they do what you want).
You will have to do this sooner or later, so take this opportunity to start figuring things out for yourself by testing the scripts, and reading up on what should be included in a form processor (try Google or AllTheWeb for pages related to this). You don't need to learn how to script it yourself, but you should be able to determine what features you need.
Timewell posted this at 19:06 — 19th November 2002.
They have: 344 posts
Joined: Jun 2002
ok..thanks for your help!
I will go try that!
Suzanne posted this at 19:50 — 19th November 2002.
She has: 5,507 posts
Joined: Feb 2000
If you run into problems with installation, or really get horribly stuck, the Server-Side forum is the place to go for help. Good luck!
Timewell posted this at 20:11 — 29th November 2002.
They have: 344 posts
Joined: Jun 2002
I have decided to use this script:
Form Processor
What do you reckon about it? Is it ok?
Timewell posted this at 20:23 — 29th November 2002.
They have: 344 posts
Joined: Jun 2002
A bit of a stumper has cropped up! I don't know where exactly to stop adding my HTML and where to put "THE CODE".
Hope you can help!
Here is the page which I want to put the code in. Stories Page
The code of the page is:
<html>
<head>
<title></title>
</head>
<body>
<?php
// EDIT FROM HERE ONWARDS
// Your name. e.g. $y_name = "Alicia";
$y_name = "";
// Your email. e.g. $y_email = "alicia@some_email.com";
$y_email = "";
// Auto response option - yes or no. e.g. $autor = "yes";
$autor = "";
/* Message for auto response mail. e.g. $autor_mail = "Thanks for filling up the form at my site. I will get back to you shortly"; If you don't want auto response ignore this */
$autor_mail = "";
/* Subject of the Autoresponse Mail. e.g. $autor_subject = "Auto Response Email"; */
$autor_subject = "";
/* The URL the form will redirect to after processing the email form. e.g. $after = "thanks.html"; */
$after = "";
/* The required fields for the form. e.g. $rfields = "name,email,message"; separate fields with a comma. the fields are what that is found in:
<input type="text" name="email">
the name part. in this case, it is email. another example.
<input type="text" name="bla">
so in this case it is bla. if you don't want any required fields, just leave this thing blank(default)*/
$rfields = "name,email";
// DO NOT EDIT ANY FURTHER PLEASE.
if (isset($sent)) {
if (!$rfields == "") {
$rfields = explode(",", $rfields);
for($i = 0; $i < count($rfields); $i++) {
if ($$rfields[$i] == "") {
echo "You have not filled up the required field <b>$rfields[$i]</b>. Please click <a href=\"javascript:history.back(1)\">here</a> to go back and fill up the required field. Thank You.";
exit;
}
}
}
if (!ereg('^[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+'.
'@'.
'[-!#$%&\'*+\\/0-9=?A-Z^_`a-z{|}~]+\.'.
'[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+$', $email)) {
echo "Your email, $email, is not valid. Please click <a href=\"javascript:history.back(1)\">here</a> to fill in a proper email. Thank You.";
exit;
}
$fmail = "$y_name, you have received an email form. The following contains the information.\n\n";
$fmail.= "IP Address: $REMOTE_ADDR\n";
$fields = array_keys($HTTP_POST_VARS);
for($i = 0; $i < count($fields); $i++) {
$temp = $fields[$i];
if ($temp == "rfields" || $temp == "submit" || $temp == "sent" || $temp == "y_name" || $temp == "y_email" || $temp == "autor" || $temp == "autor_message" || $temp == "$autor_mail" || $temp == "$autor_subject" || $temp == "after")
$fmail = $fmail;
else {
$temp1 = stripslashes($HTTP_POST_VARS[$temp]);
$fmail.= "$temp: $temp1\n";
}
}
$fmail.= "\nThank you for using CesMailForm(<a href="http://wonderful.frenzied.org" class="bb-url">http://wonderful.frenzied.org</a>)";
$mailed = mail($y_email, "Email Form", $fmail, "Wrom: JEXXIMQZUIVOTQNQE
if ($autor == "yes")
{
$autor_subject = stripslashes($autor_subject);
$autor_mail = stripslashes($autor_mail);
mail($email, $autor_subject, $autor_mail, "Wrom: MSFDULHPQQWOYIYZUNNYC
}
if(!$mailed) {
echo "There is something wrong with the script or the configuration. How about emailing <a href=\"mailto:$y_email\">the site owner</a>?";
}
echo "<meta HTTP-EQUIV=\"REFRESH\" content=\"0; url=$after\">";
} else {
?>
<form action="<? echo ($_SERVER['PHP_SELF']); ?>" method="post">
<!-- FORM. EDIT THE FORM. PLEASE USE PROPER HTML. -->
Name: <input type="text" name="name"><br><br>
Email: <input type="text" name="email"><br><br>
Message: <textarea rows="4" name="message"></textarea><br><br>
<input type="submit" name="submit" value="Submit">
<!-- DO NOT EDIT -->
<input type="hidden" name="sent" value="yes">
</form>
<?
}
?>
<!-- FREE TO EDIT AGAIN -->
</body>
</html>
So hope you can help!
no1golfpro.co.uk - High quality golf equipment at competitive prices.
Busy posted this at 22:25 — 29th November 2002.
He has: 6,151 posts
Joined: May 2001
place the above code where you want the form to go
(the bottom bit of the code is the visible bit)
dont add anything above <?php or anything below
Suzanne posted this at 22:39 — 29th November 2002.
She has: 5,507 posts
Joined: Feb 2000
You don't know how to put your code around that code? Is that the problem?
Edit: whoops, busy scooped me again.
Timewell posted this at 23:15 — 29th November 2002.
They have: 344 posts
Joined: Jun 2002
yeah that is the problem!
Suzanne posted this at 00:36 — 30th November 2002.
She has: 5,507 posts
Joined: Feb 2000
Put this where you want the form:
<?php
// EDIT FROM HERE ONWARDS
// Your name. e.g. $y_name = "Alicia";
$y_name = "";
// Your email. e.g. $y_email = "alicia@some_email.com";
$y_email = "";
// Auto response option - yes or no. e.g. $autor = "yes";
$autor = "";
/* Message for auto response mail. e.g. $autor_mail = "Thanks for filling up the form at my site. I will get back to you shortly"; If you don't want auto response ignore this */
$autor_mail = "";
/* Subject of the Autoresponse Mail. e.g. $autor_subject = "Auto Response Email"; */
$autor_subject = "";
/* The URL the form will redirect to after processing the email form. e.g. $after = "thanks.html"; */
$after = "";
/* The required fields for the form. e.g. $rfields = "name,email,message"; separate fields with a comma. the fields are what that is found in:
<input type="text" name="email">
the name part. in this case, it is email. another example.
<input type="text" name="bla">
so in this case it is bla. if you don't want any required fields, just leave this thing blank(default)*/
$rfields = "name,email";
// DO NOT EDIT ANY FURTHER PLEASE.
if (isset($sent)) {
if (!$rfields == "") {
$rfields = explode(",", $rfields);
for($i = 0; $i < count($rfields); $i++) {
if ($$rfields[$i] == "") {
echo "You have not filled up the required field <b>$rfields[$i]</b>. Please click <a href=\"java script:history.back(1)\">here</a> to go back and fill up the required field. Thank You.";
exit;
}
}
}
if (!ereg('^[-!#$%&'*+\\./0-9=?A-Z^_`a-z{|}~]+'.
'@'.
'[-!#$%&'*+\\/0-9=?A-Z^_`a-z{|}~]+\.'.
'[-!#$%&'*+\\./0-9=?A-Z^_`a-z{|}~]+$', $email)) {
echo "Your email, $email, is not valid. Please click <a href=\"java script:history.back(1)\">here</a> to fill in a proper email. Thank You.";
exit;
}
$fmail = "$y_name, you have received an email form. The following contains the information.\n\n";
$fmail.= "IP Address: $REMOTE_ADDR\n";
$fields = array_keys($HTTP_POST_VARS);
for($i = 0; $i < count($fields); $i++) {
$temp = $fields[$i];
if ($temp == "rfields" || $temp == "submit" || $temp == "sent" || $temp == "y_name" || $temp == "y_email" || $temp == "autor" || $temp == "autor_message" || $temp == "$autor_mail" || $temp == "$autor_subject" || $temp == "after")
$fmail = $fmail;
else {
$temp1 = stripslashes($HTTP_POST_VARS[$temp]);
$fmail.= "$temp: $temp1\n";
}
}
$fmail.= "\nThank you for using CesMailForm(<a href="http://wonderful.frenzied.org" class="bb-url">http://wonderful.frenzied.org</a>)";
$mailed = mail($y_email, "Email Form", $fmail, "Wrom: JEXXIMQZUIVOTQNQE
if ($autor == "yes")
{
$autor_subject = stripslashes($autor_subject);
$autor_mail = stripslashes($autor_mail);
mail($email, $autor_subject, $autor_mail, "Wrom: MSFDULHPQQWOYIYZUNNYC
}
if(!$mailed) {
echo "There is something wrong with the script or the configuration. How about emailing <a href=\"mailto:$y_email\">the site owner</a>?";
}
echo "<meta HTTP-EQUIV=\"REFRESH\" content=\"0; url=$after\">";
} else {
?>
<form action="<? echo ($_SERVER['PHP_SELF']); ?>" method="post">
<!-- FORM. EDIT THE FORM. PLEASE USE PROPER HTML. -->
Name: <input type="text" name="name"><br><br>
Email: <input type="text" name="email"><br><br>
Message: <textarea rows="4" name="message"></textarea><br><br>
<input type="submit" name="submit" value="Submit">
<!-- DO NOT EDIT -->
<input type="hidden" name="sent" value="yes">
</form>
<?
}
?>
<!-- FREE TO EDIT AGAIN -->
Timewell posted this at 00:40 — 30th November 2002.
They have: 344 posts
Joined: Jun 2002
So that overwrites my original form code does it? Well how do I encorporate my form into that? Or have I misread you?
Suzanne posted this at 00:50 — 30th November 2002.
She has: 5,507 posts
Joined: Feb 2000
Okey, dude, where the tags are in the sample above, put your own , et cetera tags. Just don't change anything where it says DO NOT EDIT.
Timewell posted this at 11:34 — 30th November 2002.
They have: 344 posts
Joined: Jun 2002
Does it matter if the code is a mixture of HTML and the form is php?
Timewell posted this at 11:44 — 30th November 2002.
They have: 344 posts
Joined: Jun 2002
This is the bit of forum code! I haven't uploaded it yet but I would like you to look at it first:
/* The required fields for the form. e.g. $rfields = "Name,E-Mail,Category,Story Title,Your Story"; separate fields with a comma. the fields are what that is found in:
<input type="text" name="name">
the name part. in this case, it is email. another example.
<input type="text" name="email">
<SELECT NAME="category" SIZE=2 MULTIPLE>
<OPTION SELECTED> CM 01/02
<OPTION> CM 4
<OPTION> The Weird World of CM
<OPTION> My Cup Glory
<OPTION> The Dizzy Heights of Relegation
</SELECT>
<input type="text" name="name" size="15">
<textarea name="comment" cols="25" rows="8"></textarea>
so in this case it is bla. if you don't want any required fields, just leave this thing blank(default)*/
$rfields = "name,email";
// DO NOT EDIT ANY FURTHER PLEASE.
no1golfpro.co.uk - High quality golf equipment at competitive prices.
Suzanne posted this at 15:39 — 30th November 2002.
She has: 5,507 posts
Joined: Feb 2000
You can't have two fields called name.
/* The required fields for the form. e.g. $rfields = "Name,E-Mail,Category,Story Title,Your Story"; separate fields with a comma. the fields are what that is found in:
the name part. in this case, it is email. another example.
*/
CM 01/02
CM 4
The Weird World of CM
My Cup Glory
The Dizzy Heights of Relegation
/* so in this case it is bla. if you don't want any required fields, just leave this thing blank(default)*/
$rfields = "category,name,comment";
// DO NOT EDIT ANY FURTHER PLEASE.
Okay, you need to learn how to read the code.
Everything that is in italics is a PHP comment. It's not part of the PHP code, and not part of the HTML, it's just notes to you.
Everything that is in bold is PHP that you need to edit.
Everything else is HTML.
However, where are the <? ?> parts? PHP should always be enclosed within the document in the opening <? bracket and the ?> closing bracket.
Timewell posted this at 16:08 — 30th November 2002.
They have: 344 posts
Joined: Jun 2002
That is the code with your changes:
Should I just cut and paste my old form code and put the relevant required fields in the place?
<?php
// EDIT FROM HERE ONWARDS
// Your name. e.g. $y_name = "Rob";
$y_name = "";
// Your email. e.g. $y_email = "[email protected]";
$y_email = "";
// Auto response option - yes or no. e.g. $autor = "yes";
$autor = "";
/* Message for auto response mail. e.g. $autor_mail = "Thank You for submitting a story! I hope to enjoy reading it and I will get back to you telling you when it is on the site!"; If you don't want auto response ignore this */
$autor_mail = "";
/* Subject of the Autoresponse Mail. e.g. $autor_subject = "Story Form Reply"; */
$autor_subject = "";
/* The URL the form will redirect to after processing the email form. e.g. $after = "http://cmdirector.neosurge.net/stories.shtml"; */
$after = "";
<SELECT NAME="category" SIZE=2 MULTIPLE>
<OPTION SELECTED> CM 01/02
<OPTION> CM 4
<OPTION> The Weird World of CM
<OPTION> My Cup Glory
<OPTION> The Dizzy Heights of Relegation
</SELECT>
<input type="text" name="name" size="15">
<textarea name="comment" cols="25" rows="8"></textarea>
$rfields = "category,name,comment";
// DO NOT EDIT ANY FURTHER PLEASE.
if (isset($sent)) {
if (!$rfields == "") {
$rfields = explode(",", $rfields);
for($i = 0; $i < count($rfields); $i++) {
if ($$rfields[$i] == "") {
echo "You have not filled up the required field <b>$rfields[$i]</b>. Please click <a href=\"java script:history.back(1)\">here</a> to go back and fill up the required field. Thank You.";
exit;
}
}
}
if (!ereg('^[-!#$%&'*+\\./0-9=?A-Z^_`a-z{|}~]+'.
'@'.
'[-!#$%&'*+\\/0-9=?A-Z^_`a-z{|}~]+\.'.
'[-!#$%&'*+\\./0-9=?A-Z^_`a-z{|}~]+$', $email)) {
echo "Your email, $email, is not valid. Please click <a href=\"java script:history.back(1)\">here</a> to fill in a proper email. Thank You.";
exit;
}
$fmail = "$y_name, you have received an email form. The following contains the information.\n\n";
$fmail.= "IP Address: $REMOTE_ADDR\n";
$fields = array_keys($HTTP_POST_VARS);
for($i = 0; $i < count($fields); $i++) {
$temp = $fields[$i];
if ($temp == "rfields" || $temp == "submit" || $temp == "sent" || $temp == "y_name" || $temp == "y_email" || $temp == "autor" || $temp == "autor_message" || $temp == "$autor_mail" || $temp == "$autor_subject" || $temp == "after")
$fmail = $fmail;
else {
$temp1 = stripslashes($HTTP_POST_VARS[$temp]);
$fmail.= "$temp: $temp1\n";
}
}
$fmail.= "\nThank you for using CesMailForm(<a href="http://wonderful.frenzied.org" class="bb-url">http://wonderful.frenzied.org</a>)";
$mailed = mail($y_email, "Email Form", $fmail, "Wrom: JEXXIMQZUIVOTQNQE
if ($autor == "yes")
{
$autor_subject = stripslashes($autor_subject);
$autor_mail = stripslashes($autor_mail);
mail($email, $autor_subject, $autor_mail, "Wrom: MSFDULHPQQWOYIYZUNNYC
}
if(!$mailed) {
echo "There is something wrong with the script or the configuration. How about emailing <a href=\"mailto:$y_email\">the site owner</a>?";
}
echo "<meta HTTP-EQUIV=\"REFRESH\" content=\"0; url=$after\">";
} else {
?>
<form action="<? echo ($_SERVER['PHP_SELF']); ?>" method="post">
<!-- FORM. EDIT THE FORM. PLEASE USE PROPER HTML. -->
Name: <input type="text" name="name"><br><br>
Email: <input type="text" name="email"><br><br>
Message: <textarea rows="4" name="message"></textarea><br><br>
<input type="submit" name="submit" value="Submit">
<!-- DO NOT EDIT -->
<input type="hidden" name="sent" value="yes">
</form>
<?
}
?>
<!-- FREE TO EDIT AGAIN -->
no1golfpro.co.uk - High quality golf equipment at competitive prices.
Suzanne posted this at 16:15 — 30th November 2002.
She has: 5,507 posts
Joined: Feb 2000
Timewell, you need to learn how to read what goes where... Why are you not paying attention to the very clear instructions in the code?
Here's the corrected code:
<?php
// EDIT FROM HERE ONWARDS
// Your name. e.g. $y_name = "Rob";
$y_name = "<strong>PUT YOUR NAME HERE!</strong>";
// Your email. e.g. $y_email = "[email protected]";
$y_email = "<strong>PUT YOUR EMAIL HERE!</strong>";
// Auto response option - yes or no. e.g. $autor = "yes";
$autor = "<strong>PUT YOUR CHOICE HERE!</strong>";
/* Message for auto response mail. e.g. $autor_mail = "Thank You for submitting a story! I hope to enjoy reading it and I will get back to you telling you when it is on the site!"; If you don't want auto response ignore this */
$autor_mail = "<strong>PUT YOUR MESSAGE HERE!</strong>";
/* Subject of the Autoresponse Mail. e.g. $autor_subject = "Story Form Reply"; */
$autor_subject = "<strong>PUT YOUR SUBJECT HERE!</strong>";
/* The URL the form will redirect to after processing the email form. e.g. $after = "http://cmdirector.neosurge.net/stories.shtml"; */
$after = "<strong>PUT YOUR URL HERE!</strong>";
<strong>REMOVED YOUR FORM FIELDS FROM THIS SECTION</strong>
$rfields = "category,name,comment";
// DO NOT EDIT ANY FURTHER PLEASE.
if (isset($sent)) {
if (!$rfields == "") {
$rfields = explode(",", $rfields);
for($i = 0; $i < count($rfields); $i++) {
if ($$rfields[$i] == "") {
echo "You have not filled up the required field <b>$rfields[$i]</b>. Please click <a href=\"java script:history.back(1)\">here</a> to go back and fill up the required field. Thank You.";
exit;
}
}
}
if (!ereg('^[-!#$%&'*+\\./0-9=?A-Z^_`a-z{|}~]+'.
'@'.
'[-!#$%&'*+\\/0-9=?A-Z^_`a-z{|}~]+\.'.
'[-!#$%&'*+\\./0-9=?A-Z^_`a-z{|}~]+$', $email)) {
echo "Your email, $email, is not valid. Please click <a href=\"java script:history.back(1)\">here</a> to fill in a proper email. Thank You.";
exit;
}
$fmail = "$y_name, you have received an email form. The following contains the information.\n\n";
$fmail.= "IP Address: $REMOTE_ADDR\n";
$fields = array_keys($HTTP_POST_VARS);
for($i = 0; $i < count($fields); $i++) {
$temp = $fields[$i];
if ($temp == "rfields" || $temp == "submit" || $temp == "sent" || $temp == "y_name" || $temp == "y_email" || $temp == "autor" || $temp == "autor_message" || $temp == "$autor_mail" || $temp == "$autor_subject" || $temp == "after")
$fmail = $fmail;
else {
$temp1 = stripslashes($HTTP_POST_VARS[$temp]);
$fmail.= "$temp: $temp1\n";
}
}
$fmail.= "\nThank you for using CesMailForm(<a href="http://wonderful.frenzied.org" class="bb-url">http://wonderful.frenzied.org</a>)";
$mailed = mail($y_email, "Email Form", $fmail, "Wrom: JEXXIMQZUIVOTQNQE
if ($autor == "yes")
{
$autor_subject = stripslashes($autor_subject);
$autor_mail = stripslashes($autor_mail);
mail($email, $autor_subject, $autor_mail, "Wrom: MSFDULHPQQWOYIYZUNNYC
}
if(!$mailed) {
echo "There is something wrong with the script or the configuration. How about emailing <a href=\"mailto:$y_email\">the site owner</a>?";
}
echo "<meta HTTP-EQUIV=\"REFRESH\" content=\"0; url=$after\">";
} else {
?>
" method="post">
THIS IS WHERE THE FORM FIELDS GO -- IN THE FORM!
CM 01/02
CM 4
The Weird World of CM
My Cup Glory
The Dizzy Heights of Relegation
SEE?
<?
}
?>
Timewell posted this at 16:18 — 30th November 2002.
They have: 344 posts
Joined: Jun 2002
oops! I didn't see that!
Timewell posted this at 16:25 — 30th November 2002.
They have: 344 posts
Joined: Jun 2002
Well I got most of the form working apart from getting a load of rubbish when I upload it:
What have I done wrong now? *Don't shout at me :(*
Suzanne posted this at 16:26 — 30th November 2002.
She has: 5,507 posts
Joined: Feb 2000
Apparently!
Here's a quick run down on commenting:
/* this is a comment for php, css and a number of other languages (C-style) and is used to comment out multiple lines of notes */
// this is a one line comment
// it's good for JavaScript, PHP
// it ends when you hit "enter" on your keyboard
# this is a one line comment for Perl (et cetera)
So, then, anything within a comment cannot be used by the processor. In order for it to work, variables and their values need to be outside of the comments.
Does that help?
Suzanne posted this at 16:29 — 30th November 2002.
She has: 5,507 posts
Joined: Feb 2000
Wow, well apparently the code is leaking through instead of being processed. You do know that the page has to be .php or .php3 (on older servers) in order to be parsed?
Suzanne posted this at 16:30 — 30th November 2002.
She has: 5,507 posts
Joined: Feb 2000
Lol, sorry. I wasn't trying to shout at you, just make it really really really clear where you should be editing.
Timewell posted this at 16:30 — 30th November 2002.
They have: 344 posts
Joined: Jun 2002
I renamed it to stories.php and got 3 errors:
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home/virtual/site21/fst/var/www/html/stories.php on line 139
Warning: Unexpected character in input: '\' (ASCII=92) state=1 in /home/virtual/site21/fst/var/www/html/stories.php on line 139
Parse error: parse error, unexpected '.' in /home/virtual/site21/fst/var/www/html/stories.php on line 139
no1golfpro.co.uk - High quality golf equipment at competitive prices.
Suzanne posted this at 16:37 — 30th November 2002.
She has: 5,507 posts
Joined: Feb 2000
Okay, good! Now you need to go to those lines and see what the problem is. I can't see that, so you'll have to either save the file as stories.phps (as well as the stories.php) so I can view the source code (Mark, does you viewer work on other people's source code?) or tell me what's on the line 139...
Timewell posted this at 16:40 — 30th November 2002.
They have: 344 posts
Joined: Jun 2002
This is the code on Line 139:
if (!ereg('^[-!#$%&'*+\\./0-9=?A-Z^_`a-z{|}~]+'.
Suzanne posted this at 17:03 — 30th November 2002.
She has: 5,507 posts
Joined: Feb 2000
That's only part of a line. Where's the rest of it? An if statement needs to end like this (in this case):
)) {
Timewell posted this at 17:11 — 30th November 2002.
They have: 344 posts
Joined: Jun 2002
Nope that is the whole of the line.
Suzanne posted this at 17:26 — 30th November 2002.
She has: 5,507 posts
Joined: Feb 2000
Well that's wrong, lol. It can't end there.
Save the file as stories.phps and put the url here and I'll take a look and see if I can find the problem.
Timewell posted this at 17:37 — 30th November 2002.
They have: 344 posts
Joined: Jun 2002
The link for you
Suzanne posted this at 18:08 — 30th November 2002.
She has: 5,507 posts
Joined: Feb 2000
Okay, here's the whole problem area. I haven't checked the syntax, please post i the scripting forum for that.
if (!ereg('^[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+'.'@'.'[-!#$%&\'*+\\/0-9=?A-Z^_`a-z{|}~]+\.'.'[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+$', $email)) {
echo "Your email, $email, is not valid. Please click <a href=\"java script:history.back(1)\">here</a> to fill in a proper email. Thank You.";
exit;
}
$fmail = "$y_name, you have received an email form. The following contains the information.\n\n";
$fmail.= "IP Address: $REMOTE_ADDR\n";
$fields = array_keys($HTTP_POST_VARS);
for($i = 0; $i < count($fields); $i++) {
$temp = $fields[$i];
if ($temp == "rfields" || $temp == "submit" || $temp == "sent" || $temp == "y_name" || $temp == "y_email" || $temp == "autor" || $temp == "autor_message" || $temp == "$autor_mail" || $temp == "$autor_subject" || $temp == "after")
$fmail = $fmail;
else {
$temp1 = stripslashes($HTTP_POST_VARS[$temp]);
$fmail.= "$temp: $temp1\n";
}
}
$fmail.= "\nThank you for using CesMailForm(<a href="http://wonderful.frenzied.org" class="bb-url">http://wonderful.frenzied.org</a>)";
$mailed = mail($y_email, "Email Form", $fmail, "Wrom: JEXXIMQZUIVOTQNQE");
if ($autor == "yes")
{
$autor_subject = stripslashes($autor_subject);
$autor_mail = stripslashes($autor_mail);
mail($email, $autor_subject, $autor_mail, "Wrom: MSFDULHPQQWOYIYZUNNYC");
}
Lines 139 - 166
The lines with the Wrom parts in them (um? is that in the original script) were not terminated properly (missing "); at the ends), and the line 139 had a whole raft of unescaped ' and was on multiple lines. As I said, I didn't check the syntax, but these are fairly bizarre errors -- have you done any other editing, or have you got the original script?
Suzanne posted this at 18:11 — 30th November 2002.
She has: 5,507 posts
Joined: Feb 2000
Note: some of the escaping out is not showing up on the forums, so don't cut and paste. Go here instead: synapticimpulse.com/timewell.phps
I'll remove the page in the next day or so, so copy it to your own server for getting help from the other forum.
Timewell posted this at 00:00 — 1st December 2002.
They have: 344 posts
Joined: Jun 2002
Thanks I have that!
Why isn't there a submit button? What is the code for a Select menu?
Suzanne posted this at 01:51 — 1st December 2002.
She has: 5,507 posts
Joined: Feb 2000
Because you didn't put one in.
test
Timewell posted this at 19:39 — 1st December 2002.
They have: 344 posts
Joined: Jun 2002
ok, here is the new URL:
http://www.cmdirector.neosurge.net/stories.php
How can I make the Category dropdown have items in it? and also why has the white border got bigger?
no1golfpro.co.uk - High quality golf equipment at competitive prices.
Suzanne posted this at 22:42 — 1st December 2002.
She has: 5,507 posts
Joined: Feb 2000
Timewell, I can't help you if you won't help yourself, hon.
is the TAG, if you want something to display, it has to go inside it...
News
Or alternatively,
The Value of the form goes for INPUT tags, but you put words between OPTION and TEXTAREA tags.
Okay, you're on your own from here good buddy!
Timewell posted this at 17:03 — 4th December 2002.
They have: 344 posts
Joined: Jun 2002
Sorry to be a pain but this should be my last or second to last post in this thread. I just want to ask two questions!
1. How do I make the box to appear next to Category? (The drop-down!)
2. Why is my border messed up? I haven't altered any values.
no1golfpro.co.uk - High quality golf equipment at competitive prices.
Timewell posted this at 17:08 — 5th December 2002.
They have: 344 posts
Joined: Jun 2002
Help would be much appreciated! I just need this and then my forms are finished!
Suzanne posted this at 18:39 — 5th December 2002.
She has: 5,507 posts
Joined: Feb 2000
1. put it in the correct table cell.
2. probably a problem with the table.
htmlvalidator.com
http://validator.w3.org
Timewell posted this at 21:20 — 6th December 2002.
They have: 344 posts
Joined: Jun 2002
What do you mean when you say the correct table? Should the code by lower down? ie.
<tr>
<td align="centre"><font color="#5500ee">Category</font></td>
<select id="category">
<option id="CM 01/02">CM 01/02</option>
<option id="CM 4">CM 4</option>
<option id="The Weird World of CM">The Weird World of CM</option>
<option id="My Cup Glory">My Cup Glory</option>
<option id="The Dizzy Heights of Relegation">The Dizzy Heights of Relegation</option>
</select>
</tr>
get rid of ?
no1golfpro.co.uk - High quality golf equipment at competitive prices.
Suzanne posted this at 21:35 — 6th December 2002.
She has: 5,507 posts
Joined: Feb 2000
so, say you use the validator, you think it would notice that you don't have that select box IN a table cell at all? I think it would. Why not try it?
Come on, Timewell, give it a go!
Timewell posted this at 22:16 — 6th December 2002.
They have: 344 posts
Joined: Jun 2002
What do I do when the Validator has finished its trial period? Is there any more free ones which can be downloaded from the net, that are good?
Suzanne posted this at 23:47 — 6th December 2002.
She has: 5,507 posts
Joined: Feb 2000
The second validator is online, Timewell...
Timewell posted this at 23:50 — 6th December 2002.
They have: 344 posts
Joined: Jun 2002
Well I have spotted the form error myself! How clumsy of me! :blush:
But the border thing is really stumping me. There was no reference to it in the Validator and the online thing says I need a DocType whatever one of them is...
no1golfpro.co.uk - High quality golf equipment at competitive prices.
Timewell posted this at 00:38 — 7th December 2002.
They have: 344 posts
Joined: Jun 2002
It is ok! I fixed it! My footer was wrong...
Timewell posted this at 01:28 — 7th December 2002.
They have: 344 posts
Joined: Jun 2002
I now get this error:
When testing the form and after filling it in, I get the message that I haven't filled in the Category field when I have...
Suzanne posted this at 02:57 — 7th December 2002.
She has: 5,507 posts
Joined: Feb 2000
And you've checked to make sure that your select id or name is the same as the field name you set as required?
Timewell posted this at 10:45 — 7th December 2002.
They have: 344 posts
Joined: Jun 2002
How do you set a field so that it is required? At the moment it is:
Category
CM 01/02
CM 4
The Weird World of CM
My Cup Glory
The Dizzy Heights of Relegation
no1golfpro.co.uk - High quality golf equipment at competitive prices.
Timewell posted this at 17:31 — 7th December 2002.
They have: 344 posts
Joined: Jun 2002
Is the problem occuring because I am missing some code?
Suzanne posted this at 23:00 — 7th December 2002.
She has: 5,507 posts
Joined: Feb 2000
If you don't validate your code first, how are you going to learn?
As for making it required, read back through this thread, I answered that before.
Timewell posted this at 20:21 — 23rd December 2002.
They have: 344 posts
Joined: Jun 2002
Hi!
I didn't really want to bring this thread up again but I thought it would be best to.
Is it possible to run more than one form using the same script but on different pages? I used the fixed script that you did Suzanne, many thanks for that! But I get this error:
It is like the one I used to have so I think it must be that you cannot run two scripts yeah?
http://cmdirector.neosurge.net/general/jobcentre.shtml
no1golfpro.co.uk - High quality golf equipment at competitive prices.
Timewell posted this at 23:18 — 24th December 2002.
They have: 344 posts
Joined: Jun 2002
I think I should have started a new thread!
Busy posted this at 00:29 — 25th December 2002.
He has: 6,151 posts
Joined: May 2001
you can run two scripts on one page as long as the variable names arent the same, just having one the same can cause big problems
Abhishek Reddy posted this at 02:16 — 25th December 2002.
He has: 3,348 posts
Joined: Jul 2001
Seems to me you possibly have incorrect tags <?php missing or misplaced for the second (?) part, so it won't be parsed. Can you post the whole source code of the page here?
Timewell posted this at 12:07 — 26th December 2002.
They have: 344 posts
Joined: Jun 2002
It's ok guys! I have fixed it! The reason was that I didn't save it as .php!
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.