I have a silly question. How do you execute a php file?
I tried with this:
<form action = "file.php" method = "post">
<input type="submit" name="submit" />
</form>
except I do not know how to coordinate the button event 'submit' with the start of the php file.
What code do I put at the beginning of the php file to initiate the input button 'submit' ?
How do you execute a php file?
Moderator: General Moderators
-
Philosophaie
- Forum Newbie
- Posts: 2
- Joined: Sat Feb 11, 2012 5:33 am
Re: How do you execute a php file?
<?phpPhilosophaie wrote:What code do I put at the beginning of the php file to initiate the input button 'submit' ?
You don't have to do anything special. Clicking the submit button loads the PHP file via POST request and its contents are executed sequentially.
-
Philosophaie
- Forum Newbie
- Posts: 2
- Joined: Sat Feb 11, 2012 5:33 am
Re: How do you execute a php file?
I tried to use the isset command at the beginning but it does not seem to be working:
Code: Select all
<?php
if (isset($_POST['submit'])){
echo 'Successful';
} else {
echo 'Unsuccessful';
}
?>