...

View Full Version : PHP page won't render in Firefox 3.5, IE8, Chrome etc.



taylortsantles
11-03-2010, 12:00 AM
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:


<!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!

Keleth
11-03-2010, 12:19 AM
The error I got back:


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

Check your files.

disastro
11-03-2010, 12:34 AM
Keleth is in the right area.

The problem seems to be here:


<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:


<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.

Fou-Lu
11-03-2010, 12:37 AM
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.

DrDOS
11-03-2010, 12:44 AM
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.
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.

taylortsantles
11-03-2010, 02:17 AM
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



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum