How do I specify a command when submitting a form using php?

I am trying to post a form from php and I want the form to be processed based on the cmd value. Putting this after the filename does not work. What is the correct way to do this?

echo "<form name=\"statusForm\" action=\"edit_status.php?cmd=submitinfo\" method=\"post\" enctype=\"multipart/form-data\">

      

Where / how can I specify? cmd = submitinfo

0


a source to share


3 answers


echo "<form name=\"statusForm\" action=\"edit_status.php\" method=\"post\" enctype=\"multipart/form-data\"><input type=\"hidden\" name=\"cmd\" value=\"submitinfo\"/>

      



+2


a source


Your form method is POST, so you can probably just as easily accomplish what you want with a hidden field:

<input type="hidden" name="cmd" value="submitinfo" />

      



Then just use the variable $_POST

like other form parameters on the edit status page.

+3


a source


I'm not sure what you are doing here. You can easily get to the query string (part after cmd =). Are you trying to access it from edit_status.php file?

Second, are you using? _GET ["cmd"]

0


a source







All Articles