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(&#39;admin/options.php&#39;);
include(&#39;templates/&#39;.$config[&#39;temp&#39;].&#39;/headers.php&#39;);
require_once(&#39;languages/lang_&#39;.$config[&#39;lang&#39;].&#39;.php&#39;); 

echo "<br>";
$id = $_GET[&#39;id&#39;];
$result = mysql_query("SELECT catid, cat FROM oscaty WHERE catid=&#39;$id&#39;")
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[&#39;cat&#39;];
echo "<br>";
$val = $row[&#39;catid&#39;];
}
if(isset($_POST[&#39;submit&#39;]))
{

$text = $_POST[&#39;text&#39;];
$main = $_POST[&#39;main&#39;];
$linkurl = $_POST[&#39;linkurl&#39;];
$idcat = $_POST[&#39;idcat&#39;];
$text1 = $_POST[&#39;text1&#39;];
$text2 = $_POST[&#39;text2&#39;];
$text3 = $_POST[&#39;text3&#39;];
}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[&#39;CHAR&#39;]; ?>'
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[&#39;URL&#39;]; ?><input name="linkurl" size="40" value="http://" maxlength="255">
<script>
displaylimit("document.theform.linkurl","",80)
</script>
<br>
<br>
<?php echo $lang[&#39;YNAME&#39;]; ?><?php echo $myrow[Username] ?><input type="text" name="text1"  size="40" maxlength="255">
<br>
<br>
<?php echo $lang[&#39;DESCR&#39;]; ?><textarea name="text2" rows="7" cols="30"></textarea>
<script>
displaylimit("document.theform.text2","",280)
</script>
<br>
<?php echo $lang[&#39;KEYA&#39;]; ?><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[&#39;IRESULT&#39;]; ?><input type="text" name="capt" >
      <div style="padding-top: 5px"><input type="submit" name="Submit" value="<?php echo $lang[&#39;SUBA&#39;]; ?>">
    </td>
  </tr>
</table>
</form>
<?php


            }

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



--- End code ---

Navigation

[0] Message Index

Go to full version