Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5978135
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T21:28:14+00:00 2026-05-22T21:28:14+00:00

I’m designing a fairly simple reporting system. Right now using php(and later some Jquery)

  • 0

I’m designing a fairly simple reporting system. Right now using php(and later some Jquery) to let user log in and calculate totals and post to a database. My problems began of course when I tested the page in IE8. It has major problems with the echo <<<_END statement at line 75. Anyone know an alternate to coding the nested HTML in the PHP besides this. any help is appreciated.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
   "http://www.w3.org/TR/html4/strict.dtd">
<HTML>
   <HEAD>
        <link rel="stylesheet" type="text/css" href="OPSstyle.css" />
 </HEAD>
   <BODY>
    <div id="wrapper">



        <div id="bodyContent">


        <div id="header">
        <img id="logo" src="OPS_logo.gif" alt="OPS Logo"/>
            <p>OPS ASSESSMENT</p>

        </div>

        <div id="leftNav">
            <p>To begin please login</p>
            <a href="loginusers.php">Test Login</a><br/>
            <a href="sqltest.php">Form Test</a><br/>

        </div>

        <div id="content">
        <?php

        //Connects to database
        require_once 'login.php';
        $db_server = mysql_connect($db_hostname, $db_username, $db_password);
            if(!$db_server) die("Unable to connect to MySQL: " .mysql_error());

        mysql_select_db($db_database)
            or die ("unable to select database: " .mysql_error());

        //deletes record
        if(isset($_POST['delete']) && isset($_POST['AssessmentID']))
        {
            $AssessmentID = get_post('AssessmentID');
            $query2 = "DELETE FROM assessmentscores WHERE AssessmentID='$AssessmentID'";


            if(!mysql_query($query2, $db_server))
                echo "Delete Failed: $query(br />" .
                mysql_error() . "<br /><br />";
        }

        //Inserts record
        if (isset ($_POST['AssessmentID'])&&
                    isset($_POST['Date']) &&
                    isset($_POST['Inspector']) &&
                    isset($_POST['PlantAssist']) &&
                    isset($_POST['Safety_Total']) 
                    )
                {
                    $AssessmentID = get_post('AssessmentID');
                    $Date = get_post('Date');
                    $Inspector = get_post('Inspector');
                    $PlantAssist =get_post('PlantAssist');
                    $Safety_Total = get_post('Safety_Total');
;

                    $query = "INSERT INTO opsassessment.assessmentscores(AssessmentID, Date, Inspector, PlantAssist, `Safety_Total`) VALUES" .
                        "('$AssessmentID', '$Date', '$Inspector', '$PlantAssist', '$Safety_Total')";

                    if (!mysql_query($query, $db_server))
                        echo "INSERT failed: $query<br />" .
                        mysql_error() . "<br /><br />";
                }

    echo <<<_END
        <form action = "sqltest.php" method="post"><pre>
        AssessmentID    <input type="text" name="AssessmentID" /><br>
        Date        <input type="text" name="Date" /><br>
        Inspector   <input type="text" name="Inspector" /><br>
        PlantAssist <input type="text" name="PlantAssist" /><br>
        Safety_Total    <input type="text" name="Safety_Total" /><br>

                <input type="submit" value="ADD RECORD" /><br>
        </pre></form>
    _END;

        $query = "SELECT * FROM assessmentscores";
        $result = mysql_query($query);

        if (!$result) die("Database access failed: " .mysql_error());

        $rows = mysql_num_rows($result);

        for($j = 0; $j < $rows; ++$j)
        {
            $row= mysql_fetch_row($result);
    echo <<<_END
            <pre>
            AssessmentID:   $row[0]
            Date:           $row[1]
            Inspector:      $row[2] 
            PlantAssist:        $row[3]
            Safety_Total:       $row[4]

            </pre>

            <form action="sqltest.php" method="post">
            <input type ="hidden" name="delete" value ="yes" />
            <input type = "hidden" name="AssessmentID" value = "$row[0]" />
            <input type ="submit" value="DELETE RECORD" /></form>
    _END;
        }

        mysql_close($db_server);

        function get_post($var)
        {
            return mysql_real_escape_string($_POST[$var]);
        }


        ?>

        </div>


        <a href="form1.php">Login Form</a><br><br>

        <a href="testOPS.php">OPS Assessment</a>

        </div>
</body>
</html>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T21:28:14+00:00Added an answer on May 22, 2026 at 9:28 pm

    The Heredoc identifier must on a line of itself and must be the only thing on this line (including indentation and such). Remove the leading whitespace and make sure the newline is direct after _END;.

    However, in your case I suggest you to just leave the PHP-mode to output the plain html

    For example instead of

    echo <<<_END
        <form action = "sqltest.php" method="post"><pre>
        AssessmentID    <input type="text" name="AssessmentID" /><br>
        Date        <input type="text" name="Date" /><br>
        Inspector   <input type="text" name="Inspector" /><br>
        PlantAssist <input type="text" name="PlantAssist" /><br>
        Safety_Total    <input type="text" name="Safety_Total" /><br>
    
                <input type="submit" value="ADD RECORD" /><br>
        </pre></form>
    _END;
    

    this

    ?>
        <form action = "sqltest.php" method="post"><pre>
        AssessmentID    <input type="text" name="AssessmentID" /><br>
        Date        <input type="text" name="Date" /><br>
        Inspector   <input type="text" name="Inspector" /><br>
        PlantAssist <input type="text" name="PlantAssist" /><br>
        Safety_Total    <input type="text" name="Safety_Total" /><br>
    
                <input type="submit" value="ADD RECORD" /><br>
        </pre></form>
    <?php
    

    Its usually more readable and many IDEs are capable to recognize it and highlight the “other stuff” as html.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

this is what i have right now Drawing an RSS feed into the php,
I have just tried to save a simple *.rtf file with some websites and
I have a jquery bug and I've been looking for hours now, I can't
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm making a simple page using Google Maps API 3. My first. One marker
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I want to count how many characters a certain string has in PHP, but
For some reason, after submitting a string like this Jack’s Spindle from a text
I'm new to using the Perl treebuilder module for HTML parsing and can't figure

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.