Try $email = $_POST['email'].'@example.com'
;
How to add placeholder text into $email
-
16-07-2023 - |
Question
I have a page called check.php which contains all the validation for a registration form but i would like to basically add the placeholder (I use ) text called @example.com
into the database
Following is what I currently have
$email = $_POST['email'];
Below is what I wanted to do
$email = $_POST['email@example.com'];
La solution
Autres conseils
I think the best solution for you can be:
$email = 'email@example.com';
if(isset($_POST['email'])) {
$email = $_POST['email'];
}
?>
<form method="post">
<input type="email" name="email" placeholder="<?= $email ?>"/>
</form>
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow