Help please!

Status
Not open for further replies.

WarriorH

New Member
Messages
55
Reaction score
0
Points
0
I am very new to web programming, so I decided to start on something easy. Well the problem is, I don't really know how to use <divs> to create a nice styel.css document for my page.

This is my site: http://warriorhall.pcriot.com/

and I don't know how to make $variables a certain font color or even create divs for them.


Here is an example of my problem:

<div id="maxsizelimit">[FONT=tahoma,verdana,geneva,lucida,'lucida grande',arial,helvetica,sans-serif][/FONT]$max = $maxfilesize/1048576;
$max = round($max, 1);
echo
"<br>$max MB Maximum Upload File Size";
</div>

but I get an error saying unexpected '>'.. please help!
 

TechAsh

Retired
Messages
5,853
Reaction score
7
Points
38
The error is because you have HTML tags inside your PHP.
Try this:
PHP:
<?php
$max = $maxfilesize/1048576;
$max = round($max, 1);
echo "<br><div id='maxsizelimit'>$max MB Maximum Upload File Size</div>";
?>
You may want to have a look at using <SPAN class="...">text</SPAN> instead of DIVs.
 
Last edited:

WarriorH

New Member
Messages
55
Reaction score
0
Points
0
I get the same error, I know I am doing something wrong. Will you take a look at the code and fix it for me?

Here it is:

<!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=ISO-8859-1" />
<meta name="description" content="Warrior Hall - Official Warrior Epic Fan Site" />
<meta name="keywords" content="GameShot, Screenshot, Game Shot, Shot, Shots, Upload" />

<link rel="stylesheet" type="text/css" href="http://warriorhall.pcriot.com/style.css" />
<body>
<?php include "header.php";
if (!$mysql['db'])
{
die("Please <a href='install.php'>Install</a> this first!");
}
if($_GET['about'] == 1)
{
}
?>

<body background="http://forums.x10hosting.com/images/bg_m.jpg">
<div class="wrapper">
<div id="hdr-l">
<div id="hdr-r">
<div id="header">
</div>
<div id="navigation">


<span class="right"></span>
<span class="left"></span>


<a href="./index.html"><b>Home</b></a>

<a href="./index.html"><b>Upload</b></a>

<a href="./index.html"><b>Rules</b></a>

<a href="./index.html"><b>Report</b></a>

<a href="./index.html"><b>About us</b></a>

<a href="./index.html"><b>Advertise</b></a>
</div>
</div>
</div>
<div id="bodyarea">
<table width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td width="170" style="padding: 4px; padding-top: 8px;padding-right: 1ex;" valign="top">
<div id="leftbarHeader" style="padding-top: 5px; width: 170px;"><div class="tborder" style="margin-bottom: 2px;">
<div class="titlebg" style="padding: 4px; font-weight: bold;">Content
</div>

<font color="White"><b>Image:</b></font><br>
<form method="post" enctype="multipart/form-data" action="process.php">
<input type="file" name="imagefile" size="27">
<br><br> <font color="White"><b>Comment (optional)</b></font></b>:<br>
<textarea rows="textarea" width="20" cols="20" name="comments"></textarea><br>
<input type="hidden" name="MAX_FILE_SIZE" value="<?php echo $maxfilesize ?>">
<input type="submit" value="Upload" name="upload">
</form>
<br>
<?php
$max = $maxfilesize/1048576;
$max = round($max, 1);
echo "<br>$max MB Maximum Upload File Size";

//Lets try connecting to mySQL
@ $db = mysql_pconnect($mysql['host'], $mysql['user'], $mysql['pass']);
//IT"S NOT WORKING!
if (!$db)
{
die("<br>Please make sure your Database is installed correctly. ");
}
mysql_select_db($mysql['db']);

//get current stats
$query = "SELECT * FROM `stat_cache`";

$result = mysql_query($query);

if (!$result)
{
die("MySQL Select error");
}
$stat = mysql_fetch_array($result);

//Space in MB
$space = $stat['space'] / 1048576;
$space = round($space, 1);
//Band in MB
$band = $stat['band'] / 1048576;
$band = round($band, 1);
$files = $stat['files'];
$downloads = $stat['downloads'];
//echo stats
echo "<br/>Total Files: $files";
echo "<br/>Total Views: $downloads";

//Cool stuff
//Random x images will
//Be displayed here :)
if($randommany)
{
echo "<br/><br/><table width='" . ((($randommany * 150) + (6 * ($randommany +1)))-2) . "' height='170px' border='1'><tr><td align='center' colspan='" . $randommany . "'>Random " . $randommany . " images</td></tr><tr>";
$query = "SELECT * FROM images ORDER BY rand() LIMIT " . $randommany;
$result = mysql_query($query);
for ($i = 0; $i < $randommany; $i++)
{
$rand = mysql_fetch_array($result);
$id = $rand['id'];
echo "<td width='152' align='center'>
<a href='" . $scripturl . "view/" . $id . "'><img src='" . $scripturl . "thumb/" . $id . ".jpeg' border='0'></a></td>";
}
echo "</tr><tr>";
mysql_data_seek($result, 0);
for ($i = 0; $i < $randommany; $i++)
{
$rand = mysql_fetch_array($result);
$id = $rand['id'];
echo "<td width='150' align='center'>
<a href='report.php?id=" . $id . "'><b>Report Image</b></a></td>";
}
echo "</tr></table>";
}


//Last x images will
//Be displayed here :)
if($lastmany)
{
echo "<br/><br/><table width='" . ((($lastmany * 150) + (6 * ($lastmany +1)))-2) . "' height='170px' border='1'><tr><td align='center' colspan='" . $lastmany . "'>Last " . $lastmany . " uploaded images</tr></td><tr>";
$query = "SELECT * FROM images ORDER BY id DESC LIMIT " . $lastmany;
$result = mysql_query($query);
for ($i = 0; $i < $lastmany; $i++)
{
$rand = mysql_fetch_array($result);
$id = $rand['id'];
echo "<td width='152' align='center'>
<a href='" . $scripturl . "view/" . $id . "'><img src='" . $scripturl . "thumb/" . $id . ".jpeg' border='0'></a></td>";
}
echo "</tr><tr>";
mysql_data_seek($result, 0);
for ($i = 0; $i < $lastmany; $i++)
{
$rand = mysql_fetch_array($result);
$id = $rand['id'];
echo "<td width='150' align='center'>
<a href='report.php?id=" . $id . "'><b>Report Image</b></a></td>";
}
echo "</tr></table>";
}
include "footer.php";
?>

</body></html>
 
Last edited:

TechAsh

Retired
Messages
5,853
Reaction score
7
Points
38
Could you post the complete error message you are getting because there are a lot of ">" in that page and it's hard to see which one is causing the error. The error message will say which line is causing the error, which will narrow it down a bit.
 

TechAsh

Retired
Messages
5,853
Reaction score
7
Points
38
Well done! What was the problem?

Your site looks quite good, I think you need a bit more content as there is a lot of empty space. Also this is just my opinion but the header image is creepy, but I'm guessing it's supposed to be creepy.
 

woiwky

New Member
Messages
390
Reaction score
0
Points
0
I never understood why people use double quotes when they concatenate the variables with them instead of putting them inside.

But anyway, as far as I can see, there doesn't seem to be anything wrong with that code. I would suspect the error is originating in header.php or footer.php.
 

TechAsh

Retired
Messages
5,853
Reaction score
7
Points
38
Your a bit late with posting that woiwky. WarriorH solved the problem.
 
Last edited:

woiwky

New Member
Messages
390
Reaction score
0
Points
0
Well I wrote I started writing it about half an hour ago, but I opened several tabs for different topics and forgot about it. Didn't bother to refresh the topic when I finished it up :p
 

cowctcat

New Member
Messages
401
Reaction score
0
Points
0
well its glad to see you all helping each other out
*closing*
 
Status
Not open for further replies.
Top