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

  • SEARCH
  • Home
  • 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 4593392
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T22:40:38+00:00 2026-05-21T22:40:38+00:00

So I’ve got a fill out form on an HTML page passed to a

  • 0

So I’ve got a fill out form on an HTML page passed to a PHP script. The PHP runs fine but I’m having some trouble getting the HTML on the PHP page to display. If in the body of the HTML I do <?php echo $message; ?> the variable displays fine. But as soon as I try to add formatting (divs and headers specifically) nothing displays on the page. Here’s what I’ve got.

<?php
session_start();

//declare variables
$name = $_POST['name'];
$email = $_POST['email'];
$phone = $_POST['phone'];
$comments = $_POST['comments'];
$date = $_POST['date'];
$time = $_POST['time'];
$company = 'Test company';

$_SESSION['name'] = $name;
//strip of invalid chars
$date = str_replace( '/' , '.' , $date);

//fopen
$pathToMe = dirname(__FILE__);
$fileName = $pathToMe . "/days/" . $date;
$fileHandle = fopen($fileName, 'w') or die("Failure.");
fwrite($fileHandle, $name . "\n" . $email . "\n" . $phone . "\n" . $date . "\n" . $time . "\n" . $comments . "\n" . "\n" ); 
fclose($fileHandle);

//email to company
$to = 'test@testserver.com';
$subject = 'Apointment scheduled online';
$body = "An apointment was just scheduled online.\n" . $name . "\n" . $email . "\n" . $phone . "\n" . $date . "\n" . $time . "\n" . $comments . "\n" . "\n" . "Please follow up to confirm.";
if (mail($to, $subject, $body)) {
    $companyConfirm = 'yes';
} else {
    $companyConfirm = 'no';
}

//client confirm
$to = $email;
$subject = 'Confirming your appointment';
$body = "Hello " . $name . "," . "\n" . "\n"  . "You recently booked an appointment with " . $company . " on " . $date . " at " . $time . ".\n" . "\n" . "We will follow up soon to confirm.";
if (mail ($to, $subject, $body)) {
    $confirm = 'yes';
} else {
    $confirm = 'no';
}

//confirm email
if ($companyConfirm = $confirm) {
    if ($companyConfirm = 'yes') {
        $message = "Your appointment has been confirmed. You will recieve a confirmation email shortly";
        print "<div id=\"jqt\"><div id=\"home\" class=\"current\"><h1>Scheduler</h1><ul class=\"edit rounded\"><li>" . $message;
    }
    else {}
} else {
    $message = "There was a problem making your appointment. Please call to schedule.";
}

$_SESSION['message'] = $message;
?>

<html>
<body>
<div id="home">
<div class="toolbar">
<h1>Scheduler</h1>
<a class="back" href="#home">Back</a>
</div>
<ul class="edit rounded">
<li><?php echo $message; ?></li>
</ul>
</div>
</div>
</body>
</html>

Any thoughts as how to get $message displayed inline with formatting would be greatly appreciated.

  • 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-21T22:40:38+00:00Added an answer on May 21, 2026 at 10:40 pm

    Have you tried in other browsers?

    It seems that you have an extra </div> before </body>

    If that is the case, even if it does not show up on your browser window, you should see it if you look at the html source.

    EDIT: and you also have that print statement which leaves a a li and a lot of div tags opened

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

Sidebar

Related Questions

No related questions found

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.