Jump to content

tibberous

Members
  • Posts

    1,187
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by tibberous

  1. function easeTo (startingX, startingY, endingX, endingY, frame, framesTotal, ease){

    if(ease > 0) ease = 1 + (ease / 100);

    else if(ease < 0) ease = 1 + (ease / 200);

    else ease = 1;

    currentX = startingX - ( (startingX - endingX) * Math.pow( (frame/framesTotal) , ease) );

    currentY = startingY - ( (startingY - endingY) * Math.pow( (frame/framesTotal) , ease) );

     

    return Array(currentX, currentY);

    }

     

  2.   if(!$_FILES['_image'])

      return "Error encoding file";

     

      $name = explode('.', $_FILES["_image"]["name"]);

      $ext = $name[count($name)-1];

     

      $ext = strtolower($ext);

     

      if($ext == "jpeg")

      $ext == "jpg";

     

      if($ext != "jpg" && $ext != "png" && $ext != "gif")

      return "Invalid filetype.";

     

  3. Here, I'll help:

     

    function ease (startingX, startingY, endingX, endingY, frame, framesTotal, ease){

    currentX = startingX - ( (startingX - endingX) * (frame/framesTotal) );

    currentY = startingY - ( (startingY - endingY) * (frame/framesTotal) );

     

    return Array(currentX, currentY);

    }

     

    That works so long as ease is 0. Can someone tell me how to add easing?

  4. Here is the header.

     

    function ease (startingX, startingY, endingX, endingY, frame, framesTotal, ease){

     

    return Array(currentX, currentY);

    }

     

    Basically it takes 2 sets of points, the starting location of an object and the ending location. It returns the location the object would be at at frame, provided there are framesTotal total frames. Ease simulates easing in or out, causing the object to move slower at the beginning or the end of the function.

     

    Anyone know how to write this? I used to know but I forget.

  5. He might have magic quotes on his server. If you do that and he does have magic quotes you'll screw up the data.

     

    if(!get_magic_quotes_gpc()){

     

      foreach($_POST as $key => $value){

      if(gettype($value) == "array")

        foreach($value as $k => $v){

        $varvar = $k;

        $$varvar = $v;

        }

     

      $varvar = $key;

      $$varvar = addslashes($value);

      }

     

    }

     

    That code will fix you. Make sure you do it for _GET too, or just turn magic quotes on. I can't stand to program without magic quotes, or with register globals off, so I have a page that emulates turning them on. It also connects to the database. If your going to write a lot of code I'd recommend getting one of these, otherwise you'll have to type a lot of useless shit over and over.

  6. I am trying to use absolute positioning to lay Flash over an existing site. IE does it right, Flash displays it right but doesn't give me the event area I should have (ie: I can't click part of my ad). Right now I am using an absolutely positioned div with the embed / object inside it. I tried setting the z-index.

     

    Thanks

  7. Here it is written using eval.

     

    <?php
    
    $test1 = "=)";
    $test2 = "";
    $test3 = "";
    $test4 = ":|";
    $test5 = ":/";
    
    if( ($face = intval($face)) >= 1 && ($face = intval($face)) <= 5){
      
      eval("\$x = \$test$face;");
      
      $myvalue = $x;
      
      echo "<div><b>$myvalue</b></div>";
    }
    
    ?><form action="<?php echo $PHP_SELF; ?>" method="get">
    <div>Enter 1-5 <input type="text" name="face"></div>
    <div><input type="submit" value="Get my Face!"></div>
    </form>

  8. <?php
    
    $test1 = "=)";
    $test2 = "";
    $test3 = "";
    $test4 = ":|";
    $test5 = ":/";
    
    if( ($face = intval($face)) >= 1 && ($face = intval($face)) <= 5){
      
      $myvar = "test$face";
      
      $myvalue = $$myvar;
      
      echo "<div><b>$myvalue</b></div>";
    }
    
    ?><form action="<?php echo $PHP_SELF; ?>" method="get">
    <div>Enter 1-5 <input type="text" name="face"></div>
    <div><input type="submit" value="Get my Face!"></div>
    </form>

×
×
  • 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.