+ 1
HELP
<input type='text' name='k' size ='50' value='<?php echo $_GET['k']; ?>'/> ( ! ) Notice: Undefined index: k in C:\wamp\www\project\index.php on line 12 how to fix this?
3 Answers
+ 1
if(isset($_GET['K'])) echo $_GET['K'];
Good luck đ
+ 10
OMG HELP HIM HE IS IN DANGER
+ 6
Try this:
<?php if( isset($_GET['k']) && !empty( $_GET['k'] ) ){ echo $_GET['k'];} ?>
This way, if k parameter is not mentioned in your url, the input's value will be empty otherwise it'll take the value of ?k=something.
optionally, use echo htmlspecialchars($_GET['k']); for extra security.



