PHP obtain form value problem
再见理想
再见理想 2019-02-16 19:23:43
0
6
1504
<input type="text" name="keyword" value ="<?php  echo $_POST['keyword'] ;?>"  required="required">

The code is as shown above

After entering the value in the save form, I use $_Post to get the value, and then output it in value


But when opening the web page, the value is empty, $_POST cannot get anything, and an error will be reported

How to solve it

再见理想
再见理想

reply all(5)
phpcn_u146783

can be changed to this

<?php echo $_POST['keyword'] ?? '';?>


天幕流光_-

Declare a variable assignment in the php code and then output it; or use a function to judge (isset)

天幕流光_-

You are mainly reporting an error because the keyword does not exist

天幕流光_-

$_POST is used to receive the data submitted by the form. If it is not submitted or the key value does not exist, an error will be reported

jjJ

Are you sure you passed the value?

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template