Forum Moderators: coopster

Message Too Old, No Replies

Question on having a Link show up in my Database

         

abndrew82

12:12 am on Oct 11, 2007 (gmt 0)

10+ Year Member



Ok First some background

I am new to PHP and Somewhat new to Mysql.

I have created a Database that will list a list of items I have on a character from a Video Game.

And I used a program called PHP Generator to generate a PHP Page that pulls this Database info and displays it in a site.

That can be viewed here

<snip>

Now my issue, is as you can see for the Link Column. I am trying to make that be just the word link and click able to open the link in either the same or new window.

Not sure if this is possible, but figure it should be. Any assistance would be greatly appreciated.

[edited by: eelixduppy at 12:48 am (utc) on Oct. 11, 2007]
[edit reason] removed url [/edit]

eelixduppy

12:50 am on Oct 11, 2007 (gmt 0)



Hello and Welcome to WebmasterWorld!

You are echoing out the html entities of the string for some reason. You can undo this by using html_entity_decode [us2.php.net].

If you are having further problems please post a brief, relevant snippet of code that represents the problem area.

abndrew82

1:00 am on Oct 11, 2007 (gmt 0)

10+ Year Member



Hmm ok not really sure what I am looking for, but will read some more.

Here is where I think the code is for that section from my php file

With the line for the Link Column Bolded

Something else that may be helpful that not sure if I did right.

I have the Link in the Database as the HTML code for the link of

<a href="http://example.com/database/items/details/481560/">Link</a>

Not sure if that is how that needs to be done, was really just a guess

<?php }?>

<?php function showroweditor($row, $iseditmode)
{
global $conn;
?>
<table class="tbl" border="0" cellspacing="3" cellpadding="5"width="50%">
<tr>
<td class="hr"><?php echo htmlspecialchars("DustName")."&nbsp;"?></td>
<td class="dr"><textarea cols="35" rows="4" name="DustName" maxlength="255"><?php echo str_replace('"', '&quot;', trim($row["DustName"]))?></textarea></td>
</tr>
<tr>
<td class="hr"><?php echo htmlspecialchars("DustTier")."&nbsp;"?></td>
<td class="dr"><textarea cols="35" rows="4" name="DustTier" maxlength="255"><?php echo str_replace('"', '&quot;', trim($row["DustTier"]))?></textarea></td>
</tr>
<tr>
<td class="hr"><?php echo htmlspecialchars("DustRarity")."&nbsp;"?></td>
<td class="dr"><textarea cols="35" rows="4" name="DustRarity" maxlength="255"><?php echo str_replace('"', '&quot;', trim($row["DustRarity"]))?></textarea></td>
</tr>
<tr>
<td class="hr"><?php echo htmlspecialchars("DustCount")."&nbsp;"?></td>
<td class="dr"><textarea cols="35" rows="4" name="DustCount" maxlength="255"><?php echo str_replace('"', '&quot;', trim($row["DustCount"]))?></textarea></td>
</tr>
<tr>
[b]<td class="hr"><?php echo htmlspecialchars("Link")."&nbsp;"?></td>
<td class="dr"><textarea cols="35" rows="4" name="Link" maxlength="255"><?php echo str_replace('"', '&quot;', trim($row["Link"]))?></textarea></td>[/b]
</tr>
</table>
<?php }?>

[edited by: eelixduppy at 1:09 am (utc) on Oct. 11, 2007]
[edit reason] exemplified [/edit]

coopster

1:36 pm on Oct 15, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



You are converting your html value stored in your database. The html special characters are being converted to their respective entity values so that they can be viewed in the browser as text as opposed to being rendered by the browser as actual html and links. Have a read on the PHP htmlspecialchars() [php.net] function for details.