Skip to content

Instantly share code, notes, and snippets.

View abdullahbutt's full-sized avatar

Abdullah Butt abdullahbutt

  • Petersberg, Deutschland
View GitHub Profile
@abdullahbutt
abdullahbutt / hot_linking_html
Created November 22, 2013 15:42
hot linking in html
hot linking means that we give link of an image from another website which is a bad practice as owner of that saite has to pay for the bandwidth ur site linked image is showing.
e.g
<img src="https://www.google.com/images/logos/google_logo_41.png">Google Logo</img>
@abdullahbutt
abdullahbutt / date
Created December 2, 2013 13:10
date in php
<!DOCTYPE html>
<html>
<head>
<title>PHP Important Date Functions</title>
</head>
<body>
<p>For PHP Date Functions, visit <a href="http://www.w3schools.com/php/php_ref_date.asp">W3schools PHP 5 Date/Time Functions</a></p>
<p>For PHP Calendar Functions, visit <a href="http://www.w3schools.com/php/php_ref_calendar.asp">W3schools PHP 5 Calendar Functions</a></p>
<?php
@abdullahbutt
abdullahbutt / preg_match
Created December 3, 2013 11:47
preg_match() in PHP
<!Doctype html>
<html>
<head>
<title>preg_match() in PHP<title>
</head>
<body>
<!--
The preg_match() function searches a string for pattern, returning true if the pattern exists, and false otherwise.
PHP - Validate Name
@abdullahbutt
abdullahbutt / 1_form_validation_complete.php
Last active June 19, 2023 08:03
form validation in php
<!DOCTYPE HTML>
<html>
<head>
<style>
.error {color: #FF0000;}
</style>
<title>Complete Form Validation</title>
</head>
<body>
<p>Form Validation in PHP</p>
@abdullahbutt
abdullahbutt / file_upload.php
Created December 3, 2013 15:52
file upload in php
<!DOCTYPE html>
<html>
<head>
<title>File Upload</title>
</head>
<body>
<!--
--------------------------------------------------------------------------------------------------------
To allow users to upload files from a form can be very useful.
Look at the following HTML form for uploading files:
@abdullahbutt
abdullahbutt / mail.php
Last active December 30, 2015 05:59
mail() function in php
<?php
/*
Definition and Usage
The mail() function allows you to send emails directly from a script.
This function returns TRUE if the email was successfully accepted for delivery, otherwise it returns FALSE.
Syntax
mail(to,subject,message,headers,parameters)
@abdullahbutt
abdullahbutt / mail_secure.php
Last active December 30, 2015 06:09
how to make mail() secure in php
<?php
/*
-------------------------------------------------
PHP E-mail Injections
-------------------------------------------------
First, look at the PHP code from the previous chapter:
*/
?>
<html>
<body>
@abdullahbutt
abdullahbutt / filter.php
Created December 5, 2013 10:06
filter in php
For Details on PHP Filter Functions, visit:
http://www.w3schools.com/php/php_ref_filter.asp
&
http://www.w3schools.com/php/php_filter.asp
PHP Filter Introduction
This PHP filters is used to validate and filter data coming from insecure sources, like user input.
PHP Filter Functions
@abdullahbutt
abdullahbutt / class.php
Created December 7, 2013 11:08
class in php
<?php
/**
* myClass
*@author: Abdullah Butt
*@param:
*/
class myClass
{
@abdullahbutt
abdullahbutt / get_defined_vars
Created January 28, 2014 14:17
get variables in php get_defined_vars()
<?php
$variables=get_defined_vars();
foreach($variables as $keys=>$val)
{
echo "$".$keys."=null;"."<br/>";
}
/*
Since get_defined_vars() only gets the variables at the point you call the function, there is a simple way to get the variables defined within the current scope.
*/