Howdy folks!
I've been getting better at PHP for my own usage and am having a lot of fun with it. However, as of last night I have stumbled across a problem that I cannot seem to remedy.
I have created an admin page that lets me enter new info for various pages of my bands website and everything works great. I have the main site calling the results and they format as expected. Well, last night I decided to build my own PHP guestbook based on the layout of the CGI guestbook provided with my hosting. I duplicated my PHP file for another page on the site that was working fine (reviews.php) and named it guestbook.php. When I uploaded the file, I should have seen an exact duplicate of the reviews.php, but instead, I got the error below:
Parse error: parse error, unexpected '}' in /hsphere/local/home/agfagf/agruesomefind.com/php/guestbook.php on line 70
I refreshed the reviews.php and it seemed to work fine....Then, I added a simple <hr width="640"> to the bottom of the reviews.php (formatting for look and feel) and reuploaded the reviews.php. Now, I get the same error for the reviews.php without having changed ANY of the php code.
Why would something work one minute and not the next with absolutely NO change?
Here is the code for reviews.php:
PHP Code:
php
mysql_connect ("****", "****", "****");
___
mysql_select_db (*********);
$result = mysql_query ("SELECT * FROM agf_reviews ORDER BY title
_________________________
_________________________");
if ($row = mysql_fetch_array($result)) {
do {
___print '<table border="0" cellspacing="5" cellpadding="0" style="color: #fff;">';
echo "<tr>\n";
________________echo "<td><b><font color='yellow'>{$row ["title"]}</font></b></td>\n";
________________echo "</tr>\n";
echo "<tr>\n";
________________echo "<td><i>{$row ["reviewer"]}</i> </td>\n";
________________echo "</tr>\n";
echo "<tr>\n";
echo "<td><a href='http://{$row ["website"]}'target='_blank'>{$row ["name"]}</a> </td>\n";
echo "</tr>\n";
echo "<tr>\n";
________________echo "<td>{$row ["review_text"]} </td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo ("<br>");
} while($row = mysql_fetch_array($result));
print "</table>";
print "-------------------------------------------------------------"
} else {
print "Nothing has been entered yet";
}
Any help would be greatly appreciated!!! Thanks!
RyanHi,
there's a semicolon missing. Change
print "-------------------------------------------------------------"
to
print "-------------------------------------------------------------" ;
ThomasThanks!
I've been getting better at PHP for my own usage and am having a lot of fun with it. However, as of last night I have stumbled across a problem that I cannot seem to remedy.
I have created an admin page that lets me enter new info for various pages of my bands website and everything works great. I have the main site calling the results and they format as expected. Well, last night I decided to build my own PHP guestbook based on the layout of the CGI guestbook provided with my hosting. I duplicated my PHP file for another page on the site that was working fine (reviews.php) and named it guestbook.php. When I uploaded the file, I should have seen an exact duplicate of the reviews.php, but instead, I got the error below:
Parse error: parse error, unexpected '}' in /hsphere/local/home/agfagf/agruesomefind.com/php/guestbook.php on line 70
I refreshed the reviews.php and it seemed to work fine....Then, I added a simple <hr width="640"> to the bottom of the reviews.php (formatting for look and feel) and reuploaded the reviews.php. Now, I get the same error for the reviews.php without having changed ANY of the php code.
Why would something work one minute and not the next with absolutely NO change?
Here is the code for reviews.php:
PHP Code:
php
mysql_connect ("****", "****", "****");
___
mysql_select_db (*********);
$result = mysql_query ("SELECT * FROM agf_reviews ORDER BY title
_________________________
_________________________");
if ($row = mysql_fetch_array($result)) {
do {
___print '<table border="0" cellspacing="5" cellpadding="0" style="color: #fff;">';
echo "<tr>\n";
________________echo "<td><b><font color='yellow'>{$row ["title"]}</font></b></td>\n";
________________echo "</tr>\n";
echo "<tr>\n";
________________echo "<td><i>{$row ["reviewer"]}</i> </td>\n";
________________echo "</tr>\n";
echo "<tr>\n";
echo "<td><a href='http://{$row ["website"]}'target='_blank'>{$row ["name"]}</a> </td>\n";
echo "</tr>\n";
echo "<tr>\n";
________________echo "<td>{$row ["review_text"]} </td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo ("<br>");
} while($row = mysql_fetch_array($result));
print "</table>";
print "-------------------------------------------------------------"
} else {
print "Nothing has been entered yet";
}
Any help would be greatly appreciated!!! Thanks!
RyanHi,
there's a semicolon missing. Change
print "-------------------------------------------------------------"
to
print "-------------------------------------------------------------" ;
ThomasThanks!