JamesThePanda Posted January 15, 2010 Share Posted January 15, 2010 Hi Im having a problem with some code Im not sure if its a php thing or a html thing. Basically I have been making a wordpress plugin, In the plugin there is a form, all it is ment to do is. delete a row of a table in a data base all is working fine apart from one thing the delete button. More specifically the action of the form, i have tried to get the form to submit to its self by setting the target as the specific php file. How can i check If the file is actually submitting to its self. Thanks James Quote Link to comment Share on other sites More sharing options...
deansatch Posted January 15, 2010 Share Posted January 15, 2010 put this at the top of the page in question (assuming you have a 'submit' named input)? if (isset($_POST['submit'])) {echo 'it is posting to itself fine';} Quote Link to comment Share on other sites More sharing options...
Rizla Posted January 15, 2010 Share Posted January 15, 2010 example form code: <form method="post" action="pagename.php"> <input type="submit" name="submit" value="Delete" /> </form> Just make shure the php code is listening to the correct submit btn "name" and make shure the php code that deletes receives the correct row id otherwhise you wont be able to delete anything. Can you post your code??? Quote Link to comment Share on other sites More sharing options...
Buddski Posted January 15, 2010 Share Posted January 15, 2010 You can always use the server global's request_uri as your action echo '<form action="'.$_SERVER['REQUEST_URI'].'" method="post">'; 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.