-
Notifications
You must be signed in to change notification settings - Fork 2
/
vehicle_pre_reg.php
35 lines (32 loc) · 1.05 KB
/
vehicle_pre_reg.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php
session_start();
if($_SESSION["email"] == "")
{
header("location:login.php?err=em");
}
$email = $_SESSION["email"];
?>
<?php
include("connection.php");
$team_nm=$_POST['teamnm'];
$q1=$_POST['q1'];
$q2=$_POST['q2'];
$q3=$_POST['q3'];
$q4=$_POST['q4'];
$sql="Select * from vehicle_pre where team_name='$team_nm'";
$res=mysqli_query($con,$sql);
$row=mysqli_fetch_array($res);
$count_e=mysqli_num_rows($res);
if($count_e==0)
{
$sql="INSERT INTO vehicle_pre values('$team_nm','$q1','$q2','$q3','$q4','$email')";
$res=mysqli_query($con,$sql);
header("location:vehicle.php");
}
else
{
$sql="UPDATE vehicle_pre SET q1='".$q1."',q2='".$q2."',q3='".$q3."',q4='".$q4."',email='".$email."' WHERE team_name='".$team_nm."'";
$res=mysqli_query($con,$sql);
header("location:vehicle.php");
}
?>