hyperlinks stored in pgsql

Поиск
Список
Период
Сортировка
Искать

hyperlinks stored in pgsql

От:
<operationsengineer1@yahoo.com>
Дата:
i'm wondering if there are any issues i should be
aware of when storing "active" hyperlink data in my
db.

right now, i'm storing text like "http://domain.com"
in the db.  when i display the data, it displays as
text and the usuer has to copy and paste it to the
address bar and press enter to view the link.

i'd like to enter 

" domain"

into the db so that the user will just have to click
the link to view the hyperlinked page.

somehow i think this is might be a security risk, but
i can't recall for sure.

tia...

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Re: hyperlinks stored in pgsql

От:
"Andrej Ricnik-Bay" <andrej.groups@gmail.com>
Дата:
On 9/1/06, operationsengineer1@yahoo.com
>  " domain"
>
> into the db so that the user will just have to click
> the link to view the hyperlinked page.
>
> somehow i think this is might be a security risk, but
> i can't recall for sure.
Not from a database perspective;  to postgres it's still just
text data.  Whether or not the users are able to modify the
tags so it looks like " domain"
is not a database issue :}


> tia...
Cheers,
Andrej

-- 
Please don't top post, and don't use HTML e-Mail :}  Make your quotes concise.

http://www.american.edu/econ/notes/htmlmail.htm

Re: hyperlinks stored in pgsql

От:
Andreas <maps.on@gmx.net>
Дата:


operationsengineer1@yahoo.com schrieb:
> i'm wondering if there are any issues i should be
> aware of when storing "active" hyperlink data in my
> db.

You are mixing something up.
A hyperlink or any form of URL is just a string. It's as such not magic 
or active as long it gets interpreted as an URL and tossed to a suitable 
browser.

You find a "hyperlink" datatype in MS-Access. Thats still just a simple 
varchar where Access has the additional information that it should throw 
it to the program that is registered as your web-browser in your 
operating system.
Access doesn't even check wether the inserted text conforms with the 
rules for hyperlinks. You could store poems in such hyperlink columns 
and still IE won't hop anywhere if you click on the nicely blue 
underlined text.

Anyway ... this data type might be useful in Access does provide an data 
manipulation interface in sense of forms or "tables" which are in 
essence forms, too.

PostgreSQL is a storage engine that can keep your hyperlink-strings 
ready but it doesn't have an interpreting interface.
So PostgreSQL shows no data where you could click on and it has no idea 
about the client's environment like his favourite browser.

So store URLs in varchars and let the client software interpret the data 
as "active" hyperlink.


> right now, i'm storing text like "http://domain.com"
> in the db.  when i display the data, it displays as
> text and the usuer has to copy and paste it to the
> address bar and press enter to view the link.

Where and how is the data displayd?
If you type an SQL query into psql you shouldn't wonder that the 
textmode output is not clickable.

If you have a more comfortable program to view the data, you might be 
able to tell it this column holds URLs.
There's a good chance you even don't need the "http://" in front of the 
domain.
You might run into trouble with some brain dead web servers that won't 
accept  "domain.com"  but require   "www.domain.com".
And there are URLs that won't work with the "www." like "dict.leo.org".


> i'd like to enter 
> " domain"

If your client interface is a web-application where some script language 
like PHP pulls data out of the DBMS and processes it dynamically to HTML 
  then and just then will those HTML-link-tags be of any use.

In this case you store the domain "www.domain.com" probaply with 
additional info like the description and an alt-text in varchars.
On runtime you let a script assemble the complete link-tag and integrate 
it in the HTML output.

e.g.
"dict.leo.org" + "online dictionary" + "click here for wisdom" +  scripting
----->
online dictionary


> somehow i think this is might be a security risk, but
> i can't recall for sure.

The DBMS couldn't care less if the stored data is just a domain or a 
complete HTML tag.

FAQ