submit an ajaxForm from a hyperlink
Below you can find the democode for submitting a form from an hyperlink.
-
$(document).ready(function() {
-
$('#addusertorunningform').ajaxForm({
-
target: '#add_user_to_running_status',
-
success: function() {
-
document.getElementById('add_user_to_running_status').style.display = 'block';}
-
});
-
-
$('a#submit_form').click(function() {
-
$("#addusertorunningform").submit();
-
});
-
-
});
-
</form></div>
When you click on the link to # with the id "submit_form" it will use the jQuery framework to the submit form code ($("#addusertorunningform").submit();).
Popularity: 2% [?]
writing a simple ajax call only needs 3 js functions
For getting content from another page you only need 3 functions
- 1 custom function you can call in your code
- 1 for fetching the results from an external php file
- 1 for placing the fetched values in you original code
javascript
JavaScript:
function showDetails(){ xmlHttp=GetXmlHttpObject() if (xmlHttp==null){ alert ("Browser does not support HTTP Request") return } var url="javascript/result/auto.php" url=url+"?q=te" xmlHttp.onreadystatechange=stateChanged xmlHttp.open("GET",url,true) xmlHttp.send(null) }
JavaScript:
function GetXmlHttpObject(handler){ var objXMLHttp=null if (window.XMLHttpRequest){ objXMLHttp=new XMLHttpRequest() }else if (window.ActiveXObject){ objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP") } return objXMLHttp }
JavaScript:
functionstateChanged(){ if (xmlHttp.readyState==4){ if(xmlHttp.status == 200){ document.getElementById("booja").innerHTML=xmlHttp.responseText }else{ alert("Problem with request!"); } } }
html
HTML:
Click<span style="cursor: pointer; color: green" onclick="showDetails()">this</span> to fill the div
The output of this php page "javascript/result/auto.php" will be shown in the "booja" div.
Popularity: 3% [?]
An easy way to find directory’s
Directory's are an easy way to increase your backlinks.
Search google for
inurl:submit.php free title url Description mail name
and you can submit your site all day long.
enjoy
Popularity: 3% [?]
Creating a MySQL db and website backup at once
This little scripts create's a backup of your database and website files at once and puts them on a folder on your webhosting.
PHP:
function backupDB($dbhost,$dbuser,$dbpass,$dbname, $sitename){ } $filename = "$savepath/$date/SQL$sitename-$date.sql"; }
PHP:
function backupWWW($wwwdirectory,$wwwname){ } $filename = "$savepath/$date/WWW$wwwname.tar.gz"; $zipline = "tar -czf $filename $wwwdirectory"; }
PHP:
dbuser => 'username', dbpass => 'pasword', dbname => 'dbname', wwwname => 'webfoldername', wwwdirectory => '/mounted-storage/pathtowebfolder/*' ), dbuser => 'username', dbpass => 'pasword', dbname => 'dbname', wwwname => 'webfoldername', wwwdirectory => '/mounted-storage/pathtowebfolder/*' ) );
PHP:
for ( $row = 0; $row <count($settings); $row++ ) { backupDB($settings[$row]['dbhost'], $settings[$row]['dbuser'], $settings[$row]['dbpass'], $settings[$row]['dbname'], $settings[$row]['wwwname']); backupWWW($settings[$row]['wwwdirectory'], $settings[$row]['wwwname']); "; }
Popularity: 2% [?]
Monitoring MySQL and some offline query tools
For people like me comming from a Microsoft world(MS SQL/Access) these tools are great. I only used phpmyadmin before but it needed something to quicky join tables and alter data in the grid.
After some investigation i found 2 decent free tools:
Popularity: 2% [?]


