Jump to content

on submit....


ajicles

Recommended Posts

I am trying to make my website submit a file when the submit button is pressed. I tried to use isset but when I press submit it doesn't work.

 

This is just an example of when I am trying to do:

<?php

if (isset($_POST['submit'])) {
echo "clicked";
}
else
{
echo "not_clicked";
}

?>

<form  id="myform" enctype="multipart/form-data" action="test.php" method="POST">
<input type="submit" value="Upload" />

</form>

Link to comment
https://forums.phpfreaks.com/topic/209190-on-submit/
Share on other sites

I am trying to make my website submit a file when the submit button is pressed. I tried to use isset but when I press submit it doesn't work.

 

This is just an example of when I am trying to do:

<?php

if (isset($_POST['submit'])) {
echo "clicked";
}
else
{
echo "not_clicked";
}

?>

<form  id="myform" enctype="multipart/form-data" action="test.php" method="POST">
<input type="submit" value="Upload" />

</form>

 

Do something following.

<?php
if (isset($_POST['SubmitMe']) && $_POST['SubmitMe'] == 1){
echo "clicked";
} else{
echo "not_clicked";
}
?>

<form  id="myform" enctype="multipart/form-data" action="test.php" method="POST">
<input type="hidden" name="SubmitMe" value="1">
<input type="submit" value="Upload" />
</form>

Link to comment
https://forums.phpfreaks.com/topic/209190-on-submit/#findComment-1092460
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.