This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
end(explode('.', $_SERVER['SERVER_NAME'])) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function titleCase($string) { | |
//reference http://grammar.about.com/od/tz/g/Title-Case.htm | |
// The below array contains the most commonly non-capitalized words in title casing - I'm not so sure about the commented ones that follow it... | |
$minorWords = array('a','an','and','as','at','but','by','for','in','nor','of','on','or','per','the','to','with'); // but, is, if, then, else, when, from, off, out, over, into, | |
// take the input string, trim whitespace from the ends, single out all repeating whitespace | |
$string = preg_replace('/[ ]+/', ' ', trim($string)); | |
// explode string into array of words | |
$pieces = explode(' ', $string); | |
// for each element in array... | |
for($p = 0; $p <= (count($pieces) - 1); $p++){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// submit is an action performed ON THE FORM ITSELF... | |
// probably best to give the form an ID attribute and refer to it by that | |
$('form').submit( function (event) { | |
// prevent the usual form submission behaviour; the "action" attribute of the form | |
event.preventDefault(); | |
// validation goes below... | |
// now for the big event | |
$.ajax({ | |
// the server script you want to send your data to |