Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New Coder
    Join Date
    Jul 2008
    Posts
    50
    Thanks
    8
    Thanked 0 Times in 0 Posts

    PHP page won't render in Firefox 3.5, IE8, Chrome etc.

    I'm super frustrated, because I've worked hard on coding this php page and it displays perfectly in Safari, but won't even render in Chrome, Firefox 3.5, or IE8. I have never had this issue before and I'm totally stumped. The page content just isn't there. It even shows as completely valid on the W3C website. I've also run the PHP script in Safari and the page works beautifully. That's why I'm really confused. The page I'm referring to is located here: http://my.steadfa.st. Here is the code:

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>                 
    	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    	<title>Upload a file | my.steadfa.st</title>
    	<link rel="stylesheet" type="text/css" href="styles.css"/>   
    	<script src="scripts/jquery-1.4.3.min.js" type="text/javascript"/> 
    	<script src="scripts/input-text.js" type="text/javascript"/>  
    	<script src="scripts/submit-button.js" type="text/javascript"/>  		
    </head>
    <body>	   
    	<!-- Header -->
    	<div id="header">
    		<a href="../"><img src="images/header.png" width="680" height="320" alt="Steadfast Designs"/></a>
    	</div>
    	<!-- Content -->    
    	<div id="content">	
    		<h1>Upload a file | my.steadfa.st</h1>
    		<p><b>Quickly upload files to the Steadfast Designs team!</b></p>  
    		<p>Just enter the password provided to you by the Steadfast Designs team, choose the file from your computer, and click "Upload". It's that simple!</p> 
    		<!-- Upload Form -->
    	   	<div id="upload-form">
    	 			<?php
    			if ($_POST) {
    			require 'DropboxUploader.php';
    
    			try {
    			   // Rename uploaded file to reflect original name
    			   if ($_FILES['file']['error'] !== UPLOAD_ERR_OK)
    			       throw new Exception('File was not successfully uploaded from your computer.');
    
    			   $tmpDir = uniqid('/tmp/DropboxUploader-');
    			   if (!mkdir($tmpDir))
    			       throw new Exception('Cannot create temporary directory!');
    
    			   if ($_FILES['file']['name'] === "")
    			       throw new Exception('File name not supplied by the browser.');
    
    			   $tmpFile = $tmpDir.'/'.str_replace("/\0", '_', $_FILES['file']['name']);
    			   if (!move_uploaded_file($_FILES['file']['tmp_name'], $tmpFile))
    			       throw new Exception('Cannot rename uploaded file!');
    
    			   // Upload
    			   $uploader = new DropboxUploader('my.steadfa.st@gmail.com', $_POST['password']);
    			   $uploader->upload($tmpFile, 'my.steadfa.st');
    
    			   echo '<span class="success"><b>Thank you!</b> Your file was successfully uploaded.</span>';
    			} catch(Exception $e) {
    			   echo '<span class="error"><b>Error:</b> ' . htmlspecialchars($e->getMessage()) . '</span>';
    			}
    
    			// Clean up
    			if (isset($tmpFile) && file_exists($tmpFile))
    			   unlink($tmpFile);
    
    			if (isset($tmpDir) && file_exists($tmpDir))
    			   rmdir($tmpDir);
    			}
    			?>
    			   	<form method="post" enctype="multipart/form-data" action="/">
    					<dl>
    				   		<dd>    
    							<input id="password-clear" type="text" value="Enter Password Here" class="password"/>
    					    	<input id="password-password" type="password" name="password" class="password"/>
    						</dd>
    				       	<dd><input type="file" name="file" class="file"/></dd>
    				       	<dd><input id="submit-button" type="submit" value="Upload" class="button"/></dd>   
    					   	<dd><span id="post-back" style="display: none;"><img src="images/loader.gif" alt="Uploading your file. Please wait..." class="loader"/> Uploading your file. Please wait.</span></dd>
    				   	</dl>   
    				</form>
    		</div>
    	</div>    
    </body>
    </html>
    Any help is greatly appreciated!

  • #2
    Senior Coder
    Join Date
    Jun 2008
    Location
    New Jersey
    Posts
    2,530
    Thanks
    45
    Thanked 259 Times in 256 Posts
    The error I got back:

    Code:
    Failed to load source for: http://my.steadfa.st/scripts/jquery-1.4.3.min.js
    Check your files.

  • #3
    Regular Coder
    Join Date
    Jul 2010
    Posts
    185
    Thanks
    3
    Thanked 42 Times in 42 Posts
    Keleth is in the right area.

    The problem seems to be here:
    Code:
    	<script src="scripts/jquery-1.4.3.min.js" type="text/javascript"/> 
    	<script src="scripts/input-text.js" type="text/javascript"/>  
    	<script src="scripts/submit-button.js" type="text/javascript"/>
    script tags require a closing tag. I.E:
    Code:
    	<script src="scripts/jquery-1.4.3.min.js" type="text/javascript"></script> 
    	<script src="scripts/input-text.js" type="text/javascript"></script>
    	<script src="scripts/submit-button.js" type="text/javascript"></script>
    Safari must be more tolerant of this than Firefox etc for some reason.

  • #4
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,978
    Thanks
    4
    Thanked 2,659 Times in 2,628 Posts
    Intermittent display problems are rarely due to PHP if the data has remained consistent. This would then be a problem with the client side instead.
    Moving from PHP forum to... HTML/CSS from the looks of it.
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 

  • #5
    Senior Coder
    Join Date
    Sep 2010
    Posts
    1,899
    Thanks
    15
    Thanked 226 Times in 226 Posts
    I think I see your problem. Keleth is very close to getting it. The external files aren't loading because the tags for them are not closed properly.
    Code:
    Instead of using /> to close the tags try the old way with
     a </script> and </style> closing. Firefox doesn't highlight
     the page source in the
     normal way after the first couple of  external links.
    Last edited by DrDOS; 11-02-2010 at 11:49 PM.

  • Users who have thanked DrDOS for this post:

    taylortsantles (11-03-2010)

  • #6
    New Coder
    Join Date
    Jul 2008
    Posts
    50
    Thanks
    8
    Thanked 0 Times in 0 Posts
    Thanks guys! This worked perfect! I really appreciate the help. Sorry about posting in the wrong section. I thought it was related to a PHP issue in my page. Thanks!

    Taylor


  •  

    Tags for this Thread

    Posting Permissions

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