b00paul Posted June 24, 2006 Share Posted June 24, 2006 Hi, for some reason this  appears on my page.Everything loads correctly, but can't figure out why this occurs.Im sure the answer to this is around somewhere, but it's very hard to search for this, if you google it, it kinda ignores it. And nothing showed up here when I searched for Here is the code[code]<table border="1" width="100%"> <tr><th>Story Name</th><th>Description</th><th>Author</th><th>Last Update</th></tr><?include("dbinfo.inc.php");$storytype=$_GET['storytype'];mysql_connect(localhost,$username,$password);@mysql_select_db($database) or die( "Unable to select database");$query="SELECT name,describ,author,dateposted FROM stories WHERE storytype='$storytype'";$result=mysql_query($query);$num=mysql_numrows($result);mysql_close();$i=0;while ($i < $num) {$name=mysql_result($result,$i,"name");$describ=mysql_result($result,$i,"describ");$author=mysql_result($result,$i,"author");$dateposted=mysql_result($result,$i,"dateposted");$date=date("m/d/Y");?><tr><td><? echo $name; ?></td><td><? echo $describ; ?></td><td><? echo $author; ?></td><td><? echo $date; ?></td></tr><?$i++;}echo "</table>";?>[/code] Quote Link to comment https://forums.phpfreaks.com/topic/12829-odd-thing-when-viewing-page/ Share on other sites More sharing options...
AndyB Posted June 24, 2006 Share Posted June 24, 2006 If it shows up, then it's really in your code - probably as control characters. Look at the generated html code to give you a clue to where the weird stuff actually exists in the source. Quote Link to comment https://forums.phpfreaks.com/topic/12829-odd-thing-when-viewing-page/#findComment-49199 Share on other sites More sharing options...
b00paul Posted June 24, 2006 Author Share Posted June 24, 2006 [!--quoteo(post=387588:date=Jun 24 2006, 07:12 PM:name=AndyB)--][div class=\'quotetop\']QUOTE(AndyB @ Jun 24 2006, 07:12 PM) [snapback]387588[/snapback][/div][div class=\'quotemain\'][!--quotec--]If it shows up, then it's really in your code - probably as control characters. Look at the generated html code to give you a clue to where the weird stuff actually exists in the source.[/quote]I did a search for that  and couldnt find anythingAnd before I added in the PHP it did not use to appear.Ill take another look through the HTML though Quote Link to comment https://forums.phpfreaks.com/topic/12829-odd-thing-when-viewing-page/#findComment-49204 Share on other sites More sharing options...
AndyB Posted June 24, 2006 Share Posted June 24, 2006 [!--quoteo(post=387593:date=Jun 24 2006, 07:35 PM:name=b00paul)--][div class=\'quotetop\']QUOTE(b00paul @ Jun 24 2006, 07:35 PM) [snapback]387593[/snapback][/div][div class=\'quotemain\'][!--quotec--]Ill take another look through the HTML though[/quote]Just to be sure, I meant look at the generated HTML by using the browser's "view source". Note whether the weird characters are inside a table or not and where they appear on the page in the browser. If any of your content was produced with a word processor and 'pasted in', you might have captured a so-called smart quote or other similar stuff. Quote Link to comment https://forums.phpfreaks.com/topic/12829-odd-thing-when-viewing-page/#findComment-49207 Share on other sites More sharing options...
b00paul Posted June 24, 2006 Author Share Posted June 24, 2006 I mean, I know where it happens.<table border="1" width="100%"> <tr><th>Story Name</th><th>Description</th><th>Author</th><th>Last Update</th></tr><p>database selected</p></table>The [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]<p>database selected</p></table>[/quote] is from include("dbinfo.inc.php"); Quote Link to comment https://forums.phpfreaks.com/topic/12829-odd-thing-when-viewing-page/#findComment-49208 Share on other sites More sharing options...
AndyB Posted June 24, 2006 Share Posted June 24, 2006 Then either those weird characters appear between the </tr> and the include line or they're in the include file. Carefully delete[code]</tr><?include("dbinfo.inc.php");[/code]and then re-enter it. That'll ensure no weird stuff in the main file. If it reappears, check the dbinfo.inc.php file Quote Link to comment https://forums.phpfreaks.com/topic/12829-odd-thing-when-viewing-page/#findComment-49214 Share on other sites More sharing options...
b00paul Posted June 25, 2006 Author Share Posted June 25, 2006 [!--quoteo(post=387603:date=Jun 24 2006, 07:54 PM:name=AndyB)--][div class=\'quotetop\']QUOTE(AndyB @ Jun 24 2006, 07:54 PM) [snapback]387603[/snapback][/div][div class=\'quotemain\'][!--quotec--]Then either those weird characters appear between the </tr> and the include line or they're in the include file. Carefully delete[code]</tr><?include("dbinfo.inc.php");[/code]and then re-enter it. That'll ensure no weird stuff in the main file. If it reappears, check the dbinfo.inc.php file[/quote]Ok, now this is strange, I tried what u suggested, it didn't work.But then I tried instead of using the dbinfo.inc.php I would just include whats in it into my page.What is inside of it is the username, password, and database name. Thats ALL thats there.So, I removed the include("dbinfo.inc.php");and then copy and pasted what was inside of the dbinfo.inc.phpand now it works with no weird symbol things....any ideas of why it did that?Here was the exact code of the include file (personal info changed)<?$username="username";$password="password";$database="database";?> Quote Link to comment https://forums.phpfreaks.com/topic/12829-odd-thing-when-viewing-page/#findComment-49216 Share on other sites More sharing options...
AndyB Posted June 25, 2006 Share Posted June 25, 2006 No idea why that fixed it (other than there just might have been some control characters in the file that were only visible in the browser), but at least it's fixed. Quote Link to comment https://forums.phpfreaks.com/topic/12829-odd-thing-when-viewing-page/#findComment-49221 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.