ShaolinF Posted November 22, 2009 Share Posted November 22, 2009 Hi Guys I am working on a form plugin for my admin section. I written a simple form but everytime I try submit it the input values are not POSTed. I don't know if its my setup or something wrong with the code. I am using WAMPSERVER 2.0 - Below is my code: <?php /* Plugin Name: My First plugin Plugin URI: - Description: - Author: - Author URI: - */ function printNewCoursePage() { if( isset($POST['stage']) && ('process' == $_POST['stage']) ) { /*Course Title*/ if($POST['course_title'] != "") { echo "form submitted"; } } else { echo "form not submitted"; } ?> <!-- HTML BEGIN --> <div class="wrap"> <h2>Add New Course</h2> <form name="new_course_form" method="POST" action="<?php echo $_SERVER['REQUEST_URI']; ?>"> <input type="hidden" name="course_form" id="course_form" /> <!-- Course Details Start --> <div class="postbox"> <h3 class="handletxt">Course Details</h3> <!-- Course Title --> <div class="insidebox"> <div class="form_text">Course Title:</div> <input type="text" class="txtbox" name="course_title" value="<?php echo $course_title; ?>" id="course_title" /> </div> <input type="hidden" name="stage" value="process" /> <div class="postbox"> <h3 class="handletxt">Publish</h3> <div id="major-publishing-actions"> <input id="publish" class="button-primary" type="submit" value="Publish Course" name="submit"/> </div> </div> </form> </div> <!-- HTML END --> <?php } function addNewCourse() { add_menu_page( 'Courses', 'Manage Courses', 'administrator', 'newcourse', 'printNewCoursePage' ); } add_action('admin_menu', 'addNewCourse'); ?> Quote Link to comment https://forums.phpfreaks.com/topic/182492-wordpress-admin-form-plugin-not-posting/ Share on other sites More sharing options...
JamesThePanda Posted November 27, 2009 Share Posted November 27, 2009 this might be the problem if( isset($POST['stage']) && ('process' == $_POST['stage']) you have $POST Probably should be $_POST Let me know Thanks James Quote Link to comment https://forums.phpfreaks.com/topic/182492-wordpress-admin-form-plugin-not-posting/#findComment-966233 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.