<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="https://www.webmaster-forums.net/crss/node/1037165" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title></title>
    <link>https://www.webmaster-forums.net/crss/node/1037165</link>
    <description></description>
    <language>en</language>
          <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/help-me-get-started-simple-form-phpmysql#comment-1213464</link>
    <description> &lt;p&gt;Bloody hell... how many questions? &lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/wink.png&quot; title=&quot;Wink&quot; alt=&quot;Wink&quot; class=&quot;smiley-content&quot; /&gt;&lt;/p&gt;
&lt;p&gt;The page with the form doesn&#039;t need to be PHP however, I prefer to post my data back to the page with the form as I can then highlight fields that have failed validation and put the original input back into the boxes to save users retyping everything.&lt;/p&gt;
&lt;p&gt;You should always use the right fieldtype for the job. For short text inputs use the varchar type but limit the size to match the expected input.&lt;/p&gt;
&lt;p&gt;Leave the collation as it is... that&#039;s the mysql default and it mostly works fine.&lt;/p&gt;
&lt;p&gt;It&#039;s not necessary to write the post vars to proper variables, but make sure you always use the &lt;a href=&quot;http://uk2.php.net/manual/en/function.mysqli-escape-string.php&quot; class=&quot;bb-url&quot;&gt;mysql_escape_string&lt;/a&gt; function on any variables you insert to prevent mysql injection attacks.&lt;/p&gt;
&lt;p&gt;I always find that if I have problems, the easiest solution is to echo out $query and copy it into phpmyadmin so I can see better what the error is.&lt;/p&gt;
 </description>
     <pubDate>Fri, 12 Jan 2007 21:18:32 +0000</pubDate>
 <dc:creator>andy206uk</dc:creator>
 <guid isPermaLink="false">comment 1213464 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/help-me-get-started-simple-form-phpmysql#comment-1213457</link>
    <description> &lt;p&gt;Question: If you&#039;re writing form data to a database, is it best to put all the post data into variables before putting it into the query?&lt;/p&gt;
&lt;p&gt;Another one: I need to split the form so that certain questions only show up based on answers to previous questions. What would be the best way to do that?&lt;/p&gt;
 </description>
     <pubDate>Fri, 12 Jan 2007 19:54:09 +0000</pubDate>
 <dc:creator>Megan</dc:creator>
 <guid isPermaLink="false">comment 1213457 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/help-me-get-started-simple-form-phpmysql#comment-1213456</link>
    <description> &lt;p&gt;I can&#039;t offer you any advice megan because I barely know PHP, but if you&#039;re really serious about learning PHP, you will probably want to do it yourself. Otherwise you could use &lt;a href=&quot;http://tools4php.com/form-wizard/index.html&quot; class=&quot;bb-url&quot;&gt;PHP Form Wizard&lt;/a&gt;. I use it for all my forms and it is worth its weight in gold (appox $30). I could have your form done in a few minutes. Actually it *might* help you learn PHP because you could analyze what PHP code it gives you after you finish the wizard.&lt;/p&gt;
 </description>
     <pubDate>Fri, 12 Jan 2007 19:46:31 +0000</pubDate>
 <dc:creator>teammatt3</dc:creator>
 <guid isPermaLink="false">comment 1213456 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/help-me-get-started-simple-form-phpmysql#comment-1213455</link>
    <description> &lt;p&gt;Well, all that, and it turns out I forgot to create a field for one of the entries in the database! Now I have it writing to the database &lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/smile.png&quot; title=&quot;Smiling&quot; alt=&quot;Smiling&quot; class=&quot;smiley-content&quot; /&gt;&lt;/p&gt;
 </description>
     <pubDate>Fri, 12 Jan 2007 19:46:16 +0000</pubDate>
 <dc:creator>Megan</dc:creator>
 <guid isPermaLink="false">comment 1213455 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/help-me-get-started-simple-form-phpmysql#comment-1213450</link>
    <description> &lt;p&gt;I tried to set it up with help from &lt;a href=&quot;http://www.php-mysql-tutorial.com/mysql-insert-php.php&quot; class=&quot;bb-url&quot;&gt;this tutotiral&lt;/a&gt;. This is the code I have:&lt;/p&gt;
&lt;p&gt;&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: #000000&quot;&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;&amp;lt;?php&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #FF8000&quot;&gt;// include database info&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;include &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;library/db_connect.php&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;;&lt;br /&gt;&lt;br /&gt;if(isset(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$_POST&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;submit&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;])) &lt;/span&gt;&lt;span style=&quot;color: #FF8000&quot;&gt;// if the form is submitted &lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;{&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #FF8000&quot;&gt;// set variables for for the form&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$name &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$_POST&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;name&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;];&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$hometown &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$_POST&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;hometown&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;];&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$program &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$_POST&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;program&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;];&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$year &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$_POST&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;year&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;];&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$residence &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$_POST&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;residence&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;];&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$email &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$_POST&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;email&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;];&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$query &lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;= &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;INSERT INTO profiles-individual (name, hometown, program, year, residence, email) VALUES (&#039;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$name&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;, &#039;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$hometown&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;, &#039;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$program&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;, &#039;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$year&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;, &#039;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$residence&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;, &#039;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$email&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;&quot;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;mysql_query&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;$query&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;) or die(&lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&#039;Error, insert query failed&#039;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;echo &lt;/span&gt;&lt;span style=&quot;color: #DD0000&quot;&gt;&quot;Form fields added&quot;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;;&lt;br /&gt;&lt;br /&gt;}&lt;br /&gt;else { &lt;/span&gt;&lt;span style=&quot;color: #FF8000&quot;&gt;// if the form wasn&#039;t submitted, show the form&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;form method=&amp;#039;post&amp;#039;&amp;gt;&lt;br /&gt;&amp;lt;fieldset&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;legend&amp;gt;Personal Information&amp;lt;/legend&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;ol id=&amp;quot;personalinfo&amp;quot;&amp;gt;&lt;br /&gt;	&amp;lt;li&amp;gt;&amp;lt;label for=&amp;#039;name&amp;#039;&amp;gt;&amp;lt;span class=&amp;quot;required&amp;quot;&amp;gt;*&amp;lt;/span&amp;gt;Name:&amp;lt;/label&amp;gt; &lt;br /&gt;		&amp;lt;input type=&amp;#039;text&amp;#039; size=&amp;#039;30&amp;#039; name=&amp;#039;name&amp;#039; id=&amp;#039;name&amp;#039; value=&amp;quot;&amp;quot; maxlength=&amp;#039;255&amp;#039; /&amp;gt;&lt;br /&gt;	&amp;lt;p class=&amp;#039;help&amp;#039;&amp;gt;Note: just your first name is fine.&amp;lt;/p&amp;gt;&lt;br /&gt;	&amp;lt;/li&amp;gt;&lt;br /&gt;&lt;br /&gt;	&amp;lt;li&amp;gt;&lt;br /&gt;	&amp;lt;label for=&amp;quot;hometown&amp;quot;&amp;gt;Hometown:&amp;lt;/label&amp;gt; &lt;br /&gt;	&amp;lt;input type=&amp;#039;text&amp;#039; size=&amp;#039;30&amp;#039; name=&amp;#039;hometown&amp;#039; id=&amp;#039;hometown&amp;#039; value=&amp;quot;&amp;quot; maxlength=&amp;#039;255&amp;#039; /&amp;gt;&lt;br /&gt;	&amp;lt;/li&amp;gt;&lt;br /&gt;	&lt;br /&gt;	&amp;lt;li&amp;gt;&lt;br /&gt;	&amp;lt;label for=&amp;#039;program&amp;#039;&amp;gt;Program:&amp;lt;/label&amp;gt; &lt;br /&gt;	&amp;lt;input type=&amp;#039;text&amp;#039; size=&amp;#039;30&amp;#039; name=&amp;#039;program&amp;#039; id=&amp;#039;program&amp;#039; value=&amp;quot;&amp;quot; maxlength=&amp;#039;255&amp;#039; /&amp;gt;&lt;br /&gt;	&amp;lt;/li&amp;gt;&lt;br /&gt;	&lt;br /&gt;	&amp;lt;li&amp;gt;&lt;br /&gt;	&amp;lt;label for=&amp;#039;year&amp;#039;&amp;gt;&amp;lt;span class=&amp;quot;required&amp;quot;&amp;gt;*&amp;lt;/span&amp;gt;Academic year: &amp;lt;/label&amp;gt;&lt;br /&gt;		&amp;lt;select name=&amp;#039;year&amp;#039; id=&amp;#039;year&amp;#039;&amp;gt;&lt;br /&gt;				&amp;lt;option value=&amp;#039;&amp;#039; selected&amp;gt;Please choose..&amp;lt;/option&amp;gt;&lt;br /&gt;				&amp;lt;option value=&amp;#039;1&amp;#039;&amp;gt;First year&amp;lt;/option&amp;gt;&lt;br /&gt;				&amp;lt;option value=&amp;#039;2&amp;#039;&amp;gt;Second year&amp;lt;/option&amp;gt;&lt;br /&gt;				&amp;lt;option value=&amp;#039;3&amp;#039;&amp;gt;Third year&amp;lt;/option&amp;gt;&lt;br /&gt;				&amp;lt;option value=&amp;#039;4&amp;#039;&amp;gt;Fourth year or above&amp;lt;/option&amp;gt;&lt;br /&gt;				&amp;lt;option value=&amp;#039;5&amp;#039;&amp;gt;Grad student&amp;lt;/option&amp;gt;&lt;br /&gt;		&amp;lt;/select&amp;gt;&lt;br /&gt;	&amp;lt;/li&amp;gt;&lt;br /&gt;	&lt;br /&gt;	&amp;lt;li&amp;gt;&amp;lt;label for=&amp;#039;residence&amp;#039;&amp;gt;&amp;lt;span class=&amp;quot;required&amp;quot;&amp;gt;*&amp;lt;/span&amp;gt;Residence: &amp;lt;/label&amp;gt;&lt;br /&gt;	&lt;br /&gt;	&amp;lt;select name=&amp;#039;residence&amp;#039; id=&amp;#039;residence&amp;#039;&amp;gt;&lt;br /&gt;		&amp;lt;option value=&amp;#039;&amp;#039; selected&amp;gt;Please choose..&amp;lt;/option&amp;gt;&lt;br /&gt;		&amp;lt;option value=&amp;#039;CLVN&amp;#039;&amp;gt;Columbia Lake Village North&amp;lt;/option&amp;gt;&lt;br /&gt;		&amp;lt;option value=&amp;#039;CLVS&amp;#039;&amp;gt;Columbia Lake Village South&amp;lt;/option&amp;gt;&lt;br /&gt;		&amp;lt;option value=&amp;#039;MKV&amp;#039;&amp;gt;Mackenzie King Village&amp;lt;/option&amp;gt;&lt;br /&gt;		&amp;lt;option value=&amp;#039;Minota&amp;#039;&amp;gt;Minota Hagey&amp;lt;/option&amp;gt;&lt;br /&gt;		&amp;lt;option value=&amp;#039;REV&amp;#039;&amp;gt;Ron Edyt Village&amp;lt;/option&amp;gt;&lt;br /&gt;		&amp;lt;option value=&amp;#039;UWP&amp;#039;&amp;gt;UW Place&amp;lt;/option&amp;gt;&lt;br /&gt;		&amp;lt;option value=&amp;#039;V1&amp;#039;&amp;gt;Village 1&amp;lt;/option&amp;gt;&lt;br /&gt;	&amp;lt;/select&amp;gt;&lt;br /&gt;&lt;br /&gt;	&amp;lt;/li&amp;gt;&lt;br /&gt;	&lt;br /&gt;	&amp;lt;li&amp;gt;&amp;lt;label for=&amp;#039;email&amp;#039;&amp;gt;&amp;lt;span class=&amp;quot;required&amp;quot;&amp;gt;*&amp;lt;/span&amp;gt;Email Address:&amp;lt;/label&amp;gt; &lt;br /&gt;		&amp;lt;input&amp;nbsp; type=&amp;#039;text&amp;#039; size=&amp;#039;30&amp;#039; name=&amp;#039;email&amp;#039; id=&amp;#039;email&amp;#039; value=&amp;quot;&amp;quot; maxlength=&amp;#039;255&amp;#039; /&amp;gt;&lt;br /&gt;		&amp;lt;p class=&amp;#039;help&amp;#039;&amp;gt;If we decide to publish your profile we will be contacting you for a photo. We &amp;lt;strong&amp;gt;will not&amp;lt;/strong&amp;gt; publish your email address with your profile; it is only for our office to contact you if necessary.&amp;lt;/p&amp;gt;&lt;br /&gt;	&amp;lt;/li&amp;gt;&lt;br /&gt;	&lt;br /&gt;&amp;lt;/ol&amp;gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;input class=&amp;#039;submit&amp;#039; type=&amp;#039;submit&amp;#039; value=&amp;#039;submit&amp;#039; /&amp;gt;&lt;br /&gt;&amp;lt;/fieldset&amp;gt;&lt;br /&gt;&amp;lt;/form&amp;gt;&lt;br /&gt;&lt;span style=&quot;color: #000000&quot;&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;&amp;lt;?php&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #007700&quot;&gt;}&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;&#039;&lt;/p&gt;
&lt;p&gt;But it doesn&#039;t do anything? It&#039;s at this link:&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://www.housing.uwaterloo.ca/profiles/firsttest.php&quot; class=&quot;bb-url&quot;&gt;http://www.housing.uwaterloo.ca/profiles/firsttest.php&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Any help at all??? Please???&lt;/p&gt;
 </description>
     <pubDate>Fri, 12 Jan 2007 17:48:26 +0000</pubDate>
 <dc:creator>Megan</dc:creator>
 <guid isPermaLink="false">comment 1213450 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/help-me-get-started-simple-form-phpmysql#comment-1213449</link>
    <description> &lt;p&gt;More questions - should the code that puts the form entries into the database be on the form page or should it be on a separate page which is called when the form is submitted?&lt;/p&gt;
&lt;p&gt;In the database, is it okay if the collation says &quot;latin1_swedish_ci&quot;? I know it put that in there as the default - should I change it to something else? If so, what?&lt;/p&gt;
 </description>
     <pubDate>Fri, 12 Jan 2007 17:07:09 +0000</pubDate>
 <dc:creator>Megan</dc:creator>
 <guid isPermaLink="false">comment 1213449 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/help-me-get-started-simple-form-phpmysql#comment-1213430</link>
    <description> &lt;p&gt;I&#039;m now creating the mySQL database. Do I need to worry a lot about what field types I use? I know I need to estimate the right one, but some of them are confusing so I&#039;m not sure which one to use (i.e. blob vs. longblob or something like that). Also, would it be bad to have all the information in one table? That seems to be the easiest solution to me.&lt;/p&gt;
 </description>
     <pubDate>Fri, 12 Jan 2007 15:39:56 +0000</pubDate>
 <dc:creator>Megan</dc:creator>
 <guid isPermaLink="false">comment 1213430 at https://www.webmaster-forums.net</guid>
  </item>
  </channel>
</rss>
