Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Strange difficulty adding info to MYSQL

Status
Not open for further replies.

fishspan

Technical User
Joined
Nov 25, 2003
Messages
3
Location
CA
Hi,

I have what seems to be a strange problem. I have an online form that works fine as long as I don't have the command in my script:

ACTION=MembershipConfirmation.php

If I take this single command out, all of my data enters my database no problem. But add it in....nothing.

Strangest thing is: It does lilnk to /membershipconfirmation.php upon submission of the form when this command is included. The data simply doesn't enter the database.

Any suggestions??? I'm assuming that it must be a really simple, stupid problem, but for the life of me I can't figure it out.

Thanks,
Matt
 
show the code that creates the form...there might be an issue with quotes or something else...let us have alook

Bastien

Any one have a techie job in Toronto, I need to work...being laid off sucks!
 
Hey Bastien - I'm in Toronto too.

Here's the form code. I apologize for its relative mess: blame Frontpage. I'm a relative newbie who felt Frontpage would make my life easier. The code is now a Frontpage hybrid, because I've begun trying to add my own code to it....I'm beginning to see the light.

Again, the problem is that when I add ACTION=membershipconfirmation.php to the code, the link to this page works...but the membership form doesn't enter my MySql database.

# connect to database
$cid = mysql_connect($host,$usr,$pwd);
if (!$cid) { echo("ERROR: " . mysql_error() . "\n"); }

?>
<HTML>
<HEAD>
<TITLE>Membership Form</TITLE>

</HEAD>

<?
# this is processed when the form is submitted
# back on to this page (POST METHOD)
if ($REQUEST_METHOD==&quot;POST&quot;) {

# double-up apostrophes
$description = str_replace(&quot;'&quot;,&quot;''&quot;,$description);
$sitename = str_replace(&quot;'&quot;,&quot;''&quot;,$sitename);

# setup SQL statement
$SQL = &quot; INSERT INTO Members &quot;;
$SQL = $SQL . &quot; (firstname, lastname, address1, address2, city, province, postalcode, home, work, email, gender, age, height, weight, hair, eye, smoker, children, status, religion, reason, samereligion, wantnosmoker, wantother, how_heard ) VALUES &quot;;
$SQL = $SQL . &quot; ('$firstname', '$lastname','$address1','$address2', '$city', '$province', '$postalcode', '$home', '$work', '$email', '$gender', '$age', '$height', '$weight', '$hair', '$eye', '$smoker', '$children', '$status', '$religion', '$reason', '$samereligion', '$wantnosmoker', '$wantother', '$how_heard') &quot;;

#execute SQL statement
$result = mysql_db_query($db,&quot;$SQL&quot;,$cid);

# check for error
if (!$result) { echo(&quot;ERROR: &quot; . mysql_error() . &quot;\n$SQL\n&quot;); }

}

?>
<form method=&quot;POST&quot; ACTION=MembershipConfirmation.php>
<table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; line-height: 100%&quot; bordercolor=&quot;#111111&quot; width=&quot;103%&quot; id=&quot;AutoNumber1&quot; height=&quot;40&quot;>
<tr>
<td width=&quot;25%&quot; height=&quot;15&quot;></td>
<td width=&quot;79%&quot; height=&quot;15&quot;><b>
<font face=&quot;Verdana&quot; color=&quot;#C0C0C0&quot; style=&quot;font-size: 9pt&quot;>&nbsp;
</font></b>
<p style=&quot;margin-top: 6; margin-bottom: 6&quot;><b><font face=&quot;Verdana&quot; style=&quot;font-size: 9pt&quot; color=&quot;#C0C0C0&quot;>&nbsp
</font></b></p>
<p style=&quot;margin-top: 6; margin-bottom: 6&quot;><b>
<font face=&quot;Verdana&quot; style=&quot;font-size: 9pt&quot; color=&quot;#C0C0C0&quot;>&nbsp

First Name</font><font face=&quot;Verdana&quot; color=&quot;#C0C0C0&quot;><span style=&quot;font-size: 9pt&quot;>:</span></font></b><font face=&quot;Verdana&quot;><b><font color=&quot;#C0C0C0&quot;><span style=&quot;font-size: 9pt&quot;>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type=&quot;text&quot; name=&quot;firstname&quot; size=&quot;18&quot;></span></font><font color=&quot;#C0C0C0&quot; style=&quot;font-size: 9pt&quot;>&nbsp;&nbsp;&nbsp;

Last Name:&nbsp;&nbsp;&nbsp;
<input type=&quot;text&quot; name=&quot;lastname&quot; size=&quot;21&quot;></font></b></font></td>
</tr>
<tr>
<td width=&quot;25%&quot; height=&quot;16&quot;></td>
<td width=&quot;79%&quot; height=&quot;16&quot;></p>
<p style=&quot;margin-top: 6; margin-bottom: 6&quot;>&nbsp; <b>
<font face=&quot;Verdana&quot; color=&quot;#C0C0C0&quot; style=&quot;font-size: 9pt&quot;>&nbsp;&nbsp; Street

Address:</font></b><font face=&quot;Verdana&quot; color=&quot;#C0C0C0&quot;><b><span style=&quot;font-size: 9pt&quot;>&nbsp;
<input type=&quot;text&quot; name=&quot;address1&quot; size=&quot;61&quot;></span></b></font></td>
</tr>
<tr>
<td width=&quot;25%&quot; height=&quot;16&quot;></td>
<td width=&quot;79%&quot; height=&quot;16&quot;></p>
<p style=&quot;margin-top: 6; margin-bottom: 6&quot;>&nbsp; <b>
<font face=&quot;Verdana&quot; color=&quot;#C0C0C0&quot; style=&quot;font-size: 9pt&quot;>&nbsp;&nbsp;

City:&nbsp;
<input type=&quot;text&quot; name=&quot;city&quot; size=&quot;11&quot;></font><font face=&quot;Verdana&quot; size=&quot;2&quot; color=&quot;#C0C0C0&quot; style=&quot;font-size: 9pt&quot;>&nbsp;&nbsp;

Province: <select size=&quot;1&quot; name=&quot;province&quot;>
<option>BC</option>
<option>ON</option>
<option>QC</option>
</select>&nbsp;&nbsp;
Postal Code:&nbsp;&nbsp;
<input type=&quot;text&quot; name=&quot;postalcode&quot; size=&quot;7&quot;></font></b></p>
<p style=&quot;margin-top: 6; margin-bottom: 6&quot;><b>
<font face=&quot;Verdana&quot; color=&quot;#C0C0C0&quot; style=&quot;font-size: 9pt&quot;>&nbsp;
<input type=&quot;text&quot; name=&quot;home&quot; size=&quot;16&quot;></font><font face=&quot;Verdana&quot; size=&quot;2&quot; color=&quot;#C0C0C0&quot; style=&quot;font-size: 9pt&quot;>&nbsp;&nbsp;&nbsp; Work

Phone:&nbsp; <input type=&quot;text&quot; name=&quot;work&quot; size=&quot;22&quot;></font></b></td>
</tr>
<tr>
<td width=&quot;25%&quot; height=&quot;16&quot;></td>
<td width=&quot;79%&quot; height=&quot;16&quot;>
<p style=&quot;margin-top: 6; margin-bottom: 6&quot;>&nbsp; <b>
<font face=&quot;Verdana&quot; color=&quot;#C0C0C0&quot; style=&quot;font-size: 9pt&quot;>&nbsp;&nbsp;
Email:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type=&quot;text&quot; name=&quot;email&quot; size=&quot;60&quot;></font></td>
</tr>
<tr>
<td width=&quot;25%&quot; height=&quot;16&quot;></td>
<td width=&quot;79%&quot; height=&quot;16&quot;><!--[if gte vml 1]><v:shape
id=&quot;_x0000_s1120&quot; type=&quot;#_x0000_t202&quot; alt=&quot;&quot; style='position:absolute;left:173.25pt;
top:681.75pt;width:207pt;height:30.75pt;z-index:1' filled=&quot;f&quot; strokecolor=&quot;#669&quot;
strokeweight=&quot;1.5pt&quot;>
<v:textbox>
<table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; width=&quot;100%&quot; height=&quot;25&quot;>
<tr>
<td align=&quot;center&quot; height=&quot;25&quot;><b>
<font face=&quot;Century Schoolbook&quot; color=&quot;#9EA0F3&quot;>

Who would you like to meet?</font></b></td>
</tr>
</table>
</v:textbox>
</v:shape><![endif]--><![if !vml]><span style='mso-ignore:vglayout;position:
absolute;z-index:1;left:230px;top:908px;width:282px;height:47px'><img
width=282 height=47 src=&quot;new_page_1_files/image023.gif&quot; v:shapes=&quot;_x0000_s1120&quot;></span><![endif]><!--[if gte vml 1]><v:shape
id=&quot;_x0000_s1121&quot; type=&quot;#_x0000_t202&quot; alt=&quot;&quot; style='position:absolute;left:171.75pt;
top:428.25pt;width:160.5pt;height:30.75pt;z-index:1' filled=&quot;f&quot; strokecolor=&quot;#669&quot;
strokeweight=&quot;1.5pt&quot;>
<v:textbox>
<table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; width=&quot;100%&quot; height=&quot;25&quot;>
<tr>
<td align=&quot;center&quot; height=&quot;25&quot;><b>
<font face=&quot;Century Schoolbook&quot; color=&quot;#9EA0F3&quot; size=&quot;3&quot;>Personal
Information</font></b></td>
</tr>
</table>
</v:textbox>
</v:shape><![endif]--><![if !vml]><span style='mso-ignore:vglayout;position:
absolute;z-index:1;left:228px;top:570px;width:220px;height:47px'><img
width=220 height=47 src=&quot;new_page_1_files/image024.gif&quot; v:shapes=&quot;_x0000_s1121&quot;></span><![endif]></td>
</tr>
</table>
<p>&nbsp;</p>
<table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse&quot; bordercolor=&quot;#111111&quot; width=&quot;115%&quot; id=&quot;AutoNumber2&quot; height=&quot;88&quot;>
<tr>
<td width=&quot;22%&quot; valign=&quot;top&quot; height=&quot;26&quot;>&nbsp;</td>
<td width=&quot;78%&quot; valign=&quot;top&quot; height=&quot;26&quot; colspan=&quot;2&quot;>&nbsp;</td>
</tr>
<tr>
<td width=&quot;22%&quot; valign=&quot;top&quot; height=&quot;22&quot;>&nbsp;</td>
<td width=&quot;78%&quot; valign=&quot;top&quot; height=&quot;22&quot; colspan=&quot;2&quot;><b>
<font face=&quot;Verdana&quot; color=&quot;#C0C0C0&quot; style=&quot;font-size: 9pt&quot;>Gender:&nbsp;
<input type=&quot;radio&quot; value=&quot;Male&quot; name=&quot;gender&quot; checked> Male&nbsp;&nbsp;
<input type=&quot;radio&quot; name=&quot;gender&quot; value=&quot;Female&quot;></font><font face=&quot;Verdana&quot; size=&quot;2&quot; color=&quot;#C0C0C0&quot; style=&quot;font-size: 9pt&quot;> Female&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Age:&nbsp;&nbsp; <select size=&quot;1&quot; name=&quot;age&quot;>
<option>20</option>
<option>21</option>
<option>22</option>
<option>23</option>
<option>24</option>
<option>25</option>
<option>26</option>
<option>27</option>
<option>28</option>
<option>29</option>
<option>30</option>
<option>31</option>
<option>32</option>
<option>33</option>
<option>34</option>
<option>35</option>
<option>36</option>
<option>37</option>
<option>38</option>
<option>39</option>
<option>40</option>
<option>41</option>
<option>42</option>
<option>43</option>
<option>44</option>
<option>45</option>
<option>46</option>
<option>47</option>
<option>48</option>
<option>49</option>
<option>50</option>
<option>51</option>
<option>52</option>
<option>53</option>
<option>54</option>
<option>55</option>
<option>56</option>
<option>57</option>
<option>58</option>
<option>59</option>
<option>60</option>
<option>61</option>
<option>62</option>
<option>63</option>
<option>64</option>
<option>65</option>
</select><font face=&quot;Verdana&quot; size=&quot;2&quot; color=&quot;#C0C0C0&quot; style=&quot;font-size: 8pt&quot;>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</font>
</font></b></td>
</tr>
<tr>
<td width=&quot;22%&quot; valign=&quot;top&quot; height=&quot;19&quot;>&nbsp;</td>
<td width=&quot;78%&quot; valign=&quot;top&quot; height=&quot;19&quot; colspan=&quot;2&quot;><b>
<font face=&quot;Verdana&quot; color=&quot;#C0C0C0&quot; style=&quot;font-size: 9pt&quot;>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</font></b></td>
</tr>
<tr>
<td width=&quot;22%&quot; valign=&quot;top&quot; height=&quot;22&quot;>&nbsp;</td>
<td width=&quot;78%&quot; valign=&quot;top&quot; height=&quot;22&quot; colspan=&quot;2&quot;>
<p style=&quot;margin-top: 2; margin-bottom: 2&quot;><b>
<font face=&quot;Verdana&quot; color=&quot;#C0C0C0&quot; style=&quot;font-size: 9pt&quot;>Height:&nbsp;&nbsp;
<select size=&quot;1&quot; name=&quot;height&quot;>
<option>&gt;5&#39;0&quot;</option>
<option>5'4&quot;-5'6&quot;</option>
<option>5'7&quot;-5'9&quot;</option>
<option>5'10&quot;-6'0&quot;</option>
<option>6'1&quot;-6'3&quot;</option>
<option>6'3&quot;-6'5&quot;</option>
<option>>6'5&quot;</option>
<option>5'1&quot;-5'3&quot;</option>
</select>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Eye:&nbsp; <select size=&quot;1&quot; name=&quot;eye&quot;>
<option>Brown</option>
<option>Blue</option>
<option>Green</option>
<option>Hazel</option>
<option>Grey</option>
<option>Other</option>
</select> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</font></b></td>
</tr>
<tr>
<td width=&quot;22%&quot; valign=&quot;top&quot; height=&quot;22&quot;>&nbsp;</td>
<td width=&quot;78%&quot; valign=&quot;top&quot; height=&quot;22&quot; colspan=&quot;2&quot;>
<p style=&quot;margin-top: 2; margin-bottom: 2&quot;><b>
<font face=&quot;Verdana&quot; color=&quot;#C0C0C0&quot; style=&quot;font-size: 9pt&quot;>Weight:&nbsp;
<select size=&quot;1&quot; name=&quot;weight&quot;>
<option><100 lbs</option>
<option>100lbs - 110lbs</option>
<option>111lbs - 120lbs</option>
<option>121lbs - 130lbs</option>
<option>131lbs - 140lbs</option>
<option>141lbs - 150lbs</option>
<option>151lbs - 160lbs</option>
<option>161lbs - 170lbs</option>
<option>171lbs - 180lbs</option>
<option>181lbs - 190lbs</option>
<option>191lbs - 200lbs</option>
<option>201lbs - 210lbs</option>
<option>211lbs - 220lbs</option>
<option>221lbs - 230lbs</option>
<option>231lbs-240lbs</option>
<option>241lbs - 250lbs</option>
<option>>250lbs</option>
</select>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Hair Colour:&nbsp; <select size=&quot;1&quot; name=&quot;hair&quot;>
<option>Brown</option>
<option>Black</option>
<option>Blonde</option>
<option>Red</option>
<option>None</option>
<option>Other</option>
</select>&nbsp;&nbsp;
<tr>
<td width=&quot;22%&quot; valign=&quot;top&quot; height=&quot;23&quot;>&nbsp;</td>
<td width=&quot;78%&quot; valign=&quot;top&quot; height=&quot;23&quot; colspan=&quot;2&quot;>
<p style=&quot;margin-top: 2; margin-bottom: 2&quot;><b>
<font face=&quot;Verdana&quot; color=&quot;#C0C0C0&quot; style=&quot;font-size: 9pt&quot;>Do you smoke?&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type=&quot;radio&quot; name=&quot;smoker&quot; value=&quot;Yes&quot;>Yes&nbsp;&nbsp;
<input type=&quot;radio&quot; name=&quot;smoker&quot; value=&quot;No&quot;>No</font></b></td>
</tr>
<tr>
<td width=&quot;22%&quot; valign=&quot;top&quot; height=&quot;22&quot;>&nbsp;</td>
<td width=&quot;78%&quot; valign=&quot;top&quot; height=&quot;22&quot; colspan=&quot;2&quot;>
<p style=&quot;margin-top: 2; margin-bottom: 2&quot;><b>
<font face=&quot;Verdana&quot; color=&quot;#C0C0C0&quot; style=&quot;font-size: 9pt&quot;>Do you have children?&nbsp;
<input type=&quot;radio&quot; name=&quot;children&quot; value=&quot;Yes&quot;>Yes&nbsp;&nbsp;
<input type=&quot;radio&quot; name=&quot;children&quot; value=&quot;No&quot;>No
</font>
</b></td>
</tr>
<tr>
<td width=&quot;22%&quot; valign=&quot;top&quot; height=&quot;20&quot;>&nbsp;</td>
<td width=&quot;78%&quot; valign=&quot;top&quot; height=&quot;20&quot; colspan=&quot;2&quot;>
<p style=&quot;margin-top: 2; margin-bottom: 2&quot;><b>
<font face=&quot;Verdana&quot; color=&quot;#C0C0C0&quot; style=&quot;font-size: 9pt&quot;>What is your
marital status?&nbsp;&nbsp;&nbsp; <select size=&quot;1&quot; name=&quot;status&quot;>
<option>Single</option>
<option>Separated</option>
<option>Divorced</option>
</select></font><font face=&quot;Verdana&quot; color=&quot;#C0C0C0&quot; style=&quot;font-size: 9pt&quot; size=&quot;2&quot;> </font></b></td>
</tr>
<tr>
<td width=&quot;22%&quot; valign=&quot;top&quot; height=&quot;22&quot;>&nbsp;</td>
<td width=&quot;78%&quot; valign=&quot;top&quot; height=&quot;22&quot; colspan=&quot;2&quot;>
<p style=&quot;margin-top: 2; margin-bottom: 2&quot;><b>
<font face=&quot;Verdana&quot; color=&quot;#C0C0C0&quot; style=&quot;font-size: 9pt&quot;>What is your
religion?&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<select size=&quot;1&quot; name=&quot;religion&quot;>
<option>Catholic</option>
<option>Christian</option>
<option>Jewish</option>
<option>Muslim</option>
<option>Hindu</option>
<option>Asian</option>
<option>Native American</option>
<option>Other</option>
</select></font><font face=&quot;Verdana&quot; color=&quot;#C0C0C0&quot; style=&quot;font-size: 9pt&quot; size=&quot;2&quot;>&nbsp;&nbsp; </font></b></td>
</tr>
<tr>
<td width=&quot;22%&quot; valign=&quot;top&quot; height=&quot;22&quot;>&nbsp;</td>
<td width=&quot;78%&quot; valign=&quot;top&quot; height=&quot;22&quot; colspan=&quot;2&quot;>&nbsp;</td>
</tr>
<tr>
<td width=&quot;22%&quot; valign=&quot;top&quot; height=&quot;22&quot;>&nbsp;</td>
<td width=&quot;23%&quot; valign=&quot;top&quot; height=&quot;22&quot;><b>
<font face=&quot;Verdana&quot; color=&quot;#C0C0C0&quot; style=&quot;font-size: 9pt&quot;>What is your main
reason for trying out our service? </font></b></td>
<td width=&quot;71%&quot; valign=&quot;top&quot; height=&quot;22&quot;><b>
<font face=&quot;Verdana&quot; color=&quot;#C0C0C0&quot; style=&quot;font-size: 9pt&quot;> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <select size=&quot;1&quot; name=&quot;reason&quot;>
<option>To make new friends</option>
<option>To try to find a romantic partner</option>
<option>To increase my social circle</option>
<option>Just to have some fun</option>
<option>Pure curiosity</option>
<option>Other</option>
</select></font></b></td>
</tr>
<tr>
<td width=&quot;22%&quot; valign=&quot;top&quot; height=&quot;22&quot;>&nbsp;</td>
<td width=&quot;23%&quot; valign=&quot;top&quot; height=&quot;22&quot;>&nbsp;</td>
<td width=&quot;71%&quot; valign=&quot;top&quot; height=&quot;22&quot;>&nbsp;</td>
</tr>
</table>
<p>&nbsp;</p>
<table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse&quot; bordercolor=&quot;#111111&quot; width=&quot;100%&quot; id=&quot;AutoNumber3&quot; height=&quot;41&quot;>
<tr>
<td width=&quot;25%&quot; height=&quot;20&quot;>&nbsp;</td>
<td width=&quot;28%&quot; height=&quot;20&quot;><b>
<font face=&quot;Verdana&quot; color=&quot;#C0C0C0&quot; style=&quot;font-size: 9pt&quot;>
Someone from your own religion?
</font></b></td>
<td width=&quot;47%&quot; height=&quot;20&quot;><b>
<font face=&quot;Verdana&quot; color=&quot;#C0C0C0&quot; style=&quot;font-size: 9pt&quot;>&nbsp;
<input type=&quot;radio&quot; name=&quot;samereligion&quot; value=&quot;Yes&quot;>Yes&nbsp; &nbsp;
<input type=&quot;radio&quot; name=&quot;samereligion&quot; value=&quot;No&quot;>No&nbsp;&nbsp;&nbsp;
<input type=&quot;radio&quot; name=&quot;samereligion&quot; value=&quot;Doesn't Matter&quot; size=&quot;20&quot;>Doesn't matter</font></b></td>
</tr>
<tr>
<td width=&quot;25%&quot; height=&quot;20&quot;>&nbsp;</td>
<td width=&quot;28%&quot; height=&quot;20&quot;><b>
<font face=&quot;Verdana&quot; color=&quot;#C0C0C0&quot; style=&quot;font-size: 9pt&quot;>
A non-smoker?&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</font></b></td>
<td width=&quot;47%&quot; height=&quot;20&quot;><b>
<font face=&quot;Verdana&quot; color=&quot;#C0C0C0&quot; style=&quot;font-size: 9pt&quot;>&nbsp;
<input type=&quot;radio&quot; name=&quot;wantnosmoker&quot; value=&quot;Yes&quot;>Yes &nbsp;&nbsp;
<input type=&quot;radio&quot; name=&quot;wantnosmoker&quot; value=&quot;No&quot;>No&nbsp;&nbsp;&nbsp;
<input type=&quot;radio&quot; name=&quot;wantnosmoker&quot; value=&quot;Doesn't Matter&quot;>Doesn't matter</font></b></td>
</tr>
<tr>
<td width=&quot;25%&quot; height=&quot;21&quot;>&nbsp;</td>
<td width=&quot;28%&quot; height=&quot;21&quot;>&nbsp;</td>
<td width=&quot;47%&quot; height=&quot;21&quot;>&nbsp;</td>
</tr>
<tr>
<td width=&quot;25%&quot; height=&quot;5&quot;></td>
<td width=&quot;28%&quot; height=&quot;5&quot;><b>
<font face=&quot;Verdana&quot; color=&quot;#C0C0C0&quot; style=&quot;font-size: 9pt&quot;>Do you have any other
special characteristics you are looking for?</font></b><span style=&quot;font-size: 9pt&quot;><!--[if gte vml 1]><v:rect
id=&quot;_x0000_s1123&quot; alt=&quot;&quot; style='position:absolute;left:10.5pt;top:24pt;
width:574.5pt;height:972.75pt;z-index:-6' fillcolor=&quot;#0c0f5f&quot;/><![endif]--><![if !vml]><span
style='mso-ignore:vglayout;position:absolute;z-index:-6;left:13px;top:31px;
width:768px;height:1299px'><img width=768 height=1299
src=&quot;new_page_1_files/image025.gif&quot; v:shapes=&quot;_x0000_s1123&quot;></span><![endif]></span></td>
<td width=&quot;47%&quot; height=&quot;5&quot;><b>
<font face=&quot;Verdana&quot; color=&quot;#C0C0C0&quot; style=&quot;font-size: 9pt&quot;>&nbsp;&nbsp;&nbsp;
<textarea rows=&quot;2&quot; name=&quot;other&quot; cols=&quot;20&quot;></textarea></font></b></td>
</tr>
<tr>
<td width=&quot;25%&quot; height=&quot;15&quot;></td>
<td width=&quot;28%&quot; height=&quot;15&quot;></td>
<td width=&quot;47%&quot; height=&quot;15&quot;></td>
</tr>
<tr>
<td width=&quot;25%&quot; height=&quot;8&quot;></td>
<td width=&quot;28%&quot; height=&quot;8&quot;></td>
<td width=&quot;47%&quot; height=&quot;8&quot;></td>
</tr>
<tr>
<td width=&quot;25%&quot; height=&quot;36&quot;>&nbsp;</td>
<td width=&quot;28%&quot; height=&quot;36&quot;>&nbsp;</td
<td width=&quot;44%&quot; height=&quot;6&quot;>&nbsp;</td>
</tr>
<tr>
<td width=&quot;25%&quot; height=&quot;1&quot;></td>
<td width=&quot;28%&quot; height=&quot;1&quot;></td>
<td width=&quot;47%&quot; height=&quot;1&quot;></td>
</tr>
</table>
<p><!--[if gte vml 1]><v:shape
id=&quot;_x0000_s1117&quot; type=&quot;#_x0000_t202&quot; alt=&quot;&quot; style='position:absolute;left:190.5pt;
top:804.75pt;width:479.25pt;height:56.25pt;z-index:3' filled=&quot;f&quot; stroked=&quot;f&quot;>
<v:textbox>
<table cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; width=&quot;465&quot; height=&quot;49&quot;>
<tr>
<td align=&quot;center&quot; height=&quot;49&quot; width=&quot;465&quot;>
<p align=&quot;left&quot;><b>
<font face=&quot;Verdana&quot; style=&quot;font-size: 7pt&quot; color=&quot;#C0C0C0&quot;>Believing
diversity around the table to be beneficial, we do not perform specific
personality matching, nor can we guarantee that all of your TableMates will
match all of your desired criteria. If you have specific requirements,
however, we are more than willing to attempt too accommodate you.</font></b></td>
</tr>
</table>
</v:textbox>
</v:shape><![endif]--><![if !vml]><span style='mso-ignore:vglayout;position:
absolute;z-index:3;left:254px;top:1073px;width:643px;height:79px'><img
width=643 height=79 src=&quot;new_page_1_files/image026.gif&quot; v:shapes=&quot;_x0000_s1117&quot;></span><![endif]><span style=&quot;font-size: 9pt&quot;></span></p>
<table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse&quot; bordercolor=&quot;#111111&quot; width=&quot;109%&quot; id=&quot;AutoNumber4&quot; height=&quot;68&quot;>
<tr>
<td width=&quot;23%&quot; height=&quot;49&quot;>&nbsp;</td>
<td width=&quot;30%&quot; height=&quot;49&quot;><b>
<font face=&quot;Verdana&quot; color=&quot;#C0C0C0&quot; style=&quot;font-size: 9pt&quot;>Lastly, please let us
know how you heard about us:&nbsp;&nbsp; </font></b>
</td>
<td width=&quot;57%&quot; height=&quot;49&quot;>
<span style=&quot;font-size: 9pt&quot;>&nbsp;&nbsp;
<select size=&quot;1&quot; name=&quot;how_heard&quot;>
<option>From a friend</option>
<option>From a family member</option>
<option>A flyer at my gym</option>
<option>A flyer, but not at my gym</option>
<option>Toronto Star</option>
<option>Toronto Sun</option>
<option>Globe and Mail</option>
<option>Metro Today</option>
<option>Eye Magazine</option>
<option>Now Magazine</option>
<option>Other</option>
</select></span></td>
</tr>

</table>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;<input type=&quot;submit&quot; value=&quot;That's it. Click here to submit your membership&quot; name=&quot;B2&quot;></p>
</form>
 
Remind me again why i hate FP, oh yeah, the above is why

Here the problem(s) are:
1. that the code to insert is done before the form is shown
2. you are not using $_POST/$_GET to access the form variables. You may have register_globals on, which is why you are not using/required to use $_POST/$_GET, but for future proofing, its best to make the switch now

Solution
1. use functions to separate out the pieces of the page. This will allow you to add functionality later and makes it easier to follow as all items related in in a function together

ex. (for this to work, please add the name=&quot;submit&quot; attribute to the submit button, required for the initial control flow)
Code:
<?
//main code
//
if ($_POST['submit']){
     //the above checks to see if the submit button has been pressed
     //if yes, call the insert function
     do_insert();
}else{
     //submit not pressed so show form
     show_form();
}//end if
//end main code block

function do_insert()
{
   //your code to do the insert here
   //note: you show all the input elements to variables and test them to see if they are correct for input, don't forget to use $_POST or $_GET

}//end function

function show_form()
{
   //all the code for the form here
   //simply cut and paste the code in here
?>
<!--#Code here-->

<?
}//end function

?>

Bastien

Any one have a techie job in Toronto, I need to work...being laid off sucks!
 
Thanks Bastien,

I'm getting pretty frustrated here though: interested in a little project? I'm just about ready to outsource as I just don't have any more time to waste fiddling around with it. Cost permitting, of course...as I was fiddling in the first place to save myself some cash!

I don't believe it's a terribly large project: Email me at matthew@psych.utoronto.ca if you're interested, and we can discuss.

Cheers,
Matt
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top