Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Nov 2006
    Posts
    40
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question How to add flood control (like captcha) this form ?

    I search forum.I don't find.How to add flood control(like captcha) this form.I am new user


    Code:
    <script language="javascript" src="components/com_combomax/templates/js.tpl"></script>
    <style type="text/css">
    <!--
    .style6 {font-size: 16px}
    .style7 {
    	font-size: 14px;
    	font-weight: bold;
    	color: #000000;
    }
    -->
    </style>
     
    <a name="write-comment"></a>
    <div class="componentheading">Bu konu hakkında yorum yapınız </div>  
    <p style="font-size: 10px"><a class="style7" style="cursor: pointer; cursor: hand;" onclick="javascript:showhide2('hideshow');"><img src="http://www.haberpc.com/components/com_combomax/images/edit.gif" width="19" height="17" />yorum yazmak i&ccedil;in tıklayınız... </a></p>
    <div align="center" class="style6" id="hideshow" style="display: none;" name="hideshow">
    <form action="index.php" method="post" name="adminForm" id="adminForm" onsubmit="return validateForm( this,true,true,false,true,0)">
    
    <br /> 
    <br />
    Adınız: <br />   	  
    	<input type="text" name="name" style="width:300px;" class="inputbox" value="{MYNAME}" validate="blank" emsg="Lütfen adınızı giriniz!"><br />
    E-mail adresiniz: <br />
    	<input type="text" name="email" style="width:300px;" class="inputbox" value="{MYEMAIL}" validate="email|1" emsg="Lütfen e-mail adresinizi giriniz!"><br />
    Konu oylamanız:<br />          
                <span class="content_vote">
    			Çok kötü
    			<input type="radio" alt="vote 1 star" name="user_rating" value="1" />
    			<input type="radio" alt="vote 2 star" name="user_rating" value="2" />
    			<input type="radio" alt="vote 3 star" name="user_rating" value="3" />
    			<input type="radio" alt="vote 4 star" name="user_rating" value="4" />
    			<input type="radio" alt="vote 5 star" name="user_rating" value="5" checked="checked" />
    			Çok iyi			</span>
    			<br /><br />
    Yorumunuz: <br />
    	<textarea name="comment" id="comment" cols="50" rows="7" class="inputbox" validate="blank" emsg="Lütfen yorumunuzu giriniz!" onkeydown="javascript:sinirla(this)" onkeyup="javascript:sinirla(this)"></textarea>
      </p>
      <p>
    	<input type="text" size="5" id="kalan" name="kalan" value="140">
      </p>
         	<table border=0 cellspacing=3 cellpadding=0 class="smiletoolbar">
                               <tr>
                                  <td onClick="javascript:emo('B)');" style="cursor:pointer;"><img src="components/com_combomax/images/bigsmile-smiley.gif" width="15" height="15" alt="" border="0"></td>
                                  <td onClick="javascript:emo(':(');" style="cursor:pointer;"><img src="components/com_combomax/images/blue-smiley.gif" width="15" height="15" alt="" border="0"></td>
                                  <td onClick="javascript:emo(':)');" style="cursor:pointer;"><img src="components/com_combomax/images/happy-smiley.gif" width="15" height="15" alt="" border="0"></td>
                                  <td onClick="javascript:emo(':laugh:');" style="cursor:pointer;"><img src="components/com_combomax/images/laughing-smiley.gif" width="15" height="15" alt="" border="0"></td>
                                  <td onClick="javascript:emo(':sad:');" style="cursor:pointer;"><img src="components/com_combomax/images/sad-smiley.gif" width="15" height="15" alt="" border="0"></td>
                                  <td onClick="javascript:emo(':q:');" style="cursor:pointer;"><img src="components/com_combomax/images/question.gif" width="15" height="15" alt="" border="0"></td>							  
    							  <td onClick="javascript:emo(':thumbup:');" style="cursor:pointer;"><img src="components/com_combomax/images/thumbsup.gif" width="15" height="15" alt="" border="0"></td>							  
    							  <td onClick="javascript:emo(':thumbdown:');" style="cursor:pointer;"><img src="components/com_combomax/images/thumbsdown.gif" width="15" height="15" alt="" border="0"></td>							  
    							  <td onClick="javascript:emo(':clown:');" style="cursor:pointer;"><img src="components/com_combomax/images/clown.gif" width="15" height="15" alt="" border="0"></td>							  
                                  <td onClick="javascript:emo('');" style="cursor:pointer;"><strong>BOLD</strong></td>							  
    							  <td onClick="javascript:emo('');" style="cursor:pointer;">"QUOTE"</td>
    							  <td onClick="javascript:emo('');" style="cursor:pointer;"><U>UNDERLINE</U></td>
                               </tr>
          </table>
                            
              
    <input type="submit" name="pressbutton" value="Gönder" style="width: 100px;" class="button">
    <input type="reset" class="button" value="Formu Temizle" />
    
    <input type="hidden" name="option" value="com_combomax" />
    <input type="hidden" name="contentid" value="{CONTENTID}" />
    <input type="hidden" name="task" value="preview" />
    </form>
    </div>
    
    <br />

  • #2
    New Coder
    Join Date
    May 2006
    Location
    Pennsylvania, USA
    Posts
    31
    Thanks
    0
    Thanked 4 Times in 4 Posts
    something like this should work
    PHP Code:
    <?php
    $last_time 
    $_COOKIE['last_hit_time'];
    $now time();
    $wait 5;
    if(empty(
    $last_time))
    {
        
    setcookie('last_hit_time'$now);
    }
    else
    {
        if((
    $last_time $wait) < $now)
        {
            die();
        }
        else
        {
            
    setcookie('last_hit_time'$now);
        }
    }
    ?>
    You would probaly have to use a database for true flood detection, this code just allows one view per 5 seconds


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •