SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    Non-Member
    Join Date
    Apr 2007
    Posts
    224
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How Do I make a php page match my web site?

    I have an upload script (posted below) that is a php file.

    I want to make it resemble my web page. When I add the <html> (located at the bottom of the page) to the top of the page, so I can start modifying the page to look like my web site, I get a

    Parse error: syntax error, unexpected '<' on whatever line I locate the <html>. Can you help me with this? I know some html some php. Thanks.

    Code:
    <?php
    /**
    *   @file: upload.php
    *   @description:	protected content page example
    */
    	session_start();
    	include_once "db_config.php";
    	include_once "classes/system.php";
    	include_once "classes/account.php";
    	include_once "classes/account_type.php";
    	include_once "classes/tools.php";
    	
    	$account = new account($system);
    	$acount_type = new account_type($system);
    	$account_type_id = $account->get_account_type_id();
    	$account_type_title = $acount_type->get_account_type_title($account_type_id);
    	
    	if ($account->check_login() == false) {
    		// redirect to index page if user not loged in
    		header("Location:index.php");	
    	}	
    ?>
    <?
    	include("uploader.php");
    ?>
    		<p><strong><span style="background: #fff; color: #000"><? if($_REQUEST["message"] == "") echo "1. Select(Click) the Browse button.<br>2. Choose Your File For Uploading<br>3. Select(Click) the Upload File button<br>"; else echo $_REQUEST["message"]?></span></strong></p>
    		<form action="upload.php" enctype="multipart/form-data" id="upload" method="post">
    			<p><input id="userfile" name="userfile" size="45" type="file" /><br><br><input name="upload" type="submit" value="Upload File" /><br /></p>
    
    			<p>Allowed file extensions: <strong><?=$file_extensions_list?></strong></p>
    
    			<p>Maximum file size: <strong><?=$maximum_file_size?> bytes (~<?=round($maximum_file_size/1024)?>KB)</strong></p>
    
    			<p>Deleting files is currently: <strong><?=$status?></strong></p>
    					</form>
    
    		<p><strong>Uploaded Files</strong></p>
    		<table style="border: 2px dotted #000; width: 100%">
    	<? if($uploaded_files == "") echo "		<tr>
    				<td colspan=\"2\" style=\"background: #fff; color: #000; text-align: center\"><br /><strong>There are no uploaded files.</strong><br /><br /></td>
    			</tr>
    	"; else echo $uploaded_files ?>
    	</table>
    <html>
    <body>
    <br><br><table align="center"><?php  ECHO $account->get_user_name(); ?><br><br>
    	<tr><td align="center"><b>User page</b></td></tr>
    	<tr><td align="center">membership type: <b> <?=$account_type_title ?></b> </td></tr>
    	<tr><td align="center">content page.</td></tr>
    </body>
    </html>

  2. #2
    SitePoint Wizard silver trophy kyberfabrikken's Avatar
    Join Date
    Jun 2004
    Location
    Copenhagen, Denmark
    Posts
    6,157
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Don't put it inside the <?php ... ?> block.

  3. #3
    Non-Member
    Join Date
    Apr 2007
    Posts
    224
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Thank you

    When I put it outside the <?php ... ?> block, and add some header code I get this:

    Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/public_html/upload.php:16) in /home/public_html/upload.php on line 22

    Can you tell me what this may mean? And how I can remedy it?


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •