close ad
Help us test the new Databridge BETA with MySQLi support
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Can I use WebAssist to convert urls to hyperlinks?

Thread began 1/22/2012 3:49 pm by ovknox388992 | Last modified 2/14/2012 9:46 am by Jason Byrnes | 2056 views | 10 replies |

ovknox388992

Can I use WebAssist to convert urls to hyperlinks?

I am using DW CS5, MySQ, PHP, Form Builder 2, DataAssist, etc. I have created a registration form with Security Assist to gather basic information about businesses that subscribe to my website. This form has entries for email, password, website url, etc. It requires the following format for the website url: (www.mywebsite.com). The url information downloads into MySQL just fine. However, these records are stored simply as a urls, not a hyperlinks.

I need to create a recordset that incorporates these urls and displays them as hyperlinks in a table on my website. The table is part of a Master/Detail page set. I want to create two links in each row in the Master table. One link would redirect the visitor to the Detail page (I know how to do that) but I want the other link to redirect the visitor to the business website. Obviously, the record set displays the urls on the master page, but not as hyperlinks. Is there an easy and practical method to convert these urls into hyperlinks? If possible, would this be done with Dreamweaver, PHP, or MySql, or a WebAssit Extension? Is there an automated method that will write code for me? If you have a solution or suggestion it will be greatly appreciated. Much Thanks!

Sign in to reply to this post

Ian S

You do not need any third party extensions to create hyperlinks in Dreamweaver.

You simply make the A HREF dynamic, telling it to include the database value as the link.

e.g.

<a href="<?php echo ($row_myrecordset['url']); ?>" target="_blank"><?php echo ($row_myrecordset['url']); ?></a>

Regarding the query you will need to create a SELECT query with a JOIN. This can be done with the standard Dreamweaver Recordset but you will need to know a little bit about mySQL syntax as it needs to be typed manually. The query will look something like this, but obviously depends on your table and field names.

SELECT fields FROM table1 INNER JOIN table2 ON table1.id = table2.foreignkey

Cheers
Ian

Sign in to reply to this post

ovknox388992

Problem converting urls into dynamic hyperlinks

Thanks IAN for your assistance. I think I am on the right track, but I am new at this and would appreciate a little more assistance please. I am obviously still doing something wrong. The data is pulling up just fine, but the "url" field in the jobs table is displayed only as a url, but not as a link. Currently {rs_job.url} appears beneath the table as a link, but it disappears when I open my browser. Any advice will be much appreciated.

I have created two tables with the following fields:

1. construction
Business_ID
BusinessName
Position
Salary
State
2. jobs
Job_ID
Business_ID
url

My Recordset is: (rs_job)

SELECT construction.Business_ID, construction.BusinessName, construction.Position, construction.State, construction.Salary, jobs.url
FROM construction INNER JOIN jobs ON construction.Business_ID=jobs.Business_ID

My Code is:

<table width="100%" border="1">
<tr class="Leadership_Table_Header">
<td>business</td>
<td>position</td>
<td>salary</td>
<td>state</td>
<td>website</td>
</tr>
<?php do { ?>
<tr>
<td><?php echo $row_rs_job['BusinessName']; ?></td>
<td><?php echo $row_rs_job['Position']; ?></td>
<td><?php echo $row_rs_job['Salary']; ?></td>
<td><?php echo $row_rs_job['State']; ?></td>
<td><?php echo $row_rs_job['url']; ?></td>
</tr>
<?php } while ($row_rs_job = mysql_fetch_assoc($rs_job)); ?>
</table>
<a href="<?php echo ($row_rs_job['url']); ?>" target="_Blank"><?php echo ($row_rs_job['url']); ?></a>

Sign in to reply to this post

Ian S

Hi!

How is your link being stored?

Are you storing it as www.website.com or www.website.com

You will need to include the http:// either in your database, or as part of the link....

<a href="http://<?php echo ($row_rs_job['url']); ?>" target="_Blank"><?php echo ($row_rs_job['url']); ?></a>

Otherwise your browser will not know what to do with the URL.

Cheers
Ian

Sign in to reply to this post

ovknox388992

Still Struggling with Converting urls to Hyperlinks

Thanks LAN for your patience. I am storing the urls in the database as follows: www.website.com. Does it need to be ? I have tried it with and without the .... but with no success. I am at a total loss. I must be doing something fundamentally wrong. There is probably a very simple solution. Any other suggestions?? Thanks again for your patience.

Sign in to reply to this post

Jason ByrnesWebAssist

can you send a link to a page that shows the problem, this will help us determine what the problem may be.

Sign in to reply to this post

ovknox388992

Hyperlink Error

This link will illustrate what I am trying to accomplish. I hope it is what you need. Thanks!

Index.php

Sign in to reply to this post

Jason ByrnesWebAssist

like Ian had posted before, the fix is to change:

php:
<td><?php echo $row_rs_job['url']; ?></td>




to:

php:
<td><a href="http://<?php echo $row_rs_job['url']; ?>"><?php echo $row_rs_job['url']; ?></a></td>




it does not look like you have tried to implement this on the page you have linked to. What I was asking for was a page that you have tried to implement the code on where it is not working.

Sign in to reply to this post

ovknox388992

Hyperlinks

Thanks.....I will see if I can make it work....

Sign in to reply to this post

ovknox388992

Thanks Ian & Jason

Thanks a million! That did the trick. "Change" was the key word here. I was adding code when I should have been changing it. When you know what you are doing it is "awfully simple" and when you don't know, it is "simply awfully." Thanks for being patient with slow learners.

Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...