Jump to content

Odd thing when viewing page...


b00paul

Recommended Posts

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]
Link to comment
Share on other sites

[!--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 anything

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

Ill take another look through the HTML though
Link to comment
Share on other sites

[!--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.
Link to comment
Share on other sites

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");
Link to comment
Share on other sites

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
Link to comment
Share on other sites

[!--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.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";
?>
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.