[advanced search]
19 members in the live chat room. Join Chat!
Register Rules & FAQ NP$ Store Active Threads Mark Forums Read
Go Back   NamePros.Com > Design and Development > Programming > CODE
User Name
Password

Old 09-08-2006, 12:53 PM   · #1
HoldemUniversity
NamePros Member
 
Trader Rating: (6)
Join Date: Nov 2005
Posts: 54
NP$: 0.00 (Donate)
HoldemUniversity is an unknown quantity at this point
Auto link add

I'm looking for a script to allow users to automatically add text links on my site. Preferably in html or java.

Anybody know of any?


Please register or log-in into NamePros to hide ads
HoldemUniversity is offline   Reply With Quote
Old 09-08-2006, 04:34 PM   · #2
Mikor
Resident Linux Geek
 
Mikor's Avatar
 
Name: Michael Walker
Location: East Yorkshire, England
Trader Rating: (7)
Join Date: Aug 2005
Posts: 2,405
NP$: 298.25 (Donate)
Mikor is a splendid one to beholdMikor is a splendid one to beholdMikor is a splendid one to beholdMikor is a splendid one to beholdMikor is a splendid one to beholdMikor is a splendid one to behold
Originally Posted by HoldemUniversity
I'm looking for a script to allow users to automatically add text links on my site. Preferably in html or java.

Anybody know of any?



Not possible in HTML and I dont know Java, so here it is in PHP, you need to have a MySQL database for this to work:

link.php
PHP Code:
<?php
if($_POST['link']){
     
mysql_connect('server','username','password')or die(mysql_error());
     
mysql_select_db('name')or die(mysql_error());
     
mysql_query('insert into links values("'.$_POST['link'].'","'.$_POST['url'].'"')or die(mysql_error());
     
mysql_close();
}
?>

<form action = 'link.php' method = 'post'>
Link Title: <input name = 'link' type = 'text' /><br />
Link URL: <input name = 'url' type = 'text' /><br />
<input name = 's' type = 'submit' value = 'Add Link' />


view_links.php
PHP Code:
mysql_connect('server','username','password')or die(mysql_error());
mysql_select_db('name')or die(mysql_error());
$links = mysql_query('select * from links order by link asc')or die(mysql_error());
mysql_close();

$i = 0;
while(
$i < mysql_num_rows($links)){
     echo
'<a href = "'.mysql_result($link,$i,'url').'">'.mysql_result($link,$i,'link').'</a><br />';
     
$i++;
}
__________________
Me | Blog | Last.fm | F@h

archlinux User
Mikor is offline   Reply With Quote
Closed Thread

NamePros is a revenue sharing forum.

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


Site Sponsors
http://www.mobisitetrader.com/ Get Me Visits Build your NameBrand
Advertise your business at NamePros
All times are GMT -7. The time now is 05:17 AM.


Powered by: vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0