Creating Link

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
pkvasan
Forum Newbie
Posts: 4
Joined: Mon Jan 29, 2007 6:05 am

Creating Link

Post by pkvasan »

Hi

I am taking out data from MySql like Id , Name, Address, Age, City, Remark and displaying on an HTML table, now i want one of the field that is remark field to have hyperlink and on clicking the hyperlink remarks stored in another DB should be displayed.

Please help me in giving some idea on how to do this.

-/Kirthi
User avatar
louie35
Forum Contributor
Posts: 144
Joined: Fri Jan 26, 2007 8:40 am
Location: Dublin
Contact:

Post by louie35 »

is there a relation between the tables like ID?
if yes pass it over by query string.
User avatar
dude81
Forum Regular
Posts: 509
Joined: Mon Aug 29, 2005 6:26 am
Location: Pearls City

Post by dude81 »

I came across the same situation once when I was beginning of PHP.

On user clicking the link, your link should be of this form

Code: Select all

http://yourlink.com/purephpfile.php?variable1=value1&variable2=value2.. and so on.
Build a pure php file with no spaces or echo messages in which on receiving this values collect the values and store it in db and use another header function for going back to your original php page.

Code: Select all

<?php
//purephpfile.php
if((isset($_REQUEST['variable1']))&& (isset($_REQUEST['variable2']))){
//collect the variables here
//store it in db
header('Location:youroriginalviewpage.php');
}
?>
.
I hope this could be useful.

Well Im not talking about any security conditions here.
Post Reply