EagleAmerican Posted July 24, 2007 Share Posted July 24, 2007 Hi again, I thought I had my last question but adding improvments to the site I came across problems. Right now on my view.php file, which retrieves all of the data for that parasite and displays it for the user by the id. I used to have it by name but ran into problems with spaces in names and thought id's are a much better way to go. Here is the error I get when trying to go to that page: Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/www/parasitedb.freehostia.com/view.php on line 66 And here is the view.php file: <html> <head> <title>ParasiteDB - Research and Remove Parasites!</title> <META content="parasite, virus, malware, removal, computer, pc, database, pdb, db" name=keywords> <META content="You can research and find ways to remove hundreds of different parasites here. Come take a look!" name=description> <style TYPE="text/css"> A{text-decoration:none} A:hover{color:#FFFFFF;text-decoration:underline} } BODY { SCROLLBAR-FACE-COLOR: #000000; SCROLLBAR-HIGHLIGHT-COLOR: #000000; SCROLLBAR-SHADOW-COLOR: #0099CC; SCROLLBAR-3DLIGHT-COLOR: #0099CC; SCROLLBAR-ARROW-COLOR: #0099CC; SCROLLBAR-TRACK-COLOR: #000000; SCROLLBAR-DARKSHADOW-COLOR: #0000000; } </style> </head> <BODY BGCOLOR="#000000" TEXT="#FFFFFF" VLINK="#0099CC" ALINK="#0099CC" LINK="#0099CC" topmargin="0"> <table border="0" cellspacing="1" width="100%"> <tr> <td width="100%" background="logo.jpg"> <table border="0" cellpadding="0" cellspacing="0" width="100%" bordercolor="#FFFFFF"> <tr> <td width="100%" background="images/logo.jpg" height="80"> <p align="center"><font color="#FFFFFF" size="4" face="Arial"><b>ParasiteDB - Research and Remove Parasites!</b></font></td> </tr> </table> </td> </tr> <tr> <td width="100%"> <table border="1" cellpadding="5" cellspacing="5" width="100%" bordercolor="#FFFFFF"> <tr> <td width="20%" valign="top"> <font face="Arial" size="2"><b> Navigation</b></font><br> <font face="Arial" size="2"> - <a href="index.php">Home</a><br> - <a href="mailto:[email protected]?subject=Contact Us">Contact Us</a><br> - <a href="mailto:[email protected]?subject=Advertise">Advertise</a><br> - <a href="search.php">Search</a><br> - <a href="staff/index.php">Staff Login</a></font> <font face="Arial" size="1"> <p> </font><font face="Arial" size="2"> <font face="Arial" size="2">Google Ads Coming Soon!</font></a><font face="Arial" size="1"> <p> <font face="Arial" size="2"><b> Sponsors</b></font><br> </font><font face="Arial" size="2">- <a href="http://malwareremoval.com/">Malware Removal</a><br> - <a href="http://pchelpforum.com/">PC Help Forum</a><br> </font></td> <td width="80%" valign="top"><b><font face="Arial"><font size="2" color="#FFFFFF"><center><br> <?php $dbcnx = @mysql_connect('', 'adaarm_db', ''); if (!$dbcnx) { exit('<p>Unable to connect to the ' . 'database server at this time.</p>'); } $query = "select * from parasite WHERE id='$_GET['id']'"; $result = mysql_db_query("adaarm_db", $query); echo "Search Results:<br><br>"; echo "<table width=90% align=center border=1><tr> <td align=center>Name</td> <td align=center>From</td> <td align=center>Genre</td> <td align=center>Technical Info</td> <td align=center>Genre</td> <td align=center>Genre</td> </tr>"; while ($r = mysql_fetch_array($result)) { // Begin while $name = $r["parasitename"]; $from = $r["parasitefrom"]; $genre = $r["parasitegenre"]; $description = $r["parasitedescription"]; $techinfo = $r["parasitetechinfo"]; $removal = $r["parasiteremoval"]; echo "<h2>Info for: $name</h2><br><br><br>From: $from<br><br>Genre: $genre<br><br>Description: $description<br><br>Technical Info: $techinfo<br><br>Removal Instructions: $removal<br><br>"; } // end while ?> </center> </div> <p> </td> </tr> </table> </td> </tr> <tr> <td width="100%"> <p align="center"><font size="2"><font face="Arial">All Site Content © 2007 - ParasiteDB<br>All Rights Reserved</font></td> </tr> </table> </BODY> </html> Thanks in advance, Adam Link to comment https://forums.phpfreaks.com/topic/61478-solved-parse-error/ Share on other sites More sharing options...
JayBachatero Posted July 24, 2007 Share Posted July 24, 2007 Change $query = "select * from parasite WHERE id='$_GET['id']'"; to $_GET['id'] = (int) $_GET['id']; $query = "select * from parasite WHERE id='$_GET[id]'"; Change $_GET['id'] to $_GET[id]. Added the $_GET['id'] = (int) $_GET['id']; to make sure its an integer. Link to comment https://forums.phpfreaks.com/topic/61478-solved-parse-error/#findComment-306005 Share on other sites More sharing options...
maxudaskin Posted July 24, 2007 Share Posted July 24, 2007 $query = "select * from parasite WHERE id='$_GET['id']'"; Should Be $query = "select * from parasite WHERE id='{$_GET['id']}'"; or $query = "select * from parasite WHERE id=" . $_GET['id']; Link to comment https://forums.phpfreaks.com/topic/61478-solved-parse-error/#findComment-306006 Share on other sites More sharing options...
EagleAmerican Posted July 24, 2007 Author Share Posted July 24, 2007 Thanks works now! Link to comment https://forums.phpfreaks.com/topic/61478-solved-parse-error/#findComment-306009 Share on other sites More sharing options...
maxudaskin Posted July 24, 2007 Share Posted July 24, 2007 Thanks works now! Was it me or the other gentleman/gentlewoman? Link to comment https://forums.phpfreaks.com/topic/61478-solved-parse-error/#findComment-306016 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.