Linked file in PHP not opening
I have developed a code..i have created a from and in action i m opeing another file insert.php.however the submit query button does nothing and i am stuck at the same page.here is my code.
<head>
<script language="javascript" src="calendar.js"></script>
</head>
<?php
$host="localhost"; // Host name
$username="root"; // Mysql username
$password=""; // Mysql password
$db_name="sm_sample"; // Database name
$tbl_name="sample"; // Table name
$theDate;
// Connect to server and select database.
mysql_connect("$host", "$username", "$password")or die("cannot connect");
mysql_select_db("$db_name")or die("cannot select DB");
?>
<html>
<body>
Date<form action="somewhere.php" method="post">
<?php
//get class into the page
require_once('classes/tc_calendar.php');
//instantiate class and set properties
$myCalendar = new tc_calendar("date1", true);
$myCalendar->setIcon("images/iconCalendar.gif");
$myCalendar->setdate(date('d'), date('m'), date('Y'));
//output the calendar
$myCalendar->writeScript();
?>
<?php
$theDate = isset($_REQUEST["date1"]) ? $_REQUEST["date1"] : "";
?>
<br />
<form method="post" action="insert.php">
<br />Source<br /><select input name="source">
<option value="Blogs">Blogs</option>
<option value="Facebook">Facebook</option>
<option value="Google Buzz">Google Buzz</option>
<option value="Google Plus">Google Plus</option>
<option value="LinkedIn">LinkedIn</option>
<option value="Twitter">Twitter</option>
<option value="Others">Others</option>
<option value="UNKNOWN">UNKNOWN</option>
</select>
<br /><br />
Username<br /><input type="text" name="username" />
<br /><br />
Location<br /><select input name="location">
<option value="India">India</option>
<option value="Singapore">Singapore</option>
<option value="Hongkong">Hongkong</option>
<option value="UAE">UAE</option>
<opt开发者_运维技巧ion value="Others">Others</option>
<option value="UNKNOWN">UNKNOWN</option>
</select>
<br /><br />
Category<br /><select input name="category">
<option value="User Banking Experience">User Banking Experience</option>
<option value="Credit/Debit Card">Credit/Debit Card</option>
<option value="Customer Care">Customer Care</option>
<option value="Staff Behavior">Staff Behavior</option>
<option value="Others">Others</option>
</select>
<br /><br />
Complaint<br /><input type="text" name="complaint" />
<br /><br />
Status<br /><select input name="status">
<option value="Pending">Pending</option>
<option value="In Process">In Process</option>
<option value="Resolved">Resolved</option>
<option value="Insufficient Information">Insufficient Information</option>
</select>
<br /><br />
</form>
</select>
<br /><br />
<input type="submit" />
</form>
You can't have embedded <form>
tags. They should be separated like so:
<form action="1.php">
<!-- fields and so forth -->
<input type="submit">
</form>
<form action="2.php">
<!-- fields for a second form -->
<input type="submit">
</form>
This is really poorly formed HTML. I think you need to study the language and basic constructs a bit. There are really too many things wrong with this to give you a correct "answer" without gathering your requirements and rewriting it.
精彩评论