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 " <...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
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. |
|
|||
|
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 |
|
|||
|
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(); |