Dynadot โ€” .com Registration $8.99

Auto link add

Spaceship Spaceship
Watch
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?
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
AfternicAfternic
HoldemUniversity said:
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:
<?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:
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++;
}
 
0
•••
Appraise.net
Unstoppable Domains
Domain Recover
DomainEasy โ€” Live Options
  • The sidebar remains visible by scrolling at a speed relative to the pageโ€™s height.
Back