-

Interesting links

  • This is a pastebin like place where I put stuff I find useful

 

Refreshing a div from with fade in:

Code: [Select]<script type="text/javascript">
$(document).ready(function() {
$("#responsecontainer").fadeOut("fast").load("getrows.php").fadeIn("slow");
var refreshId = setInterval(function() {
$("#responsecontainer").fadeOut("fast").load('getrows.php').fadeIn("slow");
}, 5000);
$.ajaxSetup({ cache: false });

[Code]...

  • snippet 2:

Posting to a form from php

  • posting to a form from php http://www.html-form-guide.com/php-form/php-form-submit.html
  • I also have this code i used before successfully:
  • //$output2=HTTP_Post("http://www.server2.com/script2.php",$_POST);
     
          function HTTP_Post($URL,$data, $referrer="") {
    $request="";
    $result="";
            // parsing the given URL
            $URL_Info=parse_url($URL);
     
            // Building referrer
            if($referrer=="") // if not given use this script as referrer
              $referrer=$_SERVER["SCRIPT_URI"];
     
            // making string from $data 
            foreach($data as $key=>$value)
            {
     $values[]="$key=".urlencode($value);
    //   print "$key :: $value ";
            }
    $data_string=implode("&",$values);
          
            // Find out which port is needed - if not given use standard (=80)
            if(!isset($URL_Info["port"]))
              $URL_Info["port"]=80;
      
            // building POST-request:
            $request.="POST ".$URL_Info["path"]." HTTP/1.1 ";
            $request.="Host: ".$URL_Info["host"]." ";
            $request.="Referer: $referrer ";
    $request.="Accept-language: en Cookie: ". "ASPSESSIONIDQATBADCS=HINAJNDBFJMLOJFHPLHPCDOE"." " .
       "User-Agent: Mozilla 4.0 " . 
             "Content-type: application/x-www-form-urlencoded " . 
             "Content-length: ".strlen($data_string)." ";
            $request.="Connection: close ";
            $request.=" ";
            $request.=$data_string." ";
     
     
            $fp = fsockopen($URL_Info["host"],$URL_Info["port"]);
            fputs($fp, $request);
            while(!feof($fp)) {
                $result .= fgets($fp, 128);
            }
            fclose($fp);
     
            return $result;
          }