Help with making a survey form

Reply

Join Date: May 2006
Posts: 7
Reputation: qbit is an unknown quantity at this point 
Solved Threads: 0
qbit qbit is offline Offline
Newbie Poster

Help with making a survey form

 
0
  #1
Jun 15th, 2006
Hey guys, I was curious if someone would be able to provide advice on how to do this... Basically I want to create a simple web-form that has a bunch of questions and allows the user to answer them. Then it has to pass the list of questions under one "name" element. Here is what I have so far:

HTML and CSS Syntax (Toggle Plain Text)
  1. <form name="bulletinForm" method="post" target="_self" action="http://bulletin.myspace.com/index.cfm?fuseaction=bulletin.edit">
  2. <input type="hidden" value="0" name="groupID">
  3. <input class="htmlgenscom" type="hidden" maxLength="50" size="1" value="The Greatest Survey Ever!" name="subject">
  4.  
  5. <p>Question 1?</p>
  6. <textarea class="htmlgenscom" name="body" type="hidden" style="width: 0px; height: 0px;" rows="1" cols="20"><ul><li><b>Question 1?</b><br></textarea>
  7. <input type="text" name="body" size="30" maxlength="100" rows="1" cols="20">
  8. <p>Question 2</p>
  9. <textarea class="htmlgenscom" name="body" type="hidden" style="width: 0px; height: 0px;" rows="1" cols="20"></li><li><b>Question 2?</b><br></textarea>
  10. <input type="text" name="body" size="30" maxlength="100" rows="1" cols="20">
  11.  
  12. <textarea class="htmlgenscom" name="body" type="hidden" style="width: 0px; height: 0px;" rows="1" cols="20"></li></ul></textarea><br><br>
  13. <input type=submit class=submit value="Post the Survey on Myspace!" name="submit0" target="_blank">
  14. </form>
Basically it passes these elements to the Myspace bulletin form to automatically post the questions and answers in the users bulletin. It works pretty well how I set it up, except around each answer (the "input type="text"" boxes) there is a comma when you see the output. Alittle confusing I know. You can see a example here: http://www.bloonlabs.com/myspacequiz.htm

Hope someone can help!
Reply With Quote Quick reply to this message  
Join Date: May 2006
Posts: 7
Reputation: qbit is an unknown quantity at this point 
Solved Threads: 0
qbit qbit is offline Offline
Newbie Poster

Re: Help with making a survey form

 
0
  #2
Jun 15th, 2006
I am trying to make it in php so I can "build the textbox" in a php file then have the user submit it. I have two questions however:

1. I am getting lots of random php errors like "unexpected T-string" of which I can see no error...

2. Could I make the php file automatically submit the "textbox" or information to the myspace post bulliton form? Rather than making the user press a second button?

Here is my code (this is only the code within the body tags...):

First page:

HTML and CSS Syntax (Toggle Plain Text)
  1. <div align="center"><form name="bulletinForm" method="post" target="_self" action="submit.php">
  2.  
  3. <p>Who is the last person you high-fived?:
  4. <textarea class="htmlgenscom" name="question1" type="hidden" style="width: 0px; height: 0px;" rows="1" cols="20">Who is the last person you high-fived?</textarea>
  5. <input type="text" name="answer1" size="30" maxlength="100" rows="1" cols="20"></p>
  6.  
  7. <p>If you were drafted into a war, would you survive?:
  8. <textarea class="htmlgenscom" name="question2" type="hidden" style="width: 0px; height: 0px;" rows="1" cols="20">If you were drafted into a war, would you survive?</textarea>
  9. <input type="text" name="answer2" size="30" maxlength="100" rows="1" cols="20"></p>
  10.  
  11. <input type="submit" value="Post this survey on your Myspace!" name="submit">
  12. </form><div align="center">
Here is the php "submit" page:
HTML and CSS Syntax (Toggle Plain Text)
  1. <?php
  2. $question1 = $_POST['question1'];
  3. $question2 = $_POST['question2'];
  4. $answer1 = $_POST['answer1'];
  5. $answer2 = $_POST['answer2'];
  6. echo ("<div align="center"> <form name="bulletinForm" method="post" target="_self" action="bulletin.myspace.com\index.cfm?fuseaction=bulletin.edit"> <input type="hidden" value="0" name="groupID"> <input class="htmlgenscom" type="hidden" maxLength="50" size="1" value="The Greatest Survey Ever" name="subject"> <br> <textarea class="htmlgenscom" name="body" type="hidden" rows="1" cols="20"> ");
  7. echo ($question1 . ": " . $answer1 . "<br> " . $question2 . ": " . $answer2);
  8. echo ("</textarea> <br> <br> <input type="submit" class="submit" value="Press here to Submit!" name="submit" target="_blank"> </form> </div> ");
  9. ?>

A live example can be found here: http://www.bloonlabs.com/myspacequiz/test.htm
Last edited by qbit; Jun 15th, 2006 at 4:54 pm.
Reply With Quote Quick reply to this message  
Join Date: May 2006
Posts: 7
Reputation: qbit is an unknown quantity at this point 
Solved Threads: 0
qbit qbit is offline Offline
Newbie Poster

Re: Help with making a survey form

 
0
  #3
Jun 15th, 2006
Ok, I fixed my unexpected T_string error, but how would I go about making the "submit.php" file automatically submit the text box to the myspace post bulleton?

And another question, how can I make my php-submit form automatically count how many questions and answers are passed onto it?
Last edited by qbit; Jun 15th, 2006 at 5:07 pm.
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 1,655
Reputation: tgreer is an unknown quantity at this point 
Solved Threads: 35
Team Colleague
tgreer tgreer is offline Offline
Made Her Cry

Re: Help with making a survey form

 
0
  #4
Jun 15th, 2006
This isn't the PHP forum, and your project is a bit too involved for the casual volunteer to help out. Forums such as this are best used for very specific questions about a particular aspect of HTML/CSS/JavaScript.
Reply With Quote Quick reply to this message  
Join Date: May 2006
Posts: 7
Reputation: qbit is an unknown quantity at this point 
Solved Threads: 0
qbit qbit is offline Offline
Newbie Poster

Re: Help with making a survey form

 
0
  #5
Jun 15th, 2006
Wow... I am so sorry. I seriously thought that I had clicked the php forum. Crap. Ok, well, I have fixed most of this. Thanks for the reminder. ^_^
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the HTML and CSS Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC