append .html to db result link

This is a discussion on append .html to db result link within the alt.comp.lang.php forums, part of the PHP Programming Forums category; Hello, I want to append .html to my links as per the following: while ( $row = mysql_fetch_array( $result ) ) { echo " <...


Go Back   Usenet Forums > PHP Programming Forums > alt.comp.lang.php

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 10-02-2006
Terence
 
Posts: n/a
Default append .html to db result link

Hello,

I want to append .html to my links as per the following:


while ( $row = mysql_fetch_array( $result ) )
{
echo " <tr>\n";
echo ' <td><a href="';
echo htmlspecialchars( $row['var'] );
echo '" target="_blank">';
echo htmlspecialchars( $row['var'] );
echo "</a></td>\n";
echo " </tr>\n";
}

I'm missing something obvious (but, {not yet}to me) - thanks in advance.


Reply With Quote
  #2 (permalink)  
Old 10-03-2006
Schluppy
 
Posts: n/a
Default Re: append .html to db result link

On Mon, 02 Oct 2006 21:15:55 +0000, Terence wrote:

> Hello,
>
> I want to append .html to my links as per the following:
>
>
> while ( $row = mysql_fetch_array( $result ) )
> {
> echo " <tr>\n";
> echo ' <td><a href="';
> echo htmlspecialchars( $row['var'] );
> echo '" target="_blank">';
> echo htmlspecialchars( $row['var'] );
> echo "</a></td>\n";
> echo " </tr>\n";
> }
>
> I'm missing something obvious (but, {not yet}to me) - thanks in advance.


Insert ".html" into the href attribute, like so:

echo '.html" target="_blank">';

--
Schluppy
Reply With Quote
  #3 (permalink)  
Old 10-03-2006
.:[ ikciu ]:.
 
Posts: n/a
Default Re: append .html to db result link

Zebrawszy mysli Terence <nope@nope.com> wyklepal:
> Hello,
>
> I want to append .html to my links as per the following:
>
>
> while ( $row = mysql_fetch_array( $result ) )
> {
> echo " <tr>\n";
> echo ' <td><a href="';
> echo htmlspecialchars( $row['var'] );
> echo '" target="_blank">';
> echo htmlspecialchars( $row['var'] );
> echo "</a></td>\n";
> echo " </tr>\n";
> }
>
> I'm missing something obvious (but, {not yet}to me) - thanks in
> advance.


if you don't know you can use only one echo

echo " <tr>\n
<td><a href="'.htmlspecialchars( $row['var'] ).'.html'.'"
target="_blank">'.htmlspecialchars( $row['var'] )."</a></td>\n
</tr>\n";



--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Ikciu | gg: 718845 | www: www.e-irsa.pl

2be || !2be $this => mysql_query();


Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 02:13 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0