Re: link DB record through browser...
- From: David Harper <devnull@xxxxxxxxxxxxxxxxxxx>
- Date: Thu, 16 Feb 2006 07:49:21 GMT
snehalapatil@xxxxxxxxx wrote:
Hi all,
I have a remote sybase database,I want to display links in web page
(browser) such that when user clicks on link ,actual record in that
sybase database table should be opend.
i.e. I want to connect actual database record to my web page through
Hyperlink.
So my question is ... how should I build the link?
The link will need to include some piece of information that identifies the record uniquely.
This could be the primary key of the table, which is usually an integer, so your link might look like
http://www.example.com/myapp/getrecord.php?id=1234
There's one drawback with this method, though. Hackers will quickly figure out that 1234 is a primary key in the underlying database, and they will try substituting other numbers in order to access other records in your database. You probably don't want them to do this.
To solve this problem, add another column to your table, make it a unique key, and set it to a hash of some or all of the contents of the row. Then use that column in your link, which will look something like:
http://www.example.com/myapp/getrecord.php?id=5A6DBF67C656AD70
Your SQL query will now select using the hash value, which looks like random text. Hackers won't be able to guess the hash values of other records, because they don't know what data went into calculating the hash.
I'm not familiar with Sybase, but MySQL has server-side functions for hashing strings using algorithms such as MD5, and I'm guessing that Sybase provides this kind of thing too.
David Harper
Cambridge, England
.
- Follow-Ups:
- Re: link DB record through browser...
- From: snehalapatil@xxxxxxxxx
- Re: link DB record through browser...
- References:
- link DB record through browser...
- From: snehalapatil@xxxxxxxxx
- link DB record through browser...
- Prev by Date: Re: to get output parameter from the stored procedure
- Next by Date: Oracle Thin JDBC Driver Problem - Run time
- Previous by thread: Re: link DB record through browser...
- Next by thread: Re: link DB record through browser...
- Index(es):
Relevant Pages
|
|