+ 1

Is the following code is correct mysqli code ? I mean is it in pure sqli code ?

<html> <body bgcolor=#777 text=yellow> <form action=submit1.php method=post> <pre> id <input type=text name=id size=5> <br> User name <input type=text name=username> <br> <input type=submit> </pre> </form> </body> </html> <?php if($_SERVER["REQUEST_METHOD"]=="POST") { $id=$_POST['id']; $username=$_POST['username']; $con=mysqli_connect("localhost" , "root" , "" , "hassan"); // no space allowed b/w double quotes if(mysqli_connect_errno()) { echo "failed to connect to mysql" . my

28th Dec 2017, 7:36 PM
hassan
8 Antworten
0
so the code is in pure sqli code ??
28th Dec 2017, 9:11 PM
hassan
+ 1
<html> <body bgcolor=#777 text=yellow> <form action=submit1.php method=post> <pre> id <input type=text name=id size=5> <br> User name <input type=text name=username> <br> <input type=submit> </pre> </form> </body> </html> <?php if($_SERVER["REQUEST_METHOD"]=="POST") { $id=$_POST['id']; $username=$_POST['username']; $con=mysqli_connect("localhost" , "root" , "" , "hassan"); // no space allowed b/w double quotes if(mysqli_connect_errno()) { echo "failed to connect to mysql" . mysqli_connect_error(); } else { mysqli_query($con , "INSERT INTO student (id , username ) VALUES ('$id' , '$username')"); echo "your record is added successfully <br>"; } $con->close(); } ?>
28th Dec 2017, 8:37 PM
hassan
0
jamie i really dnt know wat is playground . im new to solo learn . if u hve whatsapp or fbook i can send the code there ...
28th Dec 2017, 8:30 PM
hassan
0
mean the code is ok ???
28th Dec 2017, 8:40 PM
hassan