insert - PHP Online
Form of PHP Sandbox
Enter Your PHP code here for testing/debugging in the Online PHP Sandbox. As in the usual PHP files, you can also add HTML, but do not forget to add the tag <?php
in the places where the PHP script should be executed.
Result of php executing
Full code of insert.php
- <?php
- $host = "127.0.0.1";
- $user = "root";
- $pass = "";
- $database = "myangularapp";
- $con = mysql_connect($host,$user,$pass);
- if (!$con) {
- die('Could not connect: ' . mysql_error());
- }
- echo 'Connected successfully';
- mysql_select_db($database,$con);
- $date= json_decode(file_get_contents("php://input"));
- $FName=mysql_real_escape_string($date->FName);
- $LName=mysql_real_escape_string($date->LName);
- $IDno=mysql_real_escape_string($date->IDno);
- $CellNo=mysql_real_escape_string($date->CellNo);
- $Password=mysql_real_escape_string($date->Password);
- mysql_connect("localhost","root","");
- mysql_select_db("myangularapp");
- mysql_query("INSERT INTO profile (`First_Name`,`Last_Name`,`ID_Number`,`Cell_Number`,`Password`)VALUES('".$FName."','".$LName."','".$IDno."','".$CellNo."','".$Password."',) ");
- ?>
File Description
- insert
- PHP Code
- 06 Jul-2020
- 852 Bytes
You can Share it:
Latest PHP Pastes