PHP中的链接文件无法打开

时间:2011-09-07 12:20:50

标签: php

我已经开发了一个代码..我创建了一个from和in动作我正在打开另一个文件insert.php.however提交查询按钮什么都不做,我被困在同一个页面。这是我的代码。

    <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>
    <option 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>

2 个答案:

答案 0 :(得分:1)

您无法嵌入<form>个标签。它们应该像这样分开:

<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>

答案 1 :(得分:0)

这是非常糟糕的HTML。我认为你需要学习语言和基本结构。在没有收集您的要求并重写它的情况下,为了给您一个正确的“答案”,有太多的错误。