Code works on Wamp but doesnt on my host
Posted by: projects (---.nott.cable.ntl.com)
Date: June 29, 2008 04:16AM

Hi there, im getting stressed with this so hopefully someone here can shed some light on this..

Ive coded all of this on wamp and works perfect!

I go to upload to my host on ultrawebsitehosting and it doesnt output any of the data.. e.g. when i login on wamp it says welcome Admin!. but on my host it just says Welcome !

heres an example!

<?php
session_start();
include("fckeditor/fckeditor.php"winking smiley;
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "[www.w3.org];
<html xmlns="[www.w3.org];
<head>
<script type="text/javascript" src="js/prototype.js"></script>
<script type="text/javascript" src="js/scriptaculous.js?load=effects"></script>
<script type="text/javascript" src="js/lightbox.js"></script>
<script>
function confirmDelete(delUrl) {
if (confirm("Are you sure you want to delete"winking smiley) {
document.location = delUrl;
}
}
</script>

<link rel="stylesheet" href="css/lightbox.css" type="text/css" media="screen" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="style.css">
<title><?php echo "$SiteName"; ?></title>
</head>

<body>
<div class="header"><div class="nav">
<?php
if ($_SESSION['username'] == true ) {
echo "welcome $username! <a class=white href=?view=logout>Logout</a>";
} elseif ($_SESSION['username'] == false )
{
echo "Not logged in. <a class=white href=?view=login>Login</a>";
}
?></div></div>
<div class="navigation"><a class="white" href="?view=home"><img border="0" src="images/home.jpg" /></a> <a class="white" href="?view=projects"><img border="0" src="images/projects.jpg" /></a> <a class="white" href="?view=profile"><img border="0" src="images/profile.jpg" /></a></div>
<div class="content">
<div class="image">
<?php

include ("includes/database.php"winking smiley;

$query = "SELECT * FROM images WHERE id = $_GET[id]";
$result = mysql_query($query);

while($row = @mysql_fetch_array($result, MYSQL_ASSOC))
{
echo "<fieldset>{$row['title']}<br /><a href=images/{$row['image']} rel=lightbox title='{$row['title']}'><img border=0 width=300 height=300 src=images/{$row['image']} /></a><br /> <span class=date>(Click image to view full size)</span></fieldset>";
}
?>
</div>
<div class="ViewComments"> <span class="pink"><img src="images/comments.jpg" /></span><br />
<table width="100%" border="1">
<?php
include ("includes/database.php"winking smiley;

$query = "SELECT * FROM users WHERE username = '$username'";
$result = mysql_query($query);

while ($row = @mysql_fetch_array($result, MYSQL_ASSOC))
{
$username = "{$row['username']}";
$level = "{$row['level']}";
}



$query = "SELECT * FROM comments WHERE imageid = $_GET[id]";
$result = mysql_query($query);


while($row = @mysql_fetch_array($result, MYSQL_ASSOC))
{
echo "<tr><td width=20%><span class=user> - {$row['username']}</span></td><td width=80%><span class=date><b>Posted:</b>{$row['date']}</span><br /><div class=message>{$row['message']}</div><br /><br />";
if ($level == 1 ) {
echo "<div class=edit><a class=edit href=?view=edit&id={$row['id']}>Edit Comment</a> - <a class=edit href=href='javascript:confirmDelete('?view=delete&id={$row['id']}')'>Delete Comment</a></div>";
} elseif ($level == 2)
{ echo "";
}
echo "</td></tr>";
}
?>
</table>


<br />


</div>
<div class="AddComment"><span class="pink"><img src="images/addcomment.jpg" /></span><br />
<?php
include ("includes/database.php"winking smiley;

$date = date("l j F Y H:ia"winking smiley;
$imageid = $_GET['id'];
$username = $_SESSION['username'];


if(isset($_POST["add_comment"])){

$query = "INSERT INTO comments (`message`, `date`, `imageid`, `username`) VALUES ('".$_POST["message"]."', '$date', '$imageid', '$username')";
$result = @mysql_query ($query);
{
printf("Comment Added! <a href=?view=image&id=$id><b>Update?</b></a>"winking smiley;
}

}




?>
<fieldset><form method="post">
<?php
$oFCKeditor = new FCKeditor('message');
$oFCKeditor->BasePath = 'fckeditor/';
$oFCKeditor->Value = "";
$oFCKeditor->Create();
?>
<p><input type="submit" name="add_comment" value="Add Comment" /></p>
<input type="hidden" name="submitted" value="TRUE" />
</form>
</fieldset>
</div>
</div>
<div class="footer">Projects Admin Panel. Version 1. Created by Craig Turner.</div>
</body>
</html>

Options: ReplyQuote
Re: Code works on Wamp but doesnt on my host
Posted by: Jamesking55 (---.range86-139.btcentralplus.com)
Date: June 29, 2008 03:11PM

Your host must have different PHP settings to your WAMP Server, They probably have Safe_mode as on, you probably have it as off.

Check with your webhost.

Options: ReplyQuote


Sorry, only registered users may post in this forum.