This file contains hidden or 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
<?php | |
function imageRestrict($image, $maxwidth, $maxheight) { | |
list($width,$height) = getimagesize($image); | |
if ($width > $maxwidth) { | |
$newheight = $maxwidth/$width * $height; | |
if($newheight > $maxheight){ |
This file contains hidden or 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
<?php | |
function send_mail($from, $from_name, $to, $to_name, $subject, $body, $attachment="") | |
{ | |
include_once("phpmailer.class.php"); | |
$mail = new PHPMailer(); | |
$mail->From = $from; | |
$mail->FromName = $from_name; | |
$mail->Subject = $subject; | |
$search = array( |
This file contains hidden or 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
<p><a href="#"><img class="size-thumbnail wp-image-58 alignright" alt="" src="http://lorempixel.com/g/500/300/people/1/"></a>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Curabitur quam augue, vehicula quis, tincidunt vel, varius vitae, nulla. Sed convallis orci. Duis libero orci, pretium a, <a href="#">convallis quis</a>, pellentesque a, dolor. Curabitur vitae nisi non dolor vestibulum consequat.</p> | |
<blockquote> | |
<p>Proin vestibulum. Ut ligula. Nullam sed dolor id odio volutpat pulvinar. Integer a leo. In et eros at neque pretium sagittis. Sed sodales lorem a ipsum suscipit gravida. Ut fringilla placerat arcu. Phasellus imperdiet. Mauris ac justo et turpis pharetra vulputate.</p> | |
</blockquote> | |
<p><cite><a href="#">Quote Source</a></cite></p> | |
<h1>Level 1 Heading</h1> | |
<h2>Level 2 Heading</h2> | |
<h3>Level 3 Heading</h3> | |
<h4>Level 4 Heading</h4> | |
<h5>Level 5 Heading</h5> |
This file contains hidden or 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
<?xml version="1.0" encoding="UTF-8"?> | |
<!-- This is a WordPress eXtended RSS file generated by WordPress as an export of your blog. --> | |
<!-- It contains information about your blog's posts, comments, and categories. --> | |
<!-- You may use this file to transfer that content from one site to another. --> | |
<!-- This file is not intended to serve as a complete backup of your blog. --> | |
<!-- To import this information into a WordPress blog follow these steps. --> | |
<!-- 1. Log into that blog as an administrator. --> | |
<!-- 2. Go to Manage: Import in the blog's admin panels. --> | |
<!-- 3. Choose "WordPress" from the list. --> |
This file contains hidden or 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 isValidCreditCard(type, ccnum) { | |
if (type == "Visa") { | |
// Visa: length 16, prefix 4, dashes optional. | |
var re = /^4\d{3}-?\d{4}-?\d{4}-?\d{4}$/; | |
} else if (type == "MC") { | |
// Mastercard: length 16, prefix 51-55, dashes optional. | |
var re = /^5[1-5]\d{2}-?\d{4}-?\d{4}-?\d{4}$/; | |
} else if (type == "Disc") { | |
// Discover: length 16, prefix 6011, dashes optional. | |
var re = /^6011-?\d{4}-?\d{4}-?\d{4}$/; |
This file contains hidden or 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
$.ajax({ | |
type: "POST", | |
url: "submit_ops.php?action=submit_form", | |
data: $( "#frmMyForm" ).serialize(), | |
success: function(result){ | |
if(result=='Success'){ | |
$("#msgContainer").html('<div style="color:#3CA322;font-weight:bold;font-size:14px;padding:10px;">Thank you.</div>'); | |
$("#msgContainer").fadeIn(); | |
} | |
else{ |
This file contains hidden or 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
JS Code | |
------------------ | |
$.ajax({ | |
type: "POST", | |
url: targetURL, | |
async: false, | |
data: JSON.stringify($('#form').serializeArray()), | |
success: function(data){ | |
console.log(data); |
This file contains hidden or 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
DELETE FROM table1 | |
USING table1, table1 AS vtable | |
WHERE ( | |
table1.ID > vtable.ID | |
) | |
AND ( | |
table1.field1 = vtable.field1 | |
) | |
AND ( | |
table1.field2 = vtable.field2 |
This file contains hidden or 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 blink(selector){ | |
$(selector).fadeOut('slow', function(){ | |
$(this).fadeIn('slow', function(){ | |
blink(this); | |
}); | |
}); | |
} | |
$(document).ready(function(){ | |
blink('.blink'); |
This file contains hidden or 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
<?php | |
function generateCsv($data, $delimiter = ',', $enclosure = '"') { | |
$handle = fopen('php://temp', 'r+'); | |
foreach ($data as $line) { | |
fputcsv($handle, $line, $delimiter, $enclosure); | |
} | |
rewind($handle); | |
while (!feof($handle)) { | |
$contents .= fread($handle, 8192); | |
} |
OlderNewer