realmainer
-
Posts
18 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Downloads
Gallery
Store
Posts posted by realmainer
-
-
-
I get this Parse error: syntax error, unexpected $end in /home/realmai1/public_html/whitetaildeerpool.com/survey.php on line 87
There is nothing on line 87 but on line 68 is a red mark see photo
Here is the code again
<?php
/* Email Variables */$emailSubject = 'survey!';$webMaster = 'realmainer@gmail.com';/* Data Variables */$fname = $_POST['fname'];$lname = $_POST['lname'];$email = $_POST['email'];$state = $_POST['state'];switch($_POST['rgroup1']) {case "rg1v1":$value = "Radio Group 1 - Value 1 was selected.";break;case "rg1v2":$value = "Radio Group 1 - Value 2 was selected.";switch($_POST['rgroup2']) {case "rg2v1":$value2 = "Radio Group 2 - Value 1 was selected.";break;case "rg2v2":$value2 = "Radio Group 2 - Value 2 was selected.";switch($_POST['rgroup3']) {case "rg3v1":$value3 = "Radio Group 3 - Value 1 was selected.";break;case "rg3v2":$value3 = "Radio Group 3 - Value 2 was selected.";switch($_POST['rgroup4']) {case "rg4v1":$value4 = "Radio Group 4 - Value 1 was selected.";break;case "rg4v2":$value4 = "Radio Group 4 - Value 2 was selected.";$comments = $_POST['comments'];echo $value;echo $value2;echo $value3;echo $value4;$body = <<<EOD<br><hr><br>Name: $fname <br>Name: $lname <br>Email: $email <br>State: $state <br />comments: $comments <br>Comments: $comments <br>EOD;$headers = "From: $email\r\n";$headers .= "Content-type: text/html\r\n";$success = mail($webMaster, $emailSubject, $body,$headers);?>/* Results rendered as HTML */<html><head><title>sent message</title><meta http-equiv="refresh" content="2;URL=http://www.whitetaildeerpool.com">--></style></head><div align="center">thank you for filling out our form !</div></div></body></html> -
I have been working to figure this out. Here are the 2 pages I have The form and PHP page but I can not get it too work can someone tell me what I did wrong?
<form method="post" name="form1" id="form1" action="survey.php"><p><label>First Name<input type="text" name="fname" id="fname" /></label></p><p><label>Last Name<input type="text" name="lname" id="lname" /></label></p><p><label>Email<input type="text" name="email" id="email" /></label></p><p><label>What state you from?<input type="text" name="state" id="state" /></label></p><p><label> Would you like to see a nation wide pool? Winner by antler size.<br /><input type="radio" name="rgroup1" value="rg1v1"> yes<input type="radio" name="rgroup1" value="rg1v2"> no</label></p><p><label> Would you like to see a Maine State wide pool? Winner by weight.<br /><input type="radio" name="rgroup2" value="rg2v1"> yest<input type="radio" name="rgroup2" value="rg2v2"> no</label></p><p><label> Would you like to see a Sanford Maine local pool? Winner by weight. All deer would be put on the same scale in Sanford. <br /><input type="radio" name="rgroup3" value="excellent"> yes<input type="radio" name="rgroup3" value="good"> no</label></p><p><label> Would you be willing to pay $10.00 for the Nation wide pool? <br /><input type="radio" name="rgroup4" value="excellent"> yes<input type="radio" name="rgroup4" value="good"> no</label><br /></p><p><label>Comments <br /><textarea name="comments" id="comments" cols="45" rows="5"></textarea></label></p><p><input name="submit" type="submit" class="buttons" id="submit" value="Send" /></p></form>Now the PHP page<?php/* Email Variables */$emailSubject = 'survey!';$webMaster = 'realmainer@gmail.com';/* Data Variables */$fname = $_POST['fname'];$lname = $_POST['lname'];$email = $_POST['email'];$comments = $_POST['comments'];$body = <<<EOD<br><hr><br>Name: $fname <br>Name: $lname <br>Email: $email <br>Comments: $comments <br>EOD;$headers = "From: $email\r\n";$headers .= "Content-type: text/html\r\n";$success = mail($webMaster, $emailSubject, $body,$headers);/* Results rendered as HTML */$theResults = <<<EOD<html><head><title>sent message</title><meta http-equiv="refresh" content="2;URL=http://www.whitetaildeerpool.com/.html">--></style></head><div align="center">thank you for filling out our form !</div></div></body></html>EOD;echo "$theResults";?> -
-
I have been watching videos and have not found anything yet that can help me to get radio group to work See my code and see if you can help me. I have tried different things I put XXXX in were I thing I need some thing I also think I need something in the first line were the form starts
<form method="post" name="form1" id="form1" action="survey.php"><p><label>First Name<input type="text" name="fname" id="fname" /></label></p><p><label>Last Name<input type="text" name="lname" id="lname" /></label></p><p><label>Email<input type="text" name="email" id="email" /></label></p><p><label>What state you from?<input type="text" name="state" id="state" /></label></p><p><label> Would you like to see a nation wide pool? Winner by antler size.<br /><input type="radio" name="RadioGroup1" value="yes" id="RadioGroup1_0" />yes</label><br /><label><input type="radio" name="RadioGroup1" value="no" id="RadioGroup1_1" />no</label></p><p><label> Would you like to see a Maine State wide pool? Winner by weight.<br /><input type="radio" name="RadioGroup2" value="yes" id="RadioGroup2_0" />yes</label><br /><label><input type="radio" name="RadioGroup2" value="no" id="RadioGroup2_1" />no</label></p><p><label> Would you like to see a Sanford Maine local pool? Winner by weight. All deer would be put on the same scale in Sanford. <br /><input type="radio" name="RadioGroup3" value="yes" id="RadioGroup3_0" />yes</label><br /><label><input type="radio" name="RadioGroup3" value="no" id="RadioGroup3_1" />no</label></p><p><label> Would you be willing to pay $10.00 for the Nation wide pool? <br /><input type="radio" name="RadioGroup4" value="yes" id="RadioGroup4_0" />yes</label><br /><label><input type="radio" name="RadioGroup4" value="no" id="RadioGroup4_1" />no</label><br /></p><p><label>Comments <br /><textarea name="comments" id="comments" cols="45" rows="5"></textarea></label></p><p><input name="submit" type="submit" class="buttons" id="submit" value="Send" /></p></form><!--ends form-->This PHP below is in a external file<?php/* Email Variables */$emailSubject = 'survey!';$webMaster = 'realmainer@gmail.com';/* Data Variables */$fname = $_POST['fname'];$lname = $_POST['lname'];$email = $_POST['email'];XXXXXXXXXXXXXXXXXXXXX I think I need something here for each group I haveXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX$comments = $_POST['comments'];$body = <<<EOD<br><hr><br>Name: $fname <br>Name: $lname <br>Email: $email <br>Comments: $comments <br>EOD;$headers = "From: $email\r\n";$headers .= "Content-type: text/html\r\n";$success = mail($webMaster, $emailSubject, $body,$headers);/* Results rendered as HTML */$theResults = <<<EOD<html><head><title>sent message</title><meta http-equiv="refresh" content="2;URL=http://www.whitetaildeerpool.com">--></style></head><div align="center">thank you for filling out our form !</div></div></body></html>EOD;echo "$theResults";?> -
-
-
When looking at programming, you need to try to figure out what you are really doing at the most basic level.
So in this case, you say you have a survey form to create ... all that means, is that you need to create a form and be able to use PHP to capture the information people fill into the form.
It doesn't matter if it is a 'survey' form or a 'contact' form or say a 'fruit and vegetables' form - when it comes down to it, it is all the same.
In general, most web programming is:
1. Just capturing user inputted information in html forms, cleaning it and inserting it into databases.
2. Then the sending it back to web pages.
This is an oversimplification but nonetheless, it is pretty much it.
Stefan
Yes it sound simple. But my server told me I need it to be a php. That is were I am ost. As I can not figure out how to get the php to work with the form
-
I bought complete web programming. I have been watching the videos and need to know what I missed. I am trying to get a survey form to work. My host place tells me I have to have it in php. I have been trying to see what video shows it to me. Can anyone tell me which one. I have watched all the php ones and did not see it.
-
Not certain what page you want me to send. Do you want the setting page for chrome?
Hi Stefan I think I am alset. I re installed it and it is working now. That is wierd that the other pages worked but not the main page. But it works now so thanks for the help
-
It some sort of configuration problem ... can you send us a screenshot of our config / path settings?
Stef
Not certain what page you want me to send. Do you want the setting page for chrome?
-
Then it is not a WAMP issue, it is a path or link issue.
Stef
Okay I tried it in firefox. and it still does not work. Can you or anyone tell me how to fix this?
-
Oh wait, it is just your index page you can't see .. but other sub pages you can?
Stef
Yes that is right all of them work put the index page.
-
Weird, it looks like Wamp is running. Did you try putting in an index.html page?
Stef
Yes it is running as I can go to the other pages.
-
-
No picture to see ... can you try uploading it again?
Stef
I did upload it again
-
Php Form
in PHP
Posted
okay here are 2 of the 4 switches I put the closing } and I get the error on each line I put that closing } There has to be another reason why.