NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming > CODE
Reload this Page Auto link add

CODE This forum is for posting code snippets and example scripts that aren't quite tutorials, but could be useful for others. You may post code snippets and/or completed scripts that you've written and want to share here.

Advanced Search
7 members in live chat ~  


Closed Thread
 
LinkBack Thread Tools
Old 09-08-2006, 12:53 PM THREAD STARTER               #1 (permalink)
NamePros Member
 
Mexican Fighter's Avatar
Join Date: Nov 2005
Posts: 119
Mexican Fighter will become famous soon enoughMexican Fighter will become famous soon enough
 



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?
Mexican Fighter is offline  
Old 09-08-2006, 04:34 PM   #2 (permalink)
Senior Member
 
Barrucadu's Avatar
Join Date: Aug 2005
Location: East Yorkshire, England
Posts: 2,689
Barrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu is a splendid one to beholdBarrucadu 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:
????: NamePros.com http://www.namepros.com/code/236041-auto-link-add.html

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;
????: NamePros.com http://www.namepros.com/showthread.php?t=236041
while(
$i mysql_num_rows($links)){
     echo 
'<a href = "'.mysql_result($link,$i,'url').'">'.mysql_result($link,$i,'link').'</a><br />';
     
$i++;

Barrucadu is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


 
All times are GMT -7. The time now is 02:57 PM.

Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger