Mild Fuzz Posted December 2, 2009 Share Posted December 2, 2009 Hey, pretty new round here but hopefully will be coming back more and more, as I progress deeper into the world of PHP I have been trying to create a wordpress plugin, and I am almost there, but I can't get a form to submit to itself. Here is what I have: $mf_table_output .= "<form action=\""; $mf_table_output .= $PHP_SELF; $mf_table_output .= "\" method=\"post\">"; $mf_table_output .= "<input type=\"button\" name=\"submit\" value=\"submit\" /> </form>"; echo $mf_table_output; And this is verify if the button has been pressed if(isset($_POST['submit'])){ echo "hi lover!!"; }; Link to comment https://forums.phpfreaks.com/topic/183718-form-trouble/ Share on other sites More sharing options...
Kieran Menor Posted December 2, 2009 Share Posted December 2, 2009 Try using $_SERVER['PHP_SELF'] instead of $PHP_SELF. Link to comment https://forums.phpfreaks.com/topic/183718-form-trouble/#findComment-969646 Share on other sites More sharing options...
Mild Fuzz Posted December 2, 2009 Author Share Posted December 2, 2009 done, no joy form renders into HTML thus: <form method="post" action="/fitzgraham/index.php"> <input type="button" value="submit" name="submit"/> </form> Link to comment https://forums.phpfreaks.com/topic/183718-form-trouble/#findComment-969651 Share on other sites More sharing options...
Mild Fuzz Posted December 2, 2009 Author Share Posted December 2, 2009 Page: http://fitzgraham.netne.net/wordpress/timetable/ user: admin pass: fitz101 Link to comment https://forums.phpfreaks.com/topic/183718-form-trouble/#findComment-969657 Share on other sites More sharing options...
Deoctor Posted December 2, 2009 Share Posted December 2, 2009 dear dude do u want your site to be hacked or donot give out user admin user id and password.. create a new user account and give it out in a public form.. Link to comment https://forums.phpfreaks.com/topic/183718-form-trouble/#findComment-969663 Share on other sites More sharing options...
Mild Fuzz Posted December 2, 2009 Author Share Posted December 2, 2009 its just a test server, and it's just the password to allow into the web page Link to comment https://forums.phpfreaks.com/topic/183718-form-trouble/#findComment-969665 Share on other sites More sharing options...
Deoctor Posted December 2, 2009 Share Posted December 2, 2009 hey i have just visited the admin panel of the site and i am able to change the password of the admin account.. just check this link which i have added using ur admin panel http://fitzgraham.netne.net/wordpress/admin/hai-test/ Link to comment https://forums.phpfreaks.com/topic/183718-form-trouble/#findComment-969668 Share on other sites More sharing options...
Mild Fuzz Posted December 2, 2009 Author Share Posted December 2, 2009 Well done Do you know how to solve my problem? Link to comment https://forums.phpfreaks.com/topic/183718-form-trouble/#findComment-969673 Share on other sites More sharing options...
Deoctor Posted December 2, 2009 Share Posted December 2, 2009 $_SERVER['PHP_SELF'] this is the only can where u can call the same php.. is this not working for you?? u can also try this $_SERVER['REQUEST_URI'] Link to comment https://forums.phpfreaks.com/topic/183718-form-trouble/#findComment-969676 Share on other sites More sharing options...
Mild Fuzz Posted December 2, 2009 Author Share Posted December 2, 2009 No Link to comment https://forums.phpfreaks.com/topic/183718-form-trouble/#findComment-969678 Share on other sites More sharing options...
Deoctor Posted December 2, 2009 Share Posted December 2, 2009 try all of these $_SERVER['SCRIPT_NAME']--this will give you the php file which u are using even if some other is added to the url. $_SERVER['REQUEST_URI'] and $_SERVER['PHP_SELF'] will almost give u same results Link to comment https://forums.phpfreaks.com/topic/183718-form-trouble/#findComment-969680 Share on other sites More sharing options...
Mild Fuzz Posted December 2, 2009 Author Share Posted December 2, 2009 when I hit the button, it doesn't do anything!! Link to comment https://forums.phpfreaks.com/topic/183718-form-trouble/#findComment-969697 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.