0
Hi, I’m a newbie and would like to know how I can pass the value of the placeholder to a variable ($email)
<input type="text" class="form-control" placeholder="Email" = name=""/>
0
Hi, I’m a newbie and would like to know how I can pass the value of the placeholder to a variable ($email)
<input type="text" class="form-control" placeholder="Email" = name=""/>
0
There are some ways you can pass on the value of your input
.
As you’re new, I’ll show you a very simple way. The default
<form action="serarquivo.php" method="post">
<label for="email">Email</label>
<input type="email" placeholder="email" name="email">
</form>
In his serarquivo.php you receive your variable according to the attribute
name
of yourinput
<?php
$_email = $_POST['email'];
echo "O e-mail recebido foi ".$_email;
?>
There are some ways to submit from your form, which are:
Reference: https://www.tutorialspoint.com/php/php_get_post.htm
Browser other questions tagged php
You are not signed in. Login or sign up in order to post.
For example: You would like to save only the word "Email" ?
– adventistaam
i would like to play what the user write in the Email field for within the variable $email
– Leonardo
but why do you want to do this ?
– David Santos
i am trying to implement a system to recover the password, then in case I would play the value that the user passed to the variable and use it to give an update only in the email informed, I do not know if it was possible to understand
– Leonardo
it is not better to define a name in this input and make $email = $_POST['input name'] ?
– David Santos
placeholder="Email" = name="" this does not exist.
– user60252
Ahh then you want to retrieve the input text for php.. The placeholder is just a hint to show what the user should fill in
– adventistaam