Boards > LinkBase 1.1. PHP Script

help please !! Dont want people to have to register to add link

(1/1)

x1x9x8x1:
G'day

First of all nice script.

Ok my question is, How can i set this up so it acts like a link dump script... i dont want people to have to sign up to add a link, and also i would like to set to auto- approve ??

If you could   let me know asap that would be great

Thanks ;)

aleksa:
addurl.php

--- Code: ---<?php 
?>

<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<?php
require_once('admin/options.php');
include('templates/'.$config['temp'].'/headers.php');
require_once('languages/lang_'.$config['lang'].'.php'); 

echo "<br>";
$id = $_GET['id'];
$result = mysql_query("SELECT catid, cat FROM oscaty WHERE catid='$id'")
or die(mysql_error()); 
while($row=mysql_fetch_array($result)){
echo"<title>Add Url :: $row[cat]</title>";
echo "<a href=\"catsy.php?id=$row[catid]\">$row[cat]</a><br>";
echo "<hr>";
echo $row['cat'];
echo "<br>";
$val = $row['catid'];
}
if(isset($_POST['submit']))
{

$text = $_POST['text'];
$main = $_POST['main'];
$linkurl = $_POST['linkurl'];
$idcat = $_POST['idcat'];
$text1 = $_POST['text1'];
$text2 = $_POST['text2'];
$text3 = $_POST['text3'];
}else{

?>
<script type="text/javascript">
var ns6=document.getElementById&&!document.all
function restrictinput(maxlength,e,placeholder){
if (window.event&&event.srcElement.value.length>=maxlength)
return false
else if (e.target&&e.target==eval(placeholder)&&e.target.value.length>=maxlength){
var pressedkey=/[a-zA-Z0-9\.\,\/]/ //detect alphanumeric keys
if (pressedkey.test(String.fromCharCode(e.which)))
e.stopPropagation()
}
}

function countlimit(maxlength,e,placeholder){
var theform=eval(placeholder)
var lengthleft=maxlength-theform.value.length
var placeholderobj=document.all? document.all[placeholder] : document.getElementById(placeholder)
if (window.event||e.target&&e.target==eval(placeholder)){
if (lengthleft<0)
theform.value=theform.value.substring(0,maxlength)
placeholderobj.innerHTML=lengthleft
}
}


function displaylimit(thename, theid, thelimit){
var theform=theid!=""? document.getElementById(theid) : thename
var limit_text='<b><span id="'+theform.toString()+'">'+thelimit+'</span></b><?php echo $lang['CHAR']; ?>'
if (document.all||ns6)
document.write(limit_text)
if (document.all){
eval(theform).onkeypress=function(){ return restrictinput(thelimit,event,theform)}
eval(theform).onkeyup=function(){ countlimit(thelimit,event,theform)}
}
else if (ns6){
document.body.addEventListener('keypress', function(event) { restrictinput(thelimit,event,theform) }, true);
document.body.addEventListener('keyup', function(event) { countlimit(thelimit,event,theform) }, true);
}
}

</script>
 <form name="theform" method="post" action="submit.php?id=<?php echo $val ?>">
<table width="200" border="0" cellspacing="0" cellpadding="0">
  <tr>
Title: <input name="text" size="40" maxlength="255">
<script>
displaylimit("document.theform.text","",35)
</script>
<br>
<?php echo $lang['URL']; ?><input name="linkurl" size="40" value="http://" maxlength="255">
<script>
displaylimit("document.theform.linkurl","",80)
</script>
<br>
<br>
<?php echo $lang['YNAME']; ?><?php echo $myrow[Username] ?><input type="text" name="text1"  size="40" maxlength="255">
<br>
<br>
<?php echo $lang['DESCR']; ?><textarea name="text2" rows="7" cols="30"></textarea>
<script>
displaylimit("document.theform.text2","",280)
</script>
<br>
<?php echo $lang['KEYA']; ?><input name="text3" size="40" maxlength="255">
<script>
displaylimit("document.theform.text3","",150)
</script>
</font>
</style>
<br>
<input type="hidden" name="idcat" value="<?php echo $val ?>" >
<input type="hidden" name="main" value="0" >
<table width="200" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="200" height="100"><img src="captcha_img.php" border="0"></td>
  </tr>
  <tr>
    <td style="padding-top: 5px">   
      <font size="2"><?php echo $lang['IRESULT']; ?><input type="text" name="capt" >
      <div style="padding-top: 5px"><input type="submit" name="Submit" value="<?php echo $lang['SUBA']; ?>">
    </td>
  </tr>
</table>
</form>
<?php


            }

include('templates/'.$config['temp'].'/footer.php');
?>



--- End code ---

Navigation

[0] Message Index

Go to full version