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!!"; }; Quote Link to comment 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. Quote Link to comment 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> Quote Link to comment 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 Quote Link to comment 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.. Quote Link to comment 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 Quote Link to comment 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/ Quote Link to comment 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? Quote Link to comment 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'] Quote Link to comment Share on other sites More sharing options...
Mild Fuzz Posted December 2, 2009 Author Share Posted December 2, 2009 No Quote Link to comment 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 Quote Link to comment 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!! Quote Link to comment 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.