Jump to content

Pressing "SUBMIT" VS Pressing ENTER


halm1985

Recommended Posts

no .. it's just an ordinary form

 

follwoing is a simplifcation of the story

 

<?php 

function test()
{

if ( isset ($_POST['submit']) )
{
	$text = $_POST['text'];
	if ( !empty ($text) )
	{
	echo $text;

	} else { echo "PLEASE ENTER TEXT"; }
}
else { echo "PLEASE SELECT";
	}

unset ($_POST['text']);
unset ($_POST['submit']);  

if ( !isset ($_POST['submit']) && !isset ($_POST['text']) )
echo "OKKKKKKKKK";

}
?>
<form id="form1" name="form1" method="post" action="">
  <label>
  <input name="text" type="text" id="text" />
  </label>
  <label>
  <input name="submit" type="submit" id="submit" value="Submit" />
  </label>
</form>

<?php
test($submit,$text)
?>

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.