problem: generated output ends up in wrong place

topic posted Tue, November 27, 2007 - 2:59 AM by  Eira
can you point me in a better direction? every time i get something to output through the $errmsg it ends up in the top of the xhtml-code and thats about the last place it should be in.


////first part of the file////
<?php
session_start();

$username = "username";
$errmsg = "";

if (isset($_POST["user"]) && isset($_POST["pass"]))
{
require_once("code/account.php");
$username = $_POST["user"];
$password = $_POST["pass"];

$db = new account();
$db->login($username, $password);
$errmsg = $db->errormessage;
}
?>


////part where the errmsg is supposed to be printed////

<div id="owncal">
<?=$errmsg?>
</div>

//// or ////
<div id="owncal">
<?
print $errmsg;
?>
</div>
posted by:
Eira
Sweden

Recent topics in "PHP Developers"

Topic Author Replies Last Post
using dreamweavers PHP Jivatma 2 August 4, 2008
Another question about formatting date & time SMSapphire 6 June 7, 2008
phpews Satinder 0 June 4, 2008
how works with joomla ??? iShaun 1 May 22, 2008