PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Wed Sep 30, 2020 8:01 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Fri Nov 05, 2010 11:23 pm 
Offline
Forum Newbie

Joined: Fri Nov 05, 2010 11:17 pm
Posts: 1
Ok so here's what iam doing. I have a premade site template that is made of mysql and php. Iam trying to edit it. In the backend of the site i can upload data. so iam uploading a domain name. The domain name is showing up on the site from the database. But how can i make it an active hyperlink? Remember the link would change evrytime for every different page depending on what i uploaded to the database


Top
 Profile  
 
PostPosted: Sat Nov 06, 2010 12:05 am 
Offline
Site Administrator
User avatar

Joined: Wed Aug 25, 2004 7:54 pm
Posts: 13592
Location: New York, NY, US
Usually displaying database values looks something like this:
Syntax: [ Download ] [ Hide ]
<?php
// using double quotes
echo "<a href=\"{$row['url']}\">{$row['name']}</a>";
// using single quotes
echo '<a href="' . $row['url']. '">' . $row['name'] . '</a>';
?>
<!-- or you can embed PHP tags in HTML -->
<a href="<?php echo $row['url']; ?>"><php echo $row['name']; ?></a>

_________________
(#10850)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 16 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group