문제

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'];

도움이 되었습니까?

해결책

Try $email = $_POST['email'].'@example.com';

다른 팁

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>
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top