Code is being cut off

imtuned

New Member
Messages
4
Reaction score
0
Points
0
I uploaded a file and only the end part of that file is being shown. I've checked everything but I am now sure of what is causing this. I have provided the code being shown and the full code below.

Here is the code that is being shown on the live webpage (via view-source):
Code:
[TABLE]
[TR]
[TD="class: webkit-line-number"][/TD]
[TD="class: webkit-line-content"]<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">[/TD]
[/TR]
[TR]
[TD="class: webkit-line-number"][/TD]
[TD="class: webkit-line-content"]<html xmlns="http://www.w3.org/1999/xhtml">[/TD]
[/TR]
[TR]
[TD="class: webkit-line-number"][/TD]
[TD="class: webkit-line-content"]</fieldset>[/TD]
[/TR]
[TR]
[TD="class: webkit-line-number"][/TD]
[TD="class: webkit-line-content"]</div>[/TD]
[/TR]
[TR]
[TD="class: webkit-line-number"][/TD]
[TD="class: webkit-line-content"][/TD]
[/TR]
[TR]
[TD="class: webkit-line-number"][/TD]
[TD="class: webkit-line-content"]<div style="float:left; margin-top: 40px; width:300px" id="settings2">[/TD]
[/TR]
[TR]
[TD="class: webkit-line-number"][/TD]
[TD="class: webkit-line-content"]<fieldset>[/TD]
[/TR]
[TR]
[TD="class: webkit-line-number"][/TD]
[TD="class: webkit-line-content"]<legend><h2>Others</h2></legend>[/TD]
[/TR]
[TR]
[TD="class: webkit-line-number"][/TD]
[TD="class: webkit-line-content"]Other stuff here[/TD]
[/TR]
[TR]
[TD="class: webkit-line-number"][/TD]
[TD="class: webkit-line-content"]</fieldset>[/TD]
[/TR]
[TR]
[TD="class: webkit-line-number"][/TD]
[TD="class: webkit-line-content"]</div></div>[/TD]
[/TR]
[TR]
[TD="class: webkit-line-number"][/TD]
[TD="class: webkit-line-content"]    </div id"right"> [/TD]
[/TR]
[TR]
[TD="class: webkit-line-number"][/TD]
[TD="class: webkit-line-content"]    [/TD]
[/TR]
[TR]
[TD="class: webkit-line-number"][/TD]
[TD="class: webkit-line-content"]<!--Footer-->[/TD]
[/TR]
[TR]
[TD="class: webkit-line-number"][/TD]
[TD="class: webkit-line-content"]    <div id="footer"><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">[/TD]
[/TR]
[TR]
[TD="class: webkit-line-number"][/TD]
[TD="class: webkit-line-content"]<html xmlns="http://www.w3.org/1999/xhtml">[/TD]
[/TR]
[TR]
[TD="class: webkit-line-number"][/TD]
[TD="class: webkit-line-content"]<head>[/TD]
[/TR]
[TR]
[TD="class: webkit-line-number"][/TD]
[TD="class: webkit-line-content"]<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />[/TD]
[/TR]
[TR]
[TD="class: webkit-line-number"][/TD]
[TD="class: webkit-line-content"]</head>[/TD]
[/TR]
[TR]
[TD="class: webkit-line-number"][/TD]
[TD="class: webkit-line-content"][/TD]
[/TR]
[TR]
[TD="class: webkit-line-number"][/TD]
[TD="class: webkit-line-content"]<p align="center">imtuned © 2012 | <a href="[URL="http://imtuned.x10.mx/imtuned/"]/imtuned/[/URL]">About</a> | <a href="[URL="http://imtuned.x10.mx/imtuned/tos.php"]/imtuned/tos.php[/URL]">Terms of Service</a> | <a href="[URL="http://imtuned.x10.mx/imtuned/privacy.php"]/imtuned/privacy.php[/URL]">Privacy Policy</a> </p></div>[/TD]
[/TR]
[TR]
[TD="class: webkit-line-number"][/TD]
[TD="class: webkit-line-content"]    </div> [/TD]
[/TR]
[TR]
[TD="class: webkit-line-number"][/TD]
[TD="class: webkit-line-content"]  </body>[/TD]
[/TR]
[TR]
[TD="class: webkit-line-number"][/TD]
[TD="class: webkit-line-content"]</html>[/TD]
[/TR]
[/TABLE]

Here is the actual code from the file:
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml">
<?
/**User has submitted form without errors and user's account has been edited successfully.*/
if(isset($_SESSION['useredit'])){
   unset($_SESSION['useredit']);
   
   echo "<h1>User Account Edit Success!</h1>";
   echo "<p><b>$session->username</b>, your account has been successfully updated. "
       ."</p>";
}
else{


/**If user is not logged in, then don't display anything.If user is logged in, then display the form to editaccount information, with the current email address already in the field.*/
if(!$session->logged_in){
	header("Location: http://imtuned.x10.mx/");
} else {	
?>


<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo $config['SITE_NAME'];?><?php echo $config['SEPARATOR'];?>Settings</title>
<meta name="description" content="<?php echo $config['SITE_DESC'];?>" />
<meta name="keywords" content="<?php echo $config['SITE_KEYWORDS'];?>" />
</head>
<html>
<body> 


    <div id="outer">
    <div id="header"> <?php include("header.php") ?></div>


<!--Left content-->
    <div id="left"><?php include("left.php") ?></div>


<!--Right Content-->  
    <div id="right"><div id="settings">
    	<div style="float:left; width:400px" id="settings1">
    	<h1 style="clear:both">User Account Edit : <?php echo $session->username; ?></h1><br>


<fieldset>
<legend><h2>Basic Information</h2></legend>
<?php if($form->num_errors > 0){ echo "<font size=\"2\" color=\"#ff0000\">".$form->num_errors." error(s) found</font>";} ?> <form action="process.php" method="POST">


<label for="curpass">Current Password:</label><input type="password" id="curpass" name="curpass" maxlength="30" value="
<?php echo $form->value("curpass"); ?>"><?php echo $form->error("curpass"); ?><br><br><br>


<label for="newpass">New Password:</label><input type="password" id="newpass" name="newpass" maxlength="30" value="
<?php echo $form->value("newpass"); ?>"><?php echo $form->error("newpass"); ?><br><br>


<label for="conf_newpass">Confirm New Password:</label><input type="password" id="conf_newpass" name="conf_newpass" maxlength="30" value="
<?php echo $form->value("newpass"); ?>"><?php echo $form->error("newpass"); ?><br><br>


<label for="email">Email:</label><input type="text" id="email" name="email" maxlength="50" value="
<?php if($form->value("email") == ""){echo $session->userinfo['email'];}else{echo $form->value("email");}?>"><br>
<?php echo $form->error("email"); ?><br>


<input type="hidden" name="subedit" value="1">
<input type="submit" style="width:150px; height:25px;" value="Submit Changes">


</form>
<?php } } ?>
</fieldset>
</div>


<div style="float:left; margin-top: 40px; width:300px" id="settings2">
<fieldset>
<legend><h2>Others</h2></legend>
Other stuff here
</fieldset>
</div></div>
    </div id"right"> 
    
<!--Footer-->
    <div id="footer"><?php include("footer.php"); ?></div>
    </div> 
  </body>
</html>

Thank you in advance!
 

misson

Community Paragon
Community Support
Messages
2,572
Reaction score
72
Points
48
Take a closer look at the generated page source and ask yourself: "what PHP code does this correspond to? What code generates the missing output? Under what conditions is that missing output printed (or not printed)? Where are those $session and $config variables set?" If you're still unsure about what the code is actually doing, run it on your own server (which you should be running for all development work, in any case) with XDebug installed and use an interactive debugger.

Please use
PHP:
 or [html] instead of [code] (when appropriate) for syntax highlighting. Also, pick and apply an [URL="http://en.wikipedia.org/wiki/Indent_style"]indent style[/URL].

[url=http://sscce.org/]Code samples[/url] should be minimized. When asking about web development, include a link to a live web page.

Don't use [URL="http://stackoverflow.com/questions/200640/are-php-short-tags-acceptable-to-use"]short tags[/URL]. They're not enabled on all hosts, and are problematic in XML and XHTML documents.

Read up on HTTP (try [URL="http://www.jmarshall.com/easy/http/"]HTTP Made Really Easy[/URL] and [URL="http://net.tutsplus.com/tutorials/other/http-headers-for-dummies/"]HTTP Headers for Dummies[/URL]) and you'll understand what's wrong with the location for your call to [c]header()[/c]. You're also missing a call to [url=http://php.net/session_start][c]session_start()[/c][/url] (the same restrictions that apply to [c]header()[/c] apply here); read [URL="http://www.php.net/manual/en/book.session.php"]PHP sessions[/URL] for more info.

Instead of nesting if-else blocks in an else block, use [URL="http://php.net/elseif"]elseif[/URL] blocks:
[php]if (...) {
    ...
} elseif (...) {
    ...
} else {
    ...
}

You've got an extra <html> element, and a <fieldset> as a parent of a <form> (rather than the other way around). You're also outputting elements that should be descendants of <body> as children of <html> in the first "if" block. Run your pages through an HTML validator. Your use of <label>, in contrast, looks spot-on.

<br/> isn't being used semantically; use something more appropriate, such as a paragraph or list element, or apply styling to existing elements. HTML class names and IDs should also be semantic; "left" and "right" describe the presentation, not semantics, of elements.

The inline CSS should be moved to an external style sheet.
 
Last edited:
Top