PHP表单不起作用。在IE / FF中显示正常,而不是在Chrome中显示。

时间:2012-09-21 18:53:08

标签: php html css forms

我是学生助理,我的工作是帮助维护和更新我工作的校园的部分网站和数据库。大多数网站都不是由我开发的,而且我几乎是我工作中很多PHP,CSS和HTML组件的新手。

我们有一个PHP网页,上面有一个导师申请表(link - 不是这个校区的学生,你将无法登录页面......)。我们在夏天把表格放下来,现在想在秋天重新开放。 自从我们将表单删除后,所有代码都没有更改。当我们尝试将其重新启动时,页面在IE和FF中正常加载,但是在chrome中,所有内容都会出现,但没有造型 - 它只是在白色背景上的文字。

然后,当我们尝试在IE或FF中使用该表单时,它将无法正常工作。提交导师请求后,应将用户转移到确认页面,但是用户只需返回表单,而不会将任何表单数据发送到我们的数据库。

我认为这个问题存在于PHP的某个地方,但我不太了解这个问题。

以下是网页的代码:

<?php
require_once("../application_processing/config.php");
session_start();

$dbinfo = new DbInfo();
$db = "sss";
$qtr = checkOpen($dbinfo, $db);

if (fetchTicket("sss/tutor_request")) {
    $username = $_SESSION['username'];
    $fname = $_SESSION['fname'];
    $lname = $_SESSION['lname'];

    if ($fname == "" || $fname == NULL) {
        $fname = "SAS";
        $lname = "Admin";
    }

    $result = getPreviousSubmission($_SESSION['username'], $dbinfo, $db, "tutor_request", $qtr);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-us" lang="en-us"><!-- InstanceBegin template="/Templates/sas_sss.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
<!--
Cal Poly Web Template v3.4

Code developed by
Information Technology Services
California Polytechnic State University
San Luis Obispo, CA 93407
-->
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<!-- InstanceBeginEditable name="doctitle" -->
<title>Tutor Request Form - Student Support Services - Cal Poly</title>
<?php require_once("../application_processing/restore.php"); ?>
<script type="text/javascript" language="javascript" src="http://sas.calpoly.edu/javascript/jquery.js"></script>
<script type="text/javascript" language="javascript" src="http://sas.calpoly.edu/javascript/form_validation_new.js"></script>
<script type="text/javascript" language="javascript" src="javascript/tut_req_app_form.js"></script>
<!-- InstanceEndEditable -->
<meta name="codebase" content="3.4" />
<meta name="layout" content="cp template" />
<meta name="author" content="Therin Irwin" />
<meta name="keywords" content="Student Academic Services" />
<meta name="description" content="Assisting in the development of academic and personal skills" />
<!--Externally linked stylesheet that stylizes the template-->
<link href="http://sas.calpoly.edu/common/css/cp_screen_3.4.css" rel="stylesheet" type="text/css" media="screen" />
<link href="http://sas.calpoly.edu/common/css/cp_print_3.4.css" rel="stylesheet" type="text/css" media="print" />
<link href="http://sas.calpoly.edu/css/screen.css" rel="stylesheet" type="text/css" media="screen" />
<link href="http://sas.calpoly.edu/css/print.css" rel="stylesheet" type="text/css" media="print" />
<!-- InstanceBeginEditable name="head" --><!-- InstanceEndEditable -->
<!--Favicon-->
<link rel="shortcut icon" href="http://sas.calpoly.edu/common/images/favicon.ico" />
</head>
<body>
<!--Container div that encloses the whole template-->
<div id="container">
  <!--This skiplink provides easier accessibility-->
  <div id="skiplink"><a href="#content">Skip to Content</a></div>
  <!--Header-->
  <div id="header">
    <!--Cal Poly Logo-->
    <div id="cplogo"><a href="http://www.calpoly.edu/"><img src="http://sas.calpoly.edu/common/images/header/cp_logo.gif" alt="Cal Poly" title="Go to Cal Poly Home" width="166" height="60" /></a></div>
    <!--The Content Area of the Header-->
    <div id="headercontent">
      <!--Dept Logo-->
      <a href="http://sas.calpoly.edu/sss/index.html"><img src="http://sas.calpoly.edu/images/sas_logo.png" alt="dept logo" name="headerimage" width="53" height="50" id="headerimage" title="Go to department home page" /></a>
      <!--Dept Name-->
      <div id="deptname">
        <p id="department_name"><a href="http://sas.calpoly.edu/index.html">Student Academic Services</a></p>
        <!--Dept Info-->
        <p id="optional_deptinfo">Student Support Services(<acronym>SSS</acronym>)</p>
      </div>
    </div>
    <!--Search Box-->
    <div id="search">
      <form id="gs" method="get" title="Search Form" action="http://search.calstate.edu/search">
        <div>
          <input type="hidden" name="site" value="slo-CalPoly" />
          <input type="hidden" name="output" value="xml_no_dtd" />
          <input type="hidden" name="client" value="slo-CalPoly" />
          <input type="hidden" name="proxystylesheet" value="slo-CalPoly" />
          <input type="hidden" name="sitesearch" value="sas.calpoly.edu" />
          <label for="q">Search SAS</label>
          <br />
          <input type="text" name="q" id="q" title="Search Text" size="12" maxlength="256" alt="Search Text" />
          <input type="image" name="submit" id="submit" src="http://sas.calpoly.edu/common/images/utli_search/search.png" alt="Go" title="Submit Search Query" />
        </div>
      </form>
    </div>
    <!--California Polytechnic State University-->
    <div id="cp">
      <p>California Polytechnic State University</p>
    </div>
  </div>
  <!--End Header-->
  <!--Main Image-->
  <div id="main-image"></div>

  <!--Left Navigation-->
  <div id="leftnav">
    <!--For accessibility reasons, this "Navigation" text has been added for readability for screen readers-->
    <h1>Navigation</h1>
<h2>SSS</h2>
<ul>
    <li><a href="http://sas.calpoly.edu/sss/index.html">What is <acronym>SSS</acronym>?</a></li>
    <li><a href="http://sas.calpoly.edu/sss/aa.html">Services</a></li>
    <li><a href="http://sas.calpoly.edu/sss/eligibility.html">Eligibility</a></li>
    <li><a href="http://sas.calpoly.edu/sss/enhancement.html">Academic Enhancement</a></li>
    <li><a href="http://sas.calpoly.edu/sss/enhancement.html#gpsa">Graduate and Professional School Advising</a></li>
    <li><a href="http://sas.calpoly.edu/main/newsletter.html">Newsletter</a></li>
  <li><a href="http://sas.calpoly.edu/sss/staff.html">SSS Staff</a></li>
    <li><a href="http://sas.calpoly.edu/sss/grantaward.html">SSS Grant Award</a></li>
</ul><!--Nav Content Area 1-->
    <div id="navcontent1"> <!-- InstanceBeginEditable name="navcontent1" --><!-- InstanceEndEditable --> </div>
  </div>
  <!--Defines 2-Column Layout-->
  <div id="content-2col">
    <!--Breadrumb-->
    <div id="breadcrumb"><a href="http://sas.calpoly.edu/index.html">Student Academic Services</a>&nbsp;<!-- InstanceBeginEditable name="breadcrumb" -->&gt; <abbr><a href="http://sas.calpoly.edu/sss/index.html">SSS</a></abbr> &gt; Tutor Request<!-- InstanceEndEditable --></div>
    <!--Begin Main Body Content-->
    <div id="content"> <!-- InstanceBeginEditable name="content" -->
    <h1>SSS Individual Tutor Request</h1>
    <?php
    if ($qtr != NULL) {
    ?>
    <h4><?php print($qtr[1]); ?></h4><br />
    <h3 class="red"><?php require_once("../application_processing/error_report.php"); ?></h3>
    <?php
    if (mysql_num_rows($result) > 0) {
    ?>
        <h3>Tutor Requests:</h3><p>
        <?php
        $first = true;

        while ($row = mysql_fetch_array($result)) {
            if (!$first)
                print(", ");

            $subj = $row[0];
            $num = $row[1];
            $times = $row[2];

            print($subj . " " . $num);
            $first = false;
        }
        ?></p>

        <?php
        if (mysql_num_rows($result) >= 6) {
        ?>
        <h3 class="red">The maximum number of tutor requests has been reached for this quarter (6).</h3>
        <?php }
    } ?>
    <span id="error"></span>
    <form action="process_tutor.php" method="post" id="TutReqApplication" name="TutReqApplication">
        <fieldset>
            <legend>Student Information</legend>
            <div class="inputBox">
                <label for="fname">Name: <?php echo($fname." ".$lname); ?></label><br />&nbsp;<br />
                <label for="username">Cal Poly E-mail: <?php echo($username);?>@calpoly.edu</label>
            </div>

            <input id="username" name="username" type="hidden" value="&lt;?php print($username);?>" />
            <input id="fname" name="fname" type="hidden" value="&lt;?php echo($fname);?>" />
            <input id="lname" name="lname" type="hidden" value="&lt;?php echo($lname);?>" />

            <div class="inputBox">
                <label for="phone">Primary Number: </label><input class="phoneInput" name="phone" id="phone" type="text" maxlength="14" />
                <em class="annot">e.g. 555-444-3210</em>
            </div>
        </fieldset>

        <fieldset>
            <legend>Course and Tutor Information</legend>
            <div class="inputBox">
                <label for="dept">Course Requested: </label>
                <select id="dept" name="dept">
                    <option value="">Select</option>
                    <option value="AERO">AERO</option>
                    <option value="AG">AG</option>
                    <option value="AGB">AGB</option>
                    <option value="AGC">AGC</option>
                    <option value="AGED">AGED</option>
                    <option value="ANT">ANT</option>
                    <option value="ARCE">ARCE</option>
                    <option value="ARCH">ARCH</option>
                    <option value="ART">ART</option>
                    <option value="ASCI">ASCI</option>
                    <option value="ASTR">ASTR</option>
                    <option value="BIO">BIO</option>
                    <option value="BOT">BOT</option>
                    <option value="BRAE">BRAE</option>
                    <option value="BUS">BUS</option>
                    <option value="CD">CD</option>
                    <option value="CE">CE</option>
                    <option value="CHEM">CHEM</option>
                    <option value="CM">CM</option>
                    <option value="CPE">CPE</option>
                    <option value="CRP">CRP</option>
                    <option value="CRSC">CRSC</option>
                    <option value="CSC">CSC</option>
                    <option value="DANC">DANC</option>
                    <option value="DSCI">DSCI</option>
                    <option value="ECON">ECON</option>
                    <option value="EDES">EDES</option>
                    <option value="EDUC">EDUC</option>
                    <option value="EE">EE</option>
                    <option value="EHS">EHS</option>
                    <option value="ENGL">ENGL</option>
                    <option value="ENGR">ENGR</option>
                    <option value="ENVE">ENVE</option>
                    <option value="ES">ES</option>
                    <option value="FNR">FNR</option>
                    <option value="FORL">FORL</option>
                    <option value="FR">FR</option>
                    <option value="FRSC">FRSC</option>
                    <option value="FSN">FSN</option>
                    <option value="GEOG">GEOG</option>
                    <option value="GEOL">GEOL</option>
                    <option value="GER">GER</option>
                    <option value="GRC">GRC</option>
                    <option value="GSA">GSA</option>
                    <option value="GSB">GSB</option>
                    <option value="HIST">HIST</option>
                    <option value="HNRS">HNRS</option>
                    <option value="HUM">HUM</option>
                    <option value="IME">IME</option>
                    <option value="IT">IT</option>
                    <option value="ITAL">ITAL</option>
                    <option value="JOUR">JOUR</option>
                    <option value="JPNS">JPNS</option>
                    <option value="KINE">KINE</option>
                    <option value="LA">LA</option>
                    <option value="LIB">LIB</option>
                    <option value="LS">LS</option>
                    <option value="MATE">MATE</option>
                    <option value="MATH">MATH</option>
                    <option value="MCRO">MCRO</option>
                    <option value="ME">ME</option>
                    <option value="MSC">MSC</option>
                    <option value="MU">MU</option>
                    <option value="PE">PE</option>
                    <option value="PEM">PEM</option>
                    <option value="PEW">PEW</option>
                    <option value="PHIL">PHIL</option>
                    <option value="PHYS">PHYS</option>
                    <option value="PM">PM</option>
                    <option value="POLS">POLS</option>
                    <option value="PSC">PSC</option>
                    <option value="PSY">PSY</option>
                    <option value="REC">REC</option>
                    <option value="RELS">RELS</option>
                    <option value="SCM">SCM</option>
                    <option value="SOC">SOC</option>
                    <option value="SOCS">SOCS</option>
                    <option value="SPAN">SPAN</option>
                    <option value="SPC">SPC</option>
                    <option value="SS">SS</option>
                    <option value="STAT">STAT</option>
                    <option value="TH">TH</option>
                    <option value="VGSC">VGSC</option>
                    <option value="VS">VS</option>
                    <option value="WS">WS</option>
                    <option value="ZOO">ZOO</option>
                </select>
                <input type="text" class="medInput" name="coursenum" id="coursenum" maxlength="3" /><br />
            </div>

            <div class="inputBox">
                <label for="instructor">Instructor: </label><input name="instructor" id="instructor" type="text" maxlength="30" />
                <em class="annot">e.g. Staley, Clinton (Last, First).</em>
            </div>
            <div class="inputBox">
                <textarea id="comments" name="comments" class="dim" cols="40" rows="5">Enter any other things you would like us to know here (available time, preferred tutor, etc.)</textarea>
            </div>
        </fieldset>

        <fieldset>
            <legend>Terms of Agreement</legend>
            <p><em>I understand that by signing this contract I agree to meet with my tutor a minimum of two hours per week, a maximum of ten hours per week, for the duration of the quarter. <strong>Missing more than two (2) tutorial sessions, without prior clearance from SSS staff, including my tutor, will result in a suspension of individual tutoring services for the following quarter.</strong> I also understand that in the event that I drop my course, it is my responsibility to contact SSS to cancel this request. Failure to do so may also result in my tutor services being suspended.</em></p>

            <p>By typing your full name below, you agree to adhere to the statements above and are providing an electronic signature.</p>          
            <div class="inputBox">
                <label for="signature">Student Signature: </label><input type="text" name="signature" id="signature" maxlength="30" /><br />&nbsp;<br />
            <p id="errorMessage">&nbsp;</p>
                <input type="submit" value="Submit Tutor Request" />
            </div>
        </fieldset>
    </form>
    <?php }
    else {
    ?>
    <h3>Sorry - The application is closed for the remainder of the quarter. Try again next quarter.</h3>
    <?php
    }
    ?>
      <!-- InstanceEndEditable --> </div>
    <!--End Main Body Content-->
  </div>

  <!--Footer-->
  <div id="footer">
    <!--Footer Gold Bar Links-->
    <div id="footer_links">
      <p> <a href="http://www.calpoly.edu/" title="Cal Poly Home">CP Home</a> <span class="textBullet">&bull;</span> <a href="http://www.calpoly.edu/cpfindit.html" title="Cal Poly Find-It, Directories and Search">CP Find It</a> </p>
      <p> <a href="http://get.adobe.com/reader/" title="Download Adobe Reader for viewing PDFs">Get Adobe Reader</a> <span class="textBullet">&bull;</span> <a href="http://office.microsoft.com/en-us/downloads/default.aspx" title="Microsoft Office Converters &amp; Viewers">Microsoft Viewers</a> </p>
    </div>
    <!--Footer Dept Links-->
    <div id="footer_deptlinks">
      <p><a href="http://sas.calpoly.edu/main/staff.html" title="Student Academic Services Staff">Staff</a> <span class="textBullet">&bull;</span> <a href="http://sas.calpoly.edu/main/sitemap.html">Site Map</a> <span class="textBullet">&bull;</span> <a href="http://sas.calpoly.edu/employment/index.html">Student Employment</a></p>
      <p>Last Update: <!-- InstanceBeginEditable name="lastupdate" --><!-- #BeginDate format:Am2 -->9/20/12<!-- #EndDate --><!-- InstanceEndEditable --></p>
    </div>
    <!--Footer Dept Info-->
    <div id="footer_deptinfo">
      <p>Student Support Services<br />
        Student Services, Bldg 124, Rm 119<br />
        California Polytechnic State University<br />
        San Luis Obispo, Ca 93407-0203<br />
        805.756.1395<br />
      <a href="mailto:cmargari@calpoly.edu">cmargari@calpoly.edu</a></p>
    </div>
  </div>
  <!--End Footer-->
</div>
</body>
<!-- InstanceEnd --></html>
<?php } ?>

我会在IE,FF和Chrome中发布该页面的图像,“但作为垃圾邮件防范机制,不允许新用户发布图片。”

我知道这不是很多,但任何帮助将不胜感激!

2 个答案:

答案 0 :(得分:2)

尝试使用验证器网站 - http://validator.w3.org

它会为你发现问题。

修改

CSS也有一个。 http://jigsaw.w3.org/css-validator/

答案 1 :(得分:0)

使用W3C Validator并清除缓存。它对我来说很好。