PHP GET error report
Shelby
Shelby 2019-01-24 16:40:58
0
2
1571

<?php


##Teaching web page:

//m.sbmmt.com/code/1040.html#code_down_li


This line of code keeps reporting errors in phpstorm:

C:\xampp\php\php.exe "D:\Yangsipeng\ code\PS php CODE\reg.php"


PHP Notice: Undefined index: username in D:\Yangsipeng\code\PS php CODE\reg.php on line 3
Notice: Undefined index: username in D:\Yangsipeng\code\PS php CODE\reg.php on line 3
PHP Notice: Undefined index: pwd in D:\Yangsipeng\code\PS php CODE\reg.php on line 7
< ;br />
Notice: Undefined index: pwd in D:\Yangsipeng\code\PS php CODE\reg.php on line 7
<br />
Process finished with exit code 0
The same prompt appears when opening the web page. The html file is written according to the instructions and the two files are also put together.



//$_GET Add square brackets after it, and put username as a string inside the square brackets, and you will get the value of <input type="text" name="username" /> in the form

$u = $_GET[ 'username'];
echo $u.'<br />';

//$_GET['pwd'] Get form<input type="text" name="username " The value of />
$passwd = $_GET['pwd'];
echo $passwd.'<br />';
?>

Shelby
Shelby

reply all(1)
韦小宝

Undefined index: username You can print it directly in PHP $_GET to see if there is a username field

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