Jump to content

Gayner

Members
  • Posts

    549
  • Joined

  • Last visited

    Never

Posts posted by Gayner

  1. if (!isset($_SESSION)) {
        session_start();
    }
    // anti flood protection
    if($_SESSION['last_session_request'] > time() - 30){
        // users will be redirected to this page if it makes requests faster than 2 seconds
        header("location: /flood.html");
        exit;
    }
    $_SESSION['last_session_request'] = time();

     

    this is best 1

  2. I have a index.php that has my html in it for my skinning formain site template.

     

     

    I don't want to copy paste it again for each new .php.. then if i want to edit i would have to go through every single new php file i made and edit the stupid html

     

    how can i make a universal skin?

  3. His background image probably includes the border, and each character is probably drawn separate rather than in a single string.

     

    i found 1

     

    $text = rand(10000,99999); 
    $_SESSION["vercode"] = $text; 
    $height = 25; 
    $width = 65; 
    
    $image_p = imagecreate($width, $height); 
    $black = imagecolorallocate($image_p, 0, 0, 0); 
    $white = imagecolorallocate($image_p, 255, 255, 255); 
    $font_size = 14; 
    
    imagestring($image_p, $font_size, 5, 5, $text, $white); 
    imagejpeg($image_p, null, 80); 
    

     

    works :D

  4. i want to use a div tag instead? like this:

     

    http://forums.d2jsp.org/register.php?a=1&i=5e51794914805f1eaf481fcbafdc29f1

     

    if u got here there's no background image, just a css tag applied with a nice blue background borders.

     

    I have that css tag, but this is my code to try to make it a css tag instead of background image.

     

     

     

    session_start();
    
    $RandomStr = md5(microtime());// md5 to generate the random string
    
    $ResultStr = substr($RandomStr,0,5);//trim 5 digit 
    
    $NewImage = imagecreatefromjpeg("img.jpg");//image create by existing image and as back ground 
    
    $LineColor = imagecolorallocate($NewImage,553,539,239);//line color 
    $LineColor = imagecolorallocate($NewImage,223,539,239);//line color 
    $TextColor = imagecolorallocate($NewImage, 255, 255, 255);//text color-white
    
    imageline($NewImage,1,1,40,40,$LineColor);//create line 1 on image 
    imageline($NewImage,1,100,60,0,$LineColor);//create line 2 on image 
    imageline($NewImage,1,500,20,0,$LineColor2);//create line 3 on image 
    imagestring($NewImage, 5, 20, 10, $ResultStr, $TextColor);// Draw a random string horizontally 
    
    $_SESSION['key'] = $ResultStr;// carry the data through session
    
    header("Content-type: image/jpeg");// out out the image 
    
    imagejpeg($NewImage);//Output image to browser 

     

    thx

  5. Let's say I have a full row of data,

     

    and I got a row called "Prayed" and i want a user to click on each row and it will add "Prayed (1)" then if another user, not user just anybody that has a unique section, then it adds Prayed(2) to that specific row colum..

     

     

     

     

    and so on and so forth, so prayed (3) if somone clicks "Pray for this user"

     

    do i add a $_GET thing then mysql run with corresponding id and do $c++ in the query for variable Pray?

  6. Private?: <input type="checkbox" name="private" />

     

    now my php for update is

     

    $private = $_POST['private'];
    
    mysql_query("INSERT INTO `prays` (`title` ,`text` ,`private` ,`time`) VALUES (
    '". mysql_real_escape_string($_POST['title']) ."',
    '". mysql_real_escape_string($_POST['text']) ."',
    '". mysql_real_escape_string($_POST['private']) ."',
    '$time');");

     

     

     

    and im getting:

     

    when it insert to database if somone clicks on the checkbox it still 0

     

    i need it to be value =1 if somone clicks

     

  7.  

    That was no help, unfortunaely google exists.

     

    if (!isset($_SESSION)) {
    03.    session_start();
    04.}
    05.// anti flood protection
    06.if($_SESSION['last_session_request'] > time() - 2){
    07.    // users will be redirected to this page if it makes requests faster than 2 seconds
    08.    header("location: /flood.html");
    09.    exit;
    10.}
    11.$_SESSION['last_session_request'] = time();

     

     

    Should this work?

  8. IM making a prayre site for users to post there pray's..

     

    so I need to beable to stop flooding for each using, using session function or what? Can somone right a quick simple code of ..

     

    if user has post before 30seconds then error: "flood control"

     

    How would i go about doing this.

     

    I dont wan't to add captcha's or anything cause i hate those but i want to be non spammable. beaing able to post submit button every other 30seconds for each user session.

     

    thank u sir

     

     

    EDIT: I got upload script and stuff i mean i know how to do that using the functions just not on flood control $_SESSION each 30second time out if they submit u know

  9. going to be a prayre site..

     

    like pray4 me dot com or whatever, i'll find a name..

     

    but going to have people post pray requests and see what's up

     

    I just need some type of flood control code, i dont want people to type in captcha.. but i also want them toonly beaable to post the upload submit button once every other 30seconds for each user session.,

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.