<?xml version="1.0" encoding="UTF-8"?><rss
version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
> <channel><title>Comments on: How do you make a form send the input to the action and update MySQL at the same time?</title> <atom:link href="http://www.findistore.com/how-do-you-make-a-form-send-the-input-to-the-action-and-update-mysql-at-the-same-time/feed" rel="self" type="application/rss+xml" /><link>http://www.findistore.com/how-do-you-make-a-form-send-the-input-to-the-action-and-update-mysql-at-the-same-time</link> <description>We are Professional Web Designer. We specialize in Website Design &#38; eCommerce Web Services</description> <lastBuildDate>Wed, 12 Oct 2011 00:03:14 +0000</lastBuildDate> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.1</generator> <xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" /> <item><title>By: Big D</title><link>http://www.findistore.com/how-do-you-make-a-form-send-the-input-to-the-action-and-update-mysql-at-the-same-time/comment-page-1#comment-2017</link> <dc:creator>Big D</dc:creator> <pubDate>Thu, 12 Mar 2009 17:09:52 +0000</pubDate> <guid
isPermaLink="false">http://www.findistore.com/how-do-you-make-a-form-send-the-input-to-the-action-and-update-mysql-at-the-same-time#comment-2017</guid> <description>have a redirect page in the middle, say if your using php have your form direct to formRedirect.php that looks like
&lt;?php
//set these to determine whether form sent correctly
$errorFirstValue = TRUE; //if an error
$errorSecondValue = TRUE; //if an error
if(!empty($_POST[&#039;firstValue&#039;])){
$firstValue= $_POST[&#039;firstValue&#039;];
$errorFirstValue = FALSE; //no error for firstValue
}
if(!empty($_POST[&#039;secondValue&#039;])){
$secondValue= $_POST[&#039;secondValue&#039;];
$errorSecondValue = FALSE; //no error for secondValue
}
//If there are any errors on how you want the page filled out send to original form page
if($errorFirstValue &amp;&amp; $errorSecondValue){
header(&quot;LOCATION: backtowhateveerpageyoucamefrom.php&quot;);
exit();
}
else{
$updateTable = &quot;UPDATE table SET firstValue=&#039;$firstValue&#039; WHERE secondValue=&#039;$secondValue&#039;&quot;;
@mysql_query($updateTable);
header(&#039;LOCATION: pagetoforward.php?firstValue=&#039; . $firstValue . &#039;&amp;secondValue=&#039; . $secondValue);
exit();
}
?&gt;
What you do is check the information submitted anyway you want (if its supposed to be a specific type or style use your reg exp) then attach the values to the end of the string your having forwarded to and use a $_GET[&#039;&#039;] to get them.  If the form is filled out incorrectly use an $error or $valid  variable or something of that nature to test what should be submitted, and if it is an error or not valid send back to the original form</description> <content:encoded><![CDATA[<p>have a redirect page in the middle, say if your using php have your form direct to formRedirect.php that looks like</p><p>&lt;?php<br
/> //set these to determine whether form sent correctly<br
/> $errorFirstValue = TRUE; //if an error<br
/> $errorSecondValue = TRUE; //if an error</p><p>if(!empty($_POST[&#39;firstValue&#39;])){<br
/> $firstValue= $_POST[&#39;firstValue&#39;];<br
/> $errorFirstValue = FALSE; //no error for firstValue<br
/> }</p><p>if(!empty($_POST[&#39;secondValue&#39;])){<br
/> $secondValue= $_POST[&#39;secondValue&#39;];<br
/> $errorSecondValue = FALSE; //no error for secondValue<br
/> }</p><p>//If there are any errors on how you want the page filled out send to original form page<br
/> if($errorFirstValue &amp;&amp; $errorSecondValue){<br
/> header(&quot;LOCATION: backtowhateveerpageyoucamefrom.php&quot;);<br
/> exit();<br
/> }<br
/> else{<br
/> $updateTable = &quot;UPDATE table SET firstValue=&#39;$firstValue&#39; WHERE secondValue=&#39;$secondValue&#39;&quot;;<br
/> @mysql_query($updateTable);</p><p> header(&#39;LOCATION: pagetoforward.php?firstValue=&#39; . $firstValue . &#39;&amp;secondValue=&#39; . $secondValue);<br
/> exit();<br
/> }</p><p>?&gt;</p><p>What you do is check the information submitted anyway you want (if its supposed to be a specific type or style use your reg exp) then attach the values to the end of the string your having forwarded to and use a $_GET[&#39;&#39;] to get them.  If the form is filled out incorrectly use an $error or $valid  variable or something of that nature to test what should be submitted, and if it is an error or not valid send back to the original form</p> ]]></content:encoded> </item> </channel> </rss>
