URL Linker ?????

Links for php scripts

Moderators: macek, egami, gesf

ferrisj
New php-forum User
New php-forum User
Posts: 3
Joined: Sat Feb 01, 2003 4:09 pm

URL Linker ?????

Postby ferrisj » Sat Feb 01, 2003 4:15 pm

I'm trying to figure out the easiest way to have a php script that will automatically link all of my "http://" urls on a page, and open those pages in a new window.

Also is there a way to identify this for a field in MySQL? That is where i'm pulling my data from.

Plus if i can add it to a form while inserting into the database, that would be cool too.

Any help appreciated.

User avatar
Oleg Butuzov
Last Samuray
Last Samuray
Posts: 831
Joined: Sun Jun 02, 2002 3:09 am

Postby Oleg Butuzov » Sun Feb 02, 2003 12:42 am

Let me think. You are newbie.

Answers:
target=_blank
form -> insert
mysql -> select -> print

ferrisj
New php-forum User
New php-forum User
Posts: 3
Joined: Sat Feb 01, 2003 4:09 pm

Postby ferrisj » Sun Feb 02, 2003 9:25 am

I already know those answers, but they are not specific to my first question.

I'm trying to figure out how to automatically link all url's on a page using php, or can it be added to a field in mysql?

Anyone ???

User avatar
Oleg Butuzov
Last Samuray
Last Samuray
Posts: 831
Joined: Sun Jun 02, 2002 3:09 am

Postby Oleg Butuzov » Sun Feb 02, 2003 11:24 pm

$query=mysql_query("SELECT `url` FROM `urlbase`");
while ($data=mysql_fetch_array($query))
{
echo "<a href=$data[url] target=_blank>$url</a><br>";
}


Return to “PHP Scripts”

Who is online

Users browsing this forum: No registered users and 0 guests