Submitting forms using “the_content” impossible?
-
Class Form { function show_form() { echo(" <form method='post' action='index.php?page_id=4&temp_load=2' cellspacing='2'> <table> <tr> <td colspan='2' align='center'> <h2>Describe your Theme</h2> Please be as specific as possible. </td> </tr> <tr> <td colspan='2'> Theme Name(Required)<br /> <input type='text' name='tn' /> </td> </tr> <tr> <td colspan='2'> <input type='submit' name='s' value='Submit' /> </td> </tr> </table> </form> "); } function success() { if($_POST['tn'] == "test") { return "True"; } else { return "False"; } } } function form_replace($content) { $TEMP = new Form; $content = str_replace('[THEME-UPLOAD-SITE]',$TEMP->show_form(),$content); return $content; } function submitted($content) { $TEMP = new Form; $content = str_replace('[THEME-UPLOAD-SITE-2]',$TEMP->success(),$content); return $content; } if(!isset($_POST['s'])) { add_filter('the_content','form_replace'); } else { add_filter('the_content','submitted'); }
Above is how my code is layed out, how can I fix it so when I submit the form it actually replaces the text when submitted?
- The topic ‘Submitting forms using “the_content” impossible?’ is closed to new replies.