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
<?php | |
/** | |
* @param null $host | |
* @param null $port | |
* @param null $timeout | |
* @return bool|string | |
*/ | |
function PingToServer($host=null, $port=null, $timeout=null) | |
{ | |
if(empty($host) || empty($port) || empty($timeout)){ |
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
<?php | |
function TestPath() | |
{ | |
return __DIR__.DIRECTORY_SEPARATOR."somefile.php"; | |
} | |
var_dump(TestPath()); | |
/* | |
* it will return something like string 'C:\xampp\htdocs\LibComponent\Multimedia\somefile.php' (length=58) | |
* In this case DIRECTORY_SEPERATOR constant is "\" if I want to require somefile.php then this type of path will not work | |
* but to make it work I need C:/xampp/htdocs/LibComponent/Multimedia/somefile.php |
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
<?php | |
$username="username"; | |
$password="password"; | |
$url="https://vp1-voiceportal.megapath.com/Login/servlet/com.broadsoft.clients.oam.servlets.Login"; | |
$cookie="cookie.txt"; | |
$postdata = "EnteredUserID=".$username."&password=".$password."&domain=&UserID=&rememberPass="; | |
$ch = curl_init(); | |
curl_setopt ($ch, CURLOPT_URL, $url); |
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
<?php | |
/** | |
* @Author Shaharia Azam | |
* @Author URL http://www.shahariaazam.com | |
* | |
* @Description this function will make a .zip folder by adding multiple files. | |
* @link http://php.net/manual/en/book.zip.php | |
* | |
* @param array $SourceFiles | |
* @param string $ZipDestination |
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
<?php | |
$stmt = $pdo->prepare("SELECT ItemSales.date, | |
ItemSales.price, | |
ItemSales.price * ItemSales.quantity as earnings | |
FROM ItemSales as sales,Items | |
WHERE ItemSales.itemId = Items.id | |
AND Items.id = :Items_id"); // Note: :Items.id change to :Items_id | |
$stmt->bindParam(':Items_id', $id); // Note: 'Items.id' change to ':Items_id' |
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
<?php | |
//For Database query | |
$q = $_GET["q"]; | |
$sql = "select * from user where 'username' ="$q; | |
$query = mysql_query ($sql); | |
if ($q === 1) { | |
echo "Yes"; | |
} else { | |
echo "No"; |
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
// Scraping Made Easy with jQuery and SelectorGadget | |
// (http://blog.dtrejo.com/scraping-made-easy-with-jquery-and-selectorga) | |
// by David Trejo | |
// | |
// Install node.js and npm: | |
// http://joyeur.com/2010/12/10/installing-node-and-npm/ | |
// Then run | |
// npm install jsdom jquery http-agent | |
// node numresults.js | |
// |
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
<?php | |
$curl = curl_init(); | |
$url = "http://search.asu.com/admintool/listingsTest_ASU.php"; | |
//$url ="http://search.asu.com/_data/airports.php"; | |
curl_setopt($curl, CURLOPT_URL, $url); | |
curl_setopt($curl, CURLOPT_POSTFIELDS,null); | |
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true); // follow redirects | |
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); |
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
@font-face { | |
font-family: 'Port Lligat Slab'; | |
font-style: normal; | |
font-weight: 400; | |
src: url(data:font/opentype;charset=utf-8;base64,d09GRgABAAAAAD00AA4AAAAAepQAAQABAAAAAAAAAAAAAAAAAAAAAAAAAABGRlRNAAABRAAAABsAAAAcYA1EIU9TLzIAAAFgAAAAUAAAAGCkS3u1Y21hcAAAAbAAAAF0AAABugd1VkZnYXNwAAADJAAAAAgAAAAIAAAAEGdseWYAAAMsAAAv7QAAZoQiL/V1aGVhZAAAMxwAAAA0AAAANvh1GcdoaGVhAAAzUAAAAB8AAAAkBjEDv2htdHgAADNwAAACCgAAA0iRICeTa2VybgAANXwAAAFiAAACXhxPGMtsb2NhAAA24AAAAaYAAAGmGJf+sm1heHAAADiIAAAAHgAAACABGQBhbmFtZQAAOKgAAAMvAAAHRI37YPJwb3N0AAA72AAAAVMAAAHLpBShdnByZXAAAD0sAAAABwAAAAdoBoyFeJxjYGBgZACCk535hiD6tOMrFij9GgBBaAbPAHicY2Bi7GOcwMDKwMC0h6mLgYGhB0Iz3mUwYvgFFGWAgQYGhvUODAreMH5BZVExA1BAYQ1zzH9dBgbmGIbLCkCNYMlOhmQgqcDACAD+sA8TeJxjYGBgZoBgGQZGBhDYAuQxgvksDDOAtBKDApDFxFDHsJhhDcN/RkPGYKZjTLeY7iiIKEgpyCkoKVgpuCis+f8fqFaBYSHDUoZ1QDVBUDXCChIKMkA1lhA1/x//P/j/wP/9//v+5/398/fl3xcPNj1Y/2Ddg9UPpj7oeaAKdQMBwMjGAFfIyAQkmNAVAL3EwsrGzsHJxc3Dy8cvICgkLCIqJi4hKSUtIysnr6CopKyiqqauoamlraOrp29gaGRsYmpmbmFpZW1ja2fv4Ojk7OLq5u7h6eXt4+vnHxAYFBw |
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
<?php | |
echo "Thanks"; |
OlderNewer