Jump to content


Photo

Odd thing when viewing page...


  • Please log in to reply
7 replies to this topic

#1 b00paul

b00paul
  • New Members
  • Pip
  • Newbie
  • 4 posts

Posted 24 June 2006 - 10:54 PM

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
<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>";
?>


#2 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 24 June 2006 - 11:12 PM

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.
Legend has it that reading the manual never killed anyone.
My site

#3 b00paul

b00paul
  • New Members
  • Pip
  • Newbie
  • 4 posts

Posted 24 June 2006 - 11:35 PM

[!--quoteo(post=387588:date=Jun 24 2006, 07:12 PM:name=AndyB)--][div class=\'quotetop\']QUOTE(AndyB @ Jun 24 2006, 07:12 PM) View Post[/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 anything

And before I added in the PHP it did not use to appear.

Ill take another look through the HTML though

#4 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 24 June 2006 - 11:41 PM

[!--quoteo(post=387593:date=Jun 24 2006, 07:35 PM:name=b00paul)--][div class=\'quotetop\']QUOTE(b00paul @ Jun 24 2006, 07:35 PM) View Post[/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.

Legend has it that reading the manual never killed anyone.
My site

#5 b00paul

b00paul
  • New Members
  • Pip
  • Newbie
  • 4 posts

Posted 24 June 2006 - 11:44 PM

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");

#6 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 24 June 2006 - 11:54 PM

Then either those weird characters appear between the </tr> and the include line or they're in the include file. Carefully delete
</tr>
<?
include("dbinfo.inc.php");
and then re-enter it. That'll ensure no weird stuff in the main file. If it reappears, check the dbinfo.inc.php file
Legend has it that reading the manual never killed anyone.
My site

#7 b00paul

b00paul
  • New Members
  • Pip
  • Newbie
  • 4 posts

Posted 25 June 2006 - 12:04 AM

[!--quoteo(post=387603:date=Jun 24 2006, 07:54 PM:name=AndyB)--][div class=\'quotetop\']QUOTE(AndyB @ Jun 24 2006, 07:54 PM) View Post[/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
</tr>
<?
include("dbinfo.inc.php");
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.php

and 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";
?>

#8 AndyB

AndyB
  • Staff Alumni
  • Advanced Member
  • 5,465 posts
  • LocationToronto

Posted 25 June 2006 - 12:17 AM

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.
Legend has it that reading the manual never killed anyone.
My site




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users