Jump to content

Posting problems


malcolm99

Recommended Posts

This is a basic form posting script. You have your HTML page:

 

<form action="process.php" method="post">
Your Name: <input type="text" name="your_name" /><br />
<input type="submit" name="submit" value="Show My Name!" />
</form>

 

On process.php you would have something like this:

//Check to see if form has been submitted...
if(isset($_POST['submit'])){
//It has, lets echo out there name, if they supplied one.
$name = $_POST['your_name'];

if($name == ""){
//Name has not been entered
echo "You did not enter your name.";
}else{
//Name has been entered
echo "Hello ".$name."!";
}

}else{
//They went to this page without submitting the form!
echo "Hey! Go and submit the form!";
}

 

Just an example. Very basic.

Link to comment
https://forums.phpfreaks.com/topic/118053-posting-problems/#findComment-607308
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.