简体   繁体   中英

PHP form not working. displays fine in IE/FF, not in chrome.

I'm a student assistant, and my job is to help maintain and update websites and databases for part of the campus I work at. Most of the websites have not been developed by me, and I'm pretty much a novice at a lot of the PHP, CSS and HTML components of my job.

We have a PHP webpage with a tutor request form on it ( link --not being students at this campus, you won't be able to login to the page...). We took the form down during the summer and would now like to reopen it for the fall. None of the code has changed since we took the form down. When we tried to bring it back up, the page loaded fine in IE and FF, but in chrome all of the content would appear, but none of the styling--it was just text on a white background.

Then, when we tried to use the form in IE or FF, it wouldn't work. After submitting a tutor request the user should be transported to a confirmation page, however the user just returns to the form, with none of the form data being sent to our database.

I believe the problem lies somewhere in the PHP but I don't know enough about that to see the problem.

Here is the code for the webpage:

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

I would post images of what the page looks like in IE, FF and Chrome, "but as a spam prevention mechanism, new users aren't allowed to post images."

I understand this isn't a lot to go on, but any help would be greatly appreciated!

Try using the validator web site - http://validator.w3.org

It will spot the problem for you.

EDIT

There is one for CSS as well. http://jigsaw.w3.org/css-validator/

Use the W3C Validator and clear your cache. It loads just fine for me.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM