This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
include('connect.php'); | |
//insert data into database | |
$username_err=$phone_err=$email_err=$password_err=''; | |
//$error=''; | |
if(isset($_POST['save'])){ | |
//inserting form data with validation | |
if(empty($_POST['username'])){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<body> | |
<form method="post" action="<?php echo $_SERVER['PHP_SELF'];?>"> | |
Name: <input type="text" name="username"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<body> | |
<form method="post" action="<?php echo $_SERVER['PHP_SELF'];?>"> | |
Name: <input type="text" name="username"> | |
<input type="submit" name="save" value="submit"> | |
</form> | |
<?php | |
if ($_SERVER["REQUEST_METHOD"] == "POST") { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title style="color:#31d818">ajax example</title> | |
<link rel="stylesheet" href="bootstrap.css" crossorigin="anonymous"> | |
<!-- Optional theme --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
include('connect.php'); | |
if(isset($_POST['save'])){ | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
include('connect.php'); | |
if(isset($_POST['save'])){ | |
$company_name = $_POST['company_name']; | |
$brand_name = $_POST['brand_name']; | |
//insert checkbox values | |
$cars = implode(',',$_POST['car_name']); | |
//insert data into database | |
$sql="INSERT INTO cars(company_name,brand_name,car_name)VALUES('$company_name','$brand_name','$cars')"; | |
$stmt=$con->prepare($sql); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
include('connect.php'); | |
if(isset($_POST['register'])){ | |
if(empty($_POST['username'])){ | |
$error['username'] = "Please enter the username"; | |
} | |
else{ | |
$username = $_POST['username']; | |
} | |
if(empty($_POST['phone_no'])){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
include('connect.php'); | |
//insert data into database | |
if(isset($_POST['save'])){ | |
$name=$_POST['name']; | |
$age=$_POST['age']; | |
$target="images/".basename($_FILES['image']['name']); | |
$sql="INSERT INTO image(name,age,image)VALUES('$name','$age','$target')"; | |
$stmt=$con->prepare($sql); | |
$stmt->execute(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
include '../connect.php'; | |
session_start(); | |
if(isset($_POST['login'])){ | |
$username = $_POST['username']; | |
$password = $_POST['password']; | |
//check login details | |
$stmt = $con->prepare("select * from users where username = '$username' and password = '$password'"); | |
$stmt->execute(); | |
//echo $stmt->rowCount(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
session_start(); | |
include '../connect.php'; | |
if($_SESSION['username']==''){ | |
header("location: login.php"); | |
} | |
?> | |
<html> | |
<head> | |
<title>ajax example</title> |
OlderNewer