guys sorry for being so noob but im still starting yet with my php, what im trying to do is to do is to out put the result on the same page .
<html>
<body>
<?php
error_reporting(E_ALL ^ E_NOTICE);
$button=$_POST['button_validate'];
if(isset($button)){
error_reporting(E_ALL ^ E_NOTICE);
$text=$_POST['text_validate'];
if(empty($text)){
echo "your email must have at least 1 number";
} else {
echo "this is valid";
}
} else {
?>
<form action="validate.php" method="post">
Validate text<input type="text" name="text_validate">
<input type="submit" value="Validate" name="button_validate">
</form>
<?php } ?>
</body>
</html>
but instead of showing the out put on the same page in makes a new page.. is there a code on how to output this on the same page or its just in the logic?
try doing this in your form tag:
then your data will be submitted to the same page. I hope this helps.