Interesting links
- This is a pastebin like place where I put stuff I find useful
- A simple email form with drupal 5,6,7: http://drupal.org/node/197122
- 2 step registration
- 2 step registration with jquery http://www.9lessons.info/2011/01/gravity-registration-form-with-jquery.html
- another 2 step registration where details come up http://webexpedition18.com/articles/how-to-create-a-multi-step-signup-form-with-css3-and-jquery/
- twitter like login http://aext.net/example/twitterlogin/#
- simple server side jquery post without refresh http://www.askaboutphp.com/213/php-and-jquery-submit-a-form-without-refreshing-the-page.html
Refreshing a div from with fade in:
- php fadein after post insert: http://stackoverflow.com/questions/3471935/php-jquery-fadein-refresh-after-insert
- fade in a div from php: http://forums.phpfreaks.com/index.php?topic=316557.0
- snippet1 from http://php.bigresource.com/jQuery-Auto-Refresh-Only-Fade-In-New-Rows-in-Database-Since-Last-Refresh--7aSmBLI2H.html
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 referrerif($referrer=="") // if not given use this script as referrer$referrer=$_SERVER["SCRIPT_URI"];// making string from $dataforeach($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;}