Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
What have i coded wrong?
Old 05-20-2005, 06:35 PM What have i coded wrong?
scottsgameroom's Avatar
Super Talker

Posts: 101
Trades: 0
I have coded the following page to utilist my database but i get the following error:


Parse error: parse error, unexpected T_STRING, expecting ',' or ';' in /freeola/users/8/2/sr0173228/htdocs/testingground/top.php on line 34

here is my code

PHP Code:
<html>
<head>
<title>Scotts Game Room Portal</title>
<style><!--a:hover{color:yellow; text-decoration:none; }--></style>
<style>a{text-decoration:none}    </style>
</head>
<body bgcolor=white text=cccccc topmargin=0 leftmargin=0 link=458DE5 alink=458DE5 vlink=458DE5>
<center>
<?php
include 'db_connect.php';

$sql "SELECT * FROM headerinfo";

$result mysql_query($sql);
$results mysql_fetch_array($result);

$spotlightimage $results["spotlightimage"];
$spotlighttext $results["spotlighttext"];
$spotlightlink $results["spotlightlink"];
$newsimage $results["newsimage"];
$newstext $results["newstext"];
$newslink $results["newslink"];
$reviewsimage $results["reviewsimage"];
$reviewstext $results["reviewstext"];
$reviewslink $results["reviewslink"];
$previewsimage $results["previewsimage"];
$previewstext $results["previewstext"];
$previewslink $results["previewslink"];

echo 
"

<br>
<table width=97% cellspacing=0 cellpadding=0 border=0 bordercolor=black>
    <tr><td bgcolor=458DE5 width=25% style="
border1px solid #000000"><font face=arial size=1 color=white>&nbsp;Spotlight</td>
    
<td bgcolor=458DE5 width=25style="border: 1px solid #000000"><font face=arial size=1 color=white>&nbsp;News</td>
    <
td bgcolor=458DE5 width=25style="border: 1px solid #000000"><font face=arial size=1 color=white>&nbsp;Reviews</td>
    <
td bgcolor=458DE5 width=25style="border: 1px solid #000000"><font face=arial size=1 color=white>&nbsp;Previews</td></tr>
    <
tr><td bgcolor=cccccc width=25style="border: 1px solid #000000"><center><img src="$spotlightimage"></td>
    <
td bgcolor=cccccc width=25style="border: 1px solid #000000"><center><img src="$newsimage"></td>
    <
td bgcolor=cccccc width=25style="border: 1px solid #000000"><center><img src="$reviewsimage"></td>
    <
td bgcolor=cccccc width=25style="border: 1px solid #000000"><center><img src="$previewsimage"></td></tr>
    <
tr><td bgcolor=041A6E width=25style="border: 1px solid #000000"><font face=arial size=1>$spotlighttext
    
<br><a href="$spotlightlinktarget="main">Click here for more</a></td>
    <
td bgcolor=041A6E width=25style="border: 1px solid #000000"><font face=arial size=1>$newstext
    
<br><a href="$newslinktarget="main">Click here for more</a></td>
    <
td bgcolor=041A6E width=25style="border: 1px solid #000000"><font face=arial size=1>$reviewstext
    
<br><a href="$reviewslinktarget="main">Click here for more</a></td>
    <
td bgcolor=041A6E width=25style="border: 1px solid #000000"><font face=arial size=1>$previewstext
    
<br><a href="$previewslinktarget="main">Click here for more</a></td></tr>
</
table>

";

?>
Hope you can help!
scottsgameroom is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 05-20-2005, 06:38 PM
mikeroq's Avatar
Skilled Talker

Posts: 92
Name: Mike Roq
Location: Lakewood, CO
Trades: 1
Code:
<tr><td bgcolor=458DE5 width=25% style="border: 1px solid #000000"><font face=arial size=1 color=white>&nbsp;Spotlight</td>
change the "s to 's

cause your echo is using echo ", if it was echo ' it would work,
example
Code:
<?php
echo "<table widht"800">";
?>
wouldnt work
so it has to be
Code:
<?php
echo "<table width='800'>";
?>
__________________
CodingHub.com
mikeroquemore.com
mikeroq is offline
Reply With Quote
View Public Profile Visit mikeroq's homepage!
 
Old 05-20-2005, 06:43 PM
mikeroq's Avatar
Skilled Talker

Posts: 92
Name: Mike Roq
Location: Lakewood, CO
Trades: 1
in fact just use this cause you did it everywhere
PHP Code:
<html>
<head>
<title>Scotts Game Room Portal</title>
<style><!--a:hover{color:yellow; text-decoration:none; }--></style>
<style>a{text-decoration:none}    </style>
</head>
<body bgcolor=white text=cccccc topmargin=0 leftmargin=0 link=458DE5 alink=458DE5 vlink=458DE5>
<center>
<?php
include 'db_connect.php';

$sql "SELECT * FROM headerinfo";

$result mysql_query($sql);
$results mysql_fetch_array($result);

$spotlightimage $results["spotlightimage"];
$spotlighttext $results["spotlighttext"];
$spotlightlink $results["spotlightlink"];
$newsimage $results["newsimage"];
$newstext $results["newstext"];
$newslink $results["newslink"];
$reviewsimage $results["reviewsimage"];
$reviewstext $results["reviewstext"];
$reviewslink $results["reviewslink"];
$previewsimage $results["previewsimage"];
$previewstext $results["previewstext"];
$previewslink $results["previewslink"];

echo 
'

<br>
<table width=97% cellspacing=0 cellpadding=0 border=0 bordercolor=black>
    <tr><td bgcolor=458DE5 width=25% style="border: 1px solid #000000"><font face=arial size=1 color=white>&nbsp;Spotlight</td>
    <td bgcolor=458DE5 width=25% style="border: 1px solid #000000"><font face=arial size=1 color=white>&nbsp;News</td>
    <td bgcolor=458DE5 width=25% style="border: 1px solid #000000"><font face=arial size=1 color=white>&nbsp;Reviews</td>
    <td bgcolor=458DE5 width=25% style="border: 1px solid #000000"><font face=arial size=1 color=white>&nbsp;Previews</td></tr>
    <tr><td bgcolor=cccccc width=25% style="border: 1px solid #000000"><center><img src="$spotlightimage"></td>
    <td bgcolor=cccccc width=25% style="border: 1px solid #000000"><center><img src="$newsimage"></td>
    <td bgcolor=cccccc width=25% style="border: 1px solid #000000"><center><img src="$reviewsimage"></td>
    <td bgcolor=cccccc width=25% style="border: 1px solid #000000"><center><img src="$previewsimage"></td></tr>
    <tr><td bgcolor=041A6E width=25% style="border: 1px solid #000000"><font face=arial size=1>$spotlighttext
    <br><a href="$spotlightlink" target="main">Click here for more</a></td>
    <td bgcolor=041A6E width=25% style="border: 1px solid #000000"><font face=arial size=1>$newstext
    <br><a href="$newslink" target="main">Click here for more</a></td>
    <td bgcolor=041A6E width=25% style="border: 1px solid #000000"><font face=arial size=1>$reviewstext
    <br><a href="$reviewslink" target="main">Click here for more</a></td>
    <td bgcolor=041A6E width=25% style="border: 1px solid #000000"><font face=arial size=1>$previewstext
    <br><a href="$previewslink" target="main">Click here for more</a></td></tr>
</table>

'
;

?> <html>
<head>
<title>Scotts Game Room Portal</title>
<style><!--a:hover{color:yellow; text-decoration:none; }--></style>
<style>a{text-decoration:none}    </style>
</head>
<body bgcolor=white text=cccccc topmargin=0 leftmargin=0 link=458DE5 alink=458DE5 vlink=458DE5>
<center>
<?php
include 'db_connect.php';

$sql "SELECT * FROM headerinfo";

$result mysql_query($sql);
$results mysql_fetch_array($result);

$spotlightimage $results["spotlightimage"];
$spotlighttext $results["spotlighttext"];
$spotlightlink $results["spotlightlink"];
$newsimage $results["newsimage"];
$newstext $results["newstext"];
$newslink $results["newslink"];
$reviewsimage $results["reviewsimage"];
$reviewstext $results["reviewstext"];
$reviewslink $results["reviewslink"];
$previewsimage $results["previewsimage"];
$previewstext $results["previewstext"];
$previewslink $results["previewslink"];

echo 
'

<br>
<table width=97% cellspacing=0 cellpadding=0 border=0 bordercolor=black>
    <tr><td bgcolor=458DE5 width=25% style="border: 1px solid #000000"><font face=arial size=1 color=white>&nbsp;Spotlight</td>
    <td bgcolor=458DE5 width=25% style="border: 1px solid #000000"><font face=arial size=1 color=white>&nbsp;News</td>
    <td bgcolor=458DE5 width=25% style="border: 1px solid #000000"><font face=arial size=1 color=white>&nbsp;Reviews</td>
    <td bgcolor=458DE5 width=25% style="border: 1px solid #000000"><font face=arial size=1 color=white>&nbsp;Previews</td></tr>
    <tr><td bgcolor=cccccc width=25% style="border: 1px solid #000000"><center><img src="$spotlightimage"></td>
    <td bgcolor=cccccc width=25% style="border: 1px solid #000000"><center><img src="$newsimage"></td>
    <td bgcolor=cccccc width=25% style="border: 1px solid #000000"><center><img src="$reviewsimage"></td>
    <td bgcolor=cccccc width=25% style="border: 1px solid #000000"><center><img src="$previewsimage"></td></tr>
    <tr><td bgcolor=041A6E width=25% style="border: 1px solid #000000"><font face=arial size=1>$spotlighttext
    <br><a href="$spotlightlink" target="main">Click here for more</a></td>
    <td bgcolor=041A6E width=25% style="border: 1px solid #000000"><font face=arial size=1>$newstext
    <br><a href="$newslink" target="main">Click here for more</a></td>
    <td bgcolor=041A6E width=25% style="border: 1px solid #000000"><font face=arial size=1>$reviewstext
    <br><a href="$reviewslink" target="main">Click here for more</a></td>
    <td bgcolor=041A6E width=25% style="border: 1px solid #000000"><font face=arial size=1>$previewstext
    <br><a href="$previewslink" target="main">Click here for more</a></td></tr>
</table>

'
;

?> <?php /* Created on: 5/20/2005 */ ?>
<html>
<body>
<?php

?>
</body>
</html>
__________________
CodingHub.com
mikeroquemore.com
mikeroq is offline
Reply With Quote
View Public Profile Visit mikeroq's homepage!
 
Old 05-20-2005, 06:44 PM
scottsgameroom's Avatar
Super Talker

Posts: 101
Trades: 0
Thank you so so so so much ive been trying to get this to work for ages...ive finally got round to working on the script and it was that easy!

Cheers rookie mistake! lol
scottsgameroom is offline
Reply With Quote
View Public Profile
 
Old 05-21-2005, 04:01 AM
mtishetsky's Avatar
King Spam Talker

Posts: 1,226
Name: Mike
Location: Mataro, Spain
Trades: 0
Why do you use echo to output HTML? You can do it like this:
PHP Code:
<html>
<body>
<?
$somevar 
define_some_var();
?>
<table>
   <tr>
      <td><?= $somevar?></td>
   </tr>
</table>
</body>
</html>
__________________

Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE

And don't forget to give me talkupation!
mtishetsky is offline
Reply With Quote
View Public Profile Visit mtishetsky's homepage!
 
Old 05-21-2005, 05:18 AM
scottsgameroom's Avatar
Super Talker

Posts: 101
Trades: 0
Thats a good point...i just use echo because thats the way i taught myself!
scottsgameroom is offline
Reply With Quote
View Public Profile
 
Old 05-21-2005, 05:53 AM
leavethisplace's Avatar
Ultra Talker

Posts: 297
Trades: 0
I always use echo, and i have no idea why, nothin wrong with it is there?
__________________
A lie gets halfway around the world before the truth has a chance to get its pants on. - Sir Winston Churchill

Please visit my sites:
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
leavethisplace is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to What have i coded wrong?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.89696 seconds with 12 queries