<?php
include('include/connection.php');
session_start();
$_SESSION['verify_remote_agent']=$_SERVER['HTTP_USER_AGENT'];
$r=session_id();
if(isset($next)) {
$city=$_POST['city'];
$from_city=$_POST['from_city'];
$to_city=$_POST['to_city'];
$query="INSERT INTO user_details values('$r','$city',$from_city,'$to_city')";
mysql_query($query);
}
?>
<div class="container">
<form action="index2.php" method="POST">
<div class="form-group city col-sm-4">
<select class="form-control" name="city">
<option value="choose">Choose City</option>
<option value="option[1]">Delhi/NCR</option>
<option value="others">Other</option>
</select>
</div>
<div class="form-group from_city col-sm-4">
<input type="text" class="form-control" name="from_city" placeholder="From Area">
</div>
<div class="form-group to_city col-sm-4">
<input type="text" class="form-control" name="to_city" placeholder="To Area">
</div>
<p class="text-right">
<input class="btn btn-primary" type="submit" value="Next Step" name="next">
</p>
</form>
</div>
答案 0 :(得分:1)
试试这个:
$query="INSERT INTO user_details values('".$r."','".$city."','".$from_city."','".$to_city."')";
mysql_query($query);