Thursday, June 30, 2016

Google PageRank PHP Script An Easy To Use And Working! PHP Script To Find Google PageRank Of Any Website

A very simple and powerful PageRank (Google PageRank) finder for any website. Just submit the website URL one at a time and get the page rank. Script is using Google toolbar to get the PageRank. 
Google PageRank PHP script works for both Bloggers and Webmasters. This script directly communicates with the Google toolbar.So it always is advisable not to make too many request at the same time from the same IP.

Instructions

Download "Download Free PHP pagerank script" and extract it using winzip or other similar program.

Include google-pagerank.php in your PHP which is going to display the pagerank for a website.

<?PHP include_once "google-pagerank.php"; ?> 

In the next line,

<?PHP
$url = "http://google.com";
$width = "200";
$method = "css"; //image or css or default
$image_location = "images/"; //including the slash (/)
$obj = new pr($url,$method,$width,$image_location);
?>

Thats it. Now all we have to do is, display the pagerank in the desired position of your webiste.

<p><PHP echo $obj->pagerank(); ?></p> 

If you are using "css" or "default", you have to use the above method to display the pagerank image."images" method requires the following line of code.

<p><img src="filename.php" /></p> 
filename.php should contain

<? include_once("google-pagerank.php");
$url = "http://www.google.com;
$width = "";
$method = "image"; //image
$image_location = "images/"; //including the slash (/)
$obj = new pr($url,$method,$width,$image_location);
echo $obj->pagerank();
?>
Instruction For Bloggers:

Bloggers cant use PHP code in blogs. so to display pagerank in your blog use the following code.

<p><a href=""><img src="http://www.agrizlive.com/
demo/google-pagerank-script/blogger.php?
url=http://www.google.com" /></a></p>

 Make sure you replace the blue color http://www.google.com to your blogger URL.

Download Google PageRank PHP Script


Email Validation PHP Script

This class allows the developer to validate e-mail addresses according to RFC 5321, RFC 5322, or custom requirements. It can also check to see if the domain can be resolved to MX RRs. If validating according to the more expansive RFC 5322, e-mail addresses may contain one of a dot-atom, a quoted string, or an obsolete local-part, either a domain name or a domain literal (IPv4, IPv6, or IPv4-mapped IPv6 address) domain, and nested CFWS (comments and folding white spaces).


Download Email Validation PHP Script

Yahoo Status Checker

This class is made by Davood Jafari and can be used to check the online status of a Yahoo messenger user.

It can access the Yahoo online services Web server and send a request to retrieve the online status of a given Yahoo messenger user.


The package can be downloaded here (1 kb).

Inside the package are:
Check.Class.php -- Class Class Core
index.php -- Example Sample File

License: GNU General Public License (GPL)

IT Discussion in a Milist Script PHP for Blocking IP Addresses

Greetings,

I want to ask, whether or not if we develop or use a simple web (e.g. Joomla, etc) then  we could setup some specific public IP addresses to not access our website?
If getting traced or ping-ed it seems to be normal.

If someone could help,  I greatly thank you.


regards
-------------------------------------------------



It could, set it from its CPanel web / domain


regards
----------------------------------------------

OK thanks for your info ... but if getting traced or ping-ed it seems to be normal, so only  when getting accessed from a browser it couldnt be accessed.
However if we access using another connection then I think whether my public IP is getting blocked?

regards
-------------------------------------------

The most frequent occurrence as such is from speedy, probably because the user is speedy (with a specific IP address range) that send a lot of spam so that the IP address ranges included in the list of spam house, consequently if we want to access a particular web address using a speedy connection, then access will be blocked, whereas if you use the internet connection instead of speedy, the internet access runs normally.
The way that can be normal again, ask for a speedy person to realease your IP address or change the IP address.

regards
----------------------------------

if using php, write a simple script, for example in index.php
put it on top, for example

$ banned_ips = array (x.x.x.x, y.y.y.y, z.z.z.z);

if (in_array ($ _ SERVER [REMOTE_ADDR], $ banned_ips)) {
                 die ();
                  }
?>

where xxxx - zzzz, is the list of IP addresses that we will be ban

hopefully helpful

regards

Wednesday, June 29, 2016

How to Code Your Own CAPTCHA Script In PHP

Today I will show you how to code your own CAPTCHA Script.
<?php
session_start();
$strlength = rand(4,7);

for($i=1;$i<=$strlength;$i++)
{
$textornumber = rand(1,3);
if($textornumber == 1)
{
$captchastr .= chr(rand(49,57));
}
if($textornumber == 2)
{
$captchastr .= chr(rand(65,78));
}
if($textornumber == 3)
{
$captchastr .= chr(rand(80,90));
}
}
$randcolR = rand(100,230);
$randcolG = rand(100,230);
$randcolB = rand(100,230);

/initialize image $captcha is handle dimensions 200,50
$captcha = imageCreate(200,50);
$backcolor = imageColorAllocate($captcha, $randcolR, $randcolG, $randcolB);

$txtcolor = imageColorAllocate($captcha, ($randcolR - 20), ($randcolG - 20), ($randcolB - 20));
for($i=1;$i<=$strlength;$i++)
{

$clockorcounter = rand(1,2);
if ($clockorcounter == 1)
{
$rotangle = rand(0,45);
}
if ($clockorcounter == 2)
{
$rotangle = rand(315,360);
}

//$i*25 spaces the characters 25 pixels apart
imagettftext($captcha,rand(14,20),$rotangle,($i*25),30,$txtcolor,"/arial.ttf",substr($captchastr,($i-1),1));
}
for($i=1; $i<=4;$i++)
{
imageellipse($captcha,rand(1,200),rand(1,50),rand(50,100),rand(12,25),$txtcolor);
}
for($i=1; $i<=4;$i++)
{
imageellipse($captcha,rand(1,200),rand(1,50),rand(50,100),rand(12,25),$backcolor);
}
//Send the headers (at last possible time)
header(Content-type: image/png);

//Output the image as a PNG
imagePNG($captcha);

//Delete the image from memory
imageDestroy($captcha);

$_SESSION[captchastr] = $captchastr;

?>
If you like this script then feel free to Subscribe to our blog and we will email you similar interesting and useful PHP scripts in your Inbox as soon as it is published on our blog.

Enjoy!


PHP File Append

So far we have learned how to open, close, read, and write to a file. However, the ways in which we have written to a file so far have caused the data that was stored in the file to be deleted. If you want to append to a file, that is, add on to the existing data, then you need to open the file in append mode.

PHP - File Open: Append

If we want to add on to a file we need to open it up in append mode. The code below does just that.

PHP Code:

$myFile = "testFile.txt";
$fh = fopen($myFile, a);

If we were to write to the file it would begin writing data at the end of the file.

PHP - File Write: Appending Data

Using the testFile.txt file we created in the File Write lesson , we are going to append on some more data.

PHP Code:

$myFile = "testFile.txt";
$fh = fopen($myFile, a) or die("cant open file");
$stringData = "New Stuff 1 ";
fwrite($fh, $stringData);
$stringData = "New Stuff 2 ";
fwrite($fh, $stringData);
fclose($fh);

You should noticed that the way we write data to the file is exactly the same as in the Write lesson. The only thing that is different is that the file pointer is placed at the end of the file in append mode, so all data is added to the end of the file.

The contents of the file testFile.txt would now look like this:

Contents of the testFile.txt File:

Floppy Jalopy
Pointy Pinto
New Stuff 1
New Stuff 2

PHP - Append: Why Use It?

The above example may not seem very useful, but appending data onto a file is actually used everyday. Almost all web servers have a log of some sort. These various logs keep track of all kinds of information, such as: errors, visitors, and even files that are installed on the machine.
A log is basically used to document events that occur over a period of time, rather than all at once. Logs: a perfect use for append!

PHP File Upload

A very useful aspect of PHP is its ability to manage file uploads to your server. Allowing users to upload a file to your server opens a whole can of worms, so please be careful when enabling file uploads.

PHP - File Upload: HTML Form

Before you can use PHP to manage your uploads, you must first build an HTML form that lets users select a file to upload. See our HTML Form lesson for a more in-depth look at forms.

HTML Code:

<form enctype="multipart/form-data" action="uploader.php" method="POST">
<input type="hidden" name="MAX_FILE_SIZE" value="100000" />
Choose a file to upload: <input name="uploadedfile" type="file" /><br />
<input type="submit" value="Upload File" />
</form>

Here is a brief description of the important parts of the above code:

  • enctype="multipart/form-data" - Necessary for our to-be-created PHP file to function properly.
  • action="uploader.php" - The name of our PHP page that will be created, shortly.
  • method="POST" - Informs the browser that we want to send information to the server using POST.
  • input type="hidden" name="MA... - Sets the maximum allowable file size, in bytes, that can be uploaded. This safety mechanism is easily bypassed and we will show a solid backup solution in PHP. We have set the max file size to 100KB in this example.
  • input name="uploadedfile" - uploadedfile is how we will access the file in our PHP script.

Save that form code into a file and call it upload.html. If you view it in a browser it should look like this:

Display:



Choose a file to upload:



After the user clicks submit, the data will be posted to the server and the user will be redirected to uploader.php. This PHP file is going to process the form data and do all the work.

PHP - File Upload: Whats the PHP Going to Do?

Now that we have the right HTML form we can begin to code the PHP script that is going to handle our uploads. Typically, the PHP file should make a key decision with all uploads: keep the file or throw it away. A file might be thrown away from many reasons, including:

  • The file is too large and you do not want to have it on your server.
  • You wanted the person to upload a picture and they uploaded something else, like an executable file (.exe).
  • There were problems uploading the file and so you cant keep it.
This example is very simple and omits the code that would add such functionality.

PHP - File Upload: uploader.php

When the uploader.php file is executed, the uploaded file exists in a temporary storage area on the server. If the file is not moved to a different location it will be destroyed! To save our precious file we are going to need to make use of the $_FILES associative array.

The $_FILES array is where PHP stores all the information about files. There are two elements of this array that we will need to understand for this example.

  • uploadedfile - uploadedfile is the reference we assigned in our HTML form. We will need this to tell the $_FILES array which file we want to play around with.
  • $_FILES[uploadedfile][name] - name contains the original path of the user uploaded file.
  • $_FILES[uploadedfile][tmp_name] - tmp_name contains the path to the temporary file that resides on the server. The file should exist on the server in a temporary directory with a temporary name.
Now we can finally start to write a basic PHP upload manager script! Here is how we would get the temporary file name, choose a permanent name, and choose a place to store the file.

PHP Code:

// Where the file is going to be placed
$target_path = "uploads/";
/* Add the original filename to our target path.
Result is "uploads/filename.extension" */
$target_path = $target_path . basename( $_FILES[uploadedfile][name]);
$_FILES[uploadedfile][tmp_name];

NOTE: You will need to create a new directory in the directory where uploader.php resides, called "uploads", as we are going to be saving files there.

We now have all we need to successfully save our file to the server. $target_path contains the path where we want to save our file to.

PHP - File Upload: move_uploaded_file Function

Now all we have to do is call the move_uploaded_file function and let PHP do its magic. The move_uploaded_file function needs to know 1) The path of the temporary file (check!) 2) The path where it is to be moved to (check!).

PHP Code:

$target_path = "uploads/";
$target_path = $target_path . basename( $_FILES[uploadedfile][name]);
if(move_uploaded_file($_FILES[uploadedfile][tmp_name], $target_path)) {
echo "The file ". basename( $_FILES[uploadedfile][name]).
" has been uploaded";
} else{
echo "There was an error uploading the file, please try again!";
}

If the upload is successful, then you will see the text "The file filename has been uploaded". This is because $move_uploaded_file returns true if the file was moved, and false if it had a problem.
If there was a problem then the error message "There was an error uploading the file, please try again!" would be displayed.

PHP - File Upload: Safe Practices!

Note: This script is for education purposes only. We do not recommend placing this on a web page viewable to the public.

These few lines of code we have given you will allow anyone to upload data to your server. Because of this, we recommend that you do not have such a simple file uploader available to the general public. Otherwise, you might find that your server is filled with junk or that your servers security has been compromised.

We hope you enjoyed learning about how to work with uploading files with PHP. In the near future we will be adding an advanced lesson that will include more security and additional features!



How To Get Current URL Without Page Name In PHP

Today I will share a code snippet which will help you get a current URL Without Page Name.

<?PHP

function getPath() {
$protocol = strpos(strtolower($_SERVER[SERVER_PROTOCOL]),https) === FALSE ? http : https;
$host = $_SERVER[HTTP_HOST];
$path = substr($_SERVER[SCRIPT_NAME], 0, -strlen(basename($_SERVER[SCRIPT_NAME])));

return $protocol.://.$host.$path;
}

echo getPath();

?>

This simple piece of code will do the trick.

If you want more such tips and tricks related to PHP then consider subscribing to our blog.

Enjoy!


Extract Proper Noun Script In PHP

This class can extract proper nouns from texts. It takes a text string and can detect which words may be proper nouns of people, entities, etc.. It uses some heuristics like the capitalization of the first word letter, the presence of people title preceeding the nouns, etc.. The class may consider consecutive proper names as a single proper name. The class assumes English by default but may be configure to work with other idioms.


Download Proper Noun Script In PHP

Tuesday, June 28, 2016

Email Extractor PHP Script Extract Email From Text And URL

PHP Email Extractor serves to extract emails either from provided text or from URL. All found emails will be output below the input form, one email per row.

Download Email Extractor PHP Script

Coordino A Free Stack Overflow Clone In PHP

Coordino allows you to create a question and answer system(much like that of stack overflow) for you and your users to enjoy.

Whether you are looking to create a niche question and answer site for comic book collecting or looking for a knowledge base solution for your intranet, Coordino is here for you.
Get Started Today!

  • Using Coordino you can utilize the community in your industry by combining their knowledge on your website. Over time your knowledge base can serve as a focal point for your niche or company. 
  • Keep your knowledge base secured on your system in your location. You have full control of the security of your users and your data.
  • Why have yourself or anyone else reinvent the wheel? By utilizing a question and answer based system you can reduce roadblocks by having the answers right at hand.

Features & Benefits:
  •     A Knowledge Platform
  •     User Rewards
  •     Tagging
  •     Site Administration
  •     Total Control
  •     Remote Authentication
  •     Source Code
  •     Selfhosted Solution
Download Coordino -FREE Stack Overflow Clone Script

CRUD Operations using PHP OOP and MySQL

CRUD Operations Using PHP and MySQL with OOP Concepts , Object Oriented PHP is More efficient than simple and core , its being used in many more MVC(model , view , controller) pattern based PHP frameworks Because we can create one class for all such operations and it's provide reusability of any class and created function , So have a look .

CRUD Operations using PHP OOP and MySQL
Read more »

Generating RTF Files cont

Instead of using RTFGen, we may also use another class namely rtfgenerator in which we can download from phpclasses.org or you can download it here (5kb)!!

After downloading, extract to your folder inside your web server and execute the index.html file and then write your sentences in the textarea provided and press the generate rtf button. That simple.

Badnazri Aur Ishq e Mijazi Ki Tabah Kariyan

Badnazri Aur Ishq e Mijazi Ki Tabah Kariyan

Badnazri urdu pdf book
Badnazri Aur Ishq e Mijazi Ki Tabah Kariyan related to Islamic Rules PDF book . It will Guide Gazing to another young girls is so bad and its disadvantages. 



Monday, June 27, 2016

Makeup Beautician Training Course in Urdu Free

Makeup Beautician Training Course in Urdu

Makeup Beautician Training Course book for u
Hey How are you man? today i am posting a makeup course in Urdu specially for Pakistani Females. Many female searching these types of books on the net but they do not success in their aims. In Urdu PDF Book is ready for download .


PHP Script Creating Image From Text

CF TextImage Class is a small but useful php script that can generates a image from a string of text using a True Type Font (ttf). This script has some simple uses such as a replacement for Javascript cufon library when Javascript is not available, a replacement for Flash based text or displaying a email address that cannot be programmatically found. This can help to reduce the possibility of your email address being picked up by web crawlers and used for junk mail.

Download Image From Text PHP Script

Upload Form PHP Script A PHP Script Which Will Enable You To Upload Files On Your Site

A very simple php script.Simple file upload form for your site.

Features:
  • Limit file types available for upload
  • Maximum file size validation
  • Can rename file after upload to avoid URL guessing
  • Log of uploads can be saved in MySql database. Log includes Filename, file size, IP of the user, date of upload
 Download Upload Form PHP Script

Email Errors To Yourself Instead Of Showing It Publicly

Most servers are set to display an error message when an error occurred in one of your script. But, you may also want to get an email containing the error, instead of displaying it to the public.

The Script is given below:

<?php

// Our custom error handler
function nettuts_error_handler($number, $message, $file, $line, $vars){
$email = "
<p>An error ($number) occurred on line
<strong>$line</strong> and in the <strong>file: $file.</strong>
<p> $message </p>";

$email .= "<pre>" . print_r($vars, 1) . "</pre>";

$headers = Content-type: text/html; charset=iso-8859-1 . " ";

// Email the error to someone...
error_log($email, 1, you@youremail.com, $headers);

// Make sure that you decide how to respond to errors (on the users side)
// Either echo an error message, or kill the entire project. Up to you...
// The code below ensures that we only "die" if the error was more than
// just a NOTICE.
if ( ($number !== E_NOTICE) && ($number < 2048) ) {
die("There was an error. Please try again later.");
}
}

// We should use our custom function to handle errors.
set_error_handler(nettuts_error_handler);

// Trigger an error... (var doesnt exist)
echo $somevarthatdoesnotexist;
 
Hope You Enjoyed Reading this Post.

Search Engine Submission PHP Script Use this Script to Submit a Website to 130 Search Engines

URL Submit Script is PHP script which allows users to submit website to over 130 Search Engines at one go, no waste of your time as just in one click your site will be listed in the most important Search Engines.
You can also use this PHP Script to offer a service to all the visitors on your Site/Blog.

Installations:

  • unzip all files in a folder!
  • send all files from your server

Features:

  • Install in 1 minute
  • Offer service for your visitors
  • Language file ( easy to translate )
  • Easy add or remove engines ( flat file )

Requirements:

  • PHP 4.2+
  • Ioncube loaders

Some FAQs:

Q: How Do I Install URL Submit Script?

A: unzip all files and send to your server , if you dont like the design, you can change the design to suit your taste.All CSS are in index.php, if you do not want to change then include it in your actual site using include function example:
<?php include("submit.php");?>
Q: How to solve ioncube error ?

A: If you are running different PHP version, download the loader from your system here http://www.ioncube.com/loaders.php and add it in your ioncube folder.

Q: How to add or remove engines ?

A: open file @@@_engines.txt , one engine per line , if you like to remove a Search Engine, only remove the line and its done,Search Engine is no more available, if you like to add a Search Engine, all values are separated by |
Example :
 number unique|name display|main url |path |answer to know if have a error or success |keep 1 |.

 Download Search Engine Submission PHP Script

Sunday, June 26, 2016

Dynamic Drop Down Menu using PHP and MySQLi

We have already seen tutorial about simple Drop Down Menu using CSS3 and jQuery, and this tutorial will cover creating a Dynamic Horizontal Drop Down Menu with its sub menu using PHP and MySQLi, it’s a simple concept and easy to create with PHP and MySQLi, you can also add and set links in main menu and sub menu from database data using PHP, I’ve used MySQLi object method, so let’s take a look at this tutorial.
Dynamic Drop Down Menu using PHP and MySQLi
Read more »

Creating and Extracting ZIP on the fly

If you want to create  or extract zip files on-the-fly you can use pclzip class. The class can be downloaded from phpclass.org or you can download here (including an example script 33kb!!). You can change the source or destination folder.



Cropping Image On The Fly

Here is php script for cropping image on the fly:


<?php

// set width, height, source file, file type, destination file

function cropImage($nw, $nh, $source, $stype, $dest) {

$size = getimagesize($source); // get size

$w = $size[0];

$h = $size[1];



switch($stype) { // image format

case gif:

$simg = imagecreatefromgif($source);

break;

case jpg:

$simg = imagecreatefromjpeg($source);

break;

case png:

$simg = imagecreatefrompng($source);

break;

}


$dimg = imagecreatetruecolor($nw, $nh); // create new image

$wm = $w/$nw;

$hm = $h/$nh;

$h_height = $nh/2;

$w_height = $nw/2;

if($w> $h) {

$adjusted_width = $w / $hm;

$half_width = $adjusted_width / 2;

$int_width = $half_width - $w_height;

imagecopyresampled($dimg,$simg,-$int_width,0,0,0,$adjusted_width,$nh,$w,$h);

} elseif(($w <$h) || ($w == $h)) {

$adjusted_height = $h / $wm;

$half_height = $adjusted_height / 2;

$int_height = $half_height - $h_height;

imagecopyresampled($dimg,$simg,0,-$int_height,0,0,$nw,$adjusted_height,$w,$h);

} else {

imagecopyresampled($dimg,$simg,0,0,0,0,$nw,$nh,$w,$h);

}

imagejpeg($dimg,$dest,100);

}

$image_ori = "image_ori.jpg";

$image_crop = "image_crop.jpg";

// run crop function

// width, height, image_ori, image format, image_crop

cropImage(225, 165, "$image_ori", jpg, "$image_crop");



print "<h2>Image before crop : <br> <img src=$image_ori> <br><br>";

print "Image after crop : <br> <img src=$image_crop>";

?>








Script Hit Counter In PHP

PHPGcount is a PHP graphical hit counter. It uses flat-text database so no SQL databases are necessary. It comes with many styles to choose from and you can add your own styles easily! It can count hits for multiple pages of your website or even websites on other servers. With the help of cookies it can count unique visits only.

The count is displayed on the page using a simple Javascript code.

Unlike other graphical hit counter scripts PHPGCount will work even on servers that dont have GD library enabled (this library is usually required by other scripts).


Download PHP Hit Counter


Saturday, June 25, 2016

Hazrat Adam A S History Free Download in Urdu

Hazrat Adam A.S History books
Hy Friends Once again I am Posting a nice Urdu PDF book For you. Title of  Book is HAzrat Adam A.s Written by Aslam Rahi. Before this I already Posted Prophets life books E.g  Hazrat Ibrahim as History in Urdu same thing is  Hazrat Sulaiman Aur Deegar Anbiya Kay Qissay

Download

PHP Login Script A Simple Free PHP Login Script

A simple home made PHP/MySQL login script to protect your web page content from spam and bot registrations so that only registered users can view the content of your site.. It is free of charge and you can use it on any commercial or personal projects!


Features
  • Quickly Integrate to any Website.
  • User Registration Form with reCaptcha feature.
  • Login with remember me feature.
  • Easy to customize for your needs.
  • Login protect your web pages
  • Login by either username or email.
  • Javascript validation of fields.
  • MyAccount area for users.
  • Username checkup and registration
  • Email confirmation code and activation of account
  • Admin area to manage users with Ban user option
  • Forgot password option (resetting password for users)
  • Change Password option for users
  • Neatly formatted error Messages
Requirements
  • MySQL Database 3+ 
  • Linux server Apache Web server 
  • PHP scripting language
  • reCaptcha Keys + php library (register for free) 
  • JQuery for javascript validation.
How it works

Registration:

User registers with their chosen username, email and password. The script checks for existing username or email, if exists, it denies them registering an account. The username is restricted to only alphabets, numbers and underscore. No special characters allowed.


And of course, they have to verify their captcha image.

The password is stored in md5 format during registration and we send an 4 digit random activation code to their email address.

Login:

The script determines whether username or email is entered and it checks for existing account. When the user enters his password, the script converts the password to md5 string and then compares this to the md5 of the password stored in the database. We never want to know or store the real password of users. That is why we are using md5.

Once logged in we are registering a session and a Cookie with remember me feature.

Admin area:

You can manage the users like activating accounts of pending users, create user and ban them. I have kept it so simple and nothing fancy in the admin area. You have to set admin login and password in the script to login. Most the admin functions are made to work with javascript.

Error Messages:

The error messages are neatly formatted for the users.


Integrate to your Website

I have left spaces for header, footer, left menu and right menu in table layout so that you can easily insert your logo, header and footers depending on your website.


Installation Instructions

Here is how you install the script in your website.

1. MySQL database setup

(i) Create database table


Download and unzip the php login script and you can import the whole dbsql.sql or open the file in notepad and copy the lines and paste into the SQL of database. It will create users table and your admin login.

If you have cpanel you can access phpmyadmin directly this way - point your browser to http://domain.com:2082/3rdparty/phpMyAdmin/

(ii) Database settings

Open dbc.php and set values inside the quotes for your mysql settings.

  •  database name
  •  database user
  •  database password

you will get these information from your hosting provider. Make sure you give full access rights to the database user. If you have cpanel, just login and create database and database user.

example:
define ("DB_HOST", "xxxxx"); // set database host
define ("DB_USER", "xxxx"); // set database user
define ("DB_PASS","xxxx"); // set database password
define ("DB_NAME","xxxx"); // set database name

3. Setting up reCaptcha for your Script

(i) Download recaptcha php library (https://developers.google.com/recaptcha/docs/php), unzip and copy the single php file recaptchalib.php into login script folder. This is very important, without which the login script will not work

(ii) Go to recaptcha.net, register a free account, and you will get public and private keys. Make a note of that and set it here inside dbc.php
$publickey = "xxxxxxxxxxxxxxxxxxxxxxxxxxx"
$privatekey = "xxxxxxxxxxxxxxxxxxxxxxxxx";

4. Configuration settings

Open dbc.php and you have to configure the php login script.

(i) Automatic or Manual registration
/* Registration Type (Automatic or Manual)
1 -> Automatic Registration (Users will receive activation code and they will be automatically approved after clicking activation link)
0 -> Manual Approval (Users will not receive activation code and you will need to approve every user manually)
*/
$user_registration = 1; // set 0 or 1

(ii) Other Settings (optional only)

These are the other settings in the script if you want you can change it like cookie expiry time, specify admin levels and much more..
define("COOKIE_TIME_OUT", 10); //specify cookie timeout in days (default is 10 days)
define(SALT_LENGTH, 9); // salt for password
5. Integrate to your website

I have left spaces for header,footer inside each of the pages. You can place there logos, footer or whatever you want depending on your website.

6. Thank you page.

Upon registering, the users will be taken to thankyou.php page and you can customize it to whatever that suits your needs.

7. Login protect a new page

Lets say you have a new page page1.php, and you want only the logged in users to access it. To get this done, just add this one line of code and it should be VERY TOP of your page1.php. Any other html code or php code should be below it.
<?php
include dbc.php;
page_protect();
?>
// place html or other php code below this.
If any users who have not registered and accesses this page1.php, they will be redirected to login page.

8. Display MyAccount menu to all logged in users

You want to show the myaccount menu to all those logged in users with links to change password, logout, settings etc... To show the menu place this code anywhere in your page1.php.

Only logged in users will see this menu.
<?
if (isset($_SESSION[user_id])) {?>
<div class="myaccount">
<p><strong>My Account</strong></p>
<a href="myaccount.php">My Account</a><br>
<a href="mysettings.php">Settings</a><br>
<a href="logout.php">Logout </a>
<p>You can add more links here for users</p></div>
<? } ?>
You can add more links you want like submit etc..
Take a look at myaccount.php and see how this menu shows up on the left side.

9. Access Admin area

Just login as administrator with username admin and password admin123 and you will see Admin CP link below your myaccount.

You MUST change the password for admin once logged in.



Download PHP Login Script

PASTE Pastebin Clone Script In PHP

Paste is an open source pastebin forked from the original pastebin.com script complete with a brand new design and features such as password protected pastes, archives and custom templates. An admin panel, installer and much more is still to come.

Download PASTE- Pastebin Clone Script In PHP

Seerat e Hazrat Data Ganj Bakhsh

Seerat-e-Hazrat Data Ganj Bakhsh

Seerat-e-Hazrat Data Ganj Bakhsh free download
Seerat-e-Hazrat Data Ganj Bakhsh is nice book of this sofi man. I hope my dear visitor you will enjoy all books my blog is daily updated by me So that user can get knowledge from my blog .

Download 

How to Create Drop Down Menu using CSS3 and JQuery

Today i would like to show, How to Create Drop Down Menu using CSS3 and jQuery. Designing a Simple Drop Down Menu with HTML by Implementing CSS and jQuery is very easy to create. A simple horizontal menu that shows it’s sub menu on mouse hover. when you hover a mouse on main link it will show it’s sub menu. just take a look at this tutorial.
How to Create Drop Down Menu using CSS3 and JQuery
Read more »

Friday, June 24, 2016

Anti spam Image Generator PHP Script Protect Your Blog From Spammers And Bots

Anti-spam Image Generator php script will render PNG image with code to protect your blog/comments/feedback section from spammers and bots (known as CAPTCHA).

Requirements:
  • PHP 4.0.6
  • GD 2.0.1 or later
  • TTF font to use for rendering code. By default it uses arial.ttf. You can find it online.

Features:
  • You can define characters set to use (by default 0123456789)
  • Customizable code length (default is 6)
  • Easy to use / light server load, not overloaded with features

Sample usage:
  • Add this html code where you want to place antispam image: <img src="http://www.website.com/path/to/antispam.php">
  • Add field to the html form to enter code, name it anti_spam_code: <input name="anti_spam_code">
  • Add following check in the php code to check if user entered CAPTCHA correctly:
@session_start(); // start session if not started yet
if ($_SESSION[AntiSpamImage] != $_REQUEST[anti_spam_code]) {
// set antispam string to something random, in order to avoid reusing it once again
$_SESSION[AntiSpamImage] = rand(1,9999999);

// here you add code to let user know incorrect code entered
...
}
else {
// set antispam string to something random, in order to avoid reusing it once again
$_SESSION[AntiSpamImage] = rand(1,9999999);

// everything is fine, proceed with processing feedback/comment/etc.

...
}

Download Anti-spam Image Generator PHP Script

PHP Data Insert and Select Using OOP

In this tutorial i will show you that how to perform and use object oriented programming in PHP with MySql to Select and Insert Data. Using OOP(s) in PHP it's become so easy to manage and perform such operations like Insert and Select data from MySql tables, So let's have a look.

Read more »

Islam main Khawateen ke Huqooq

Islam main Khawateen ke Huqooq

Islam main women(Khawateen) ke Huqooq
Hy Dear visitor How are you all of you? I hope you will fine all and enjoying my blog books . Today i am posting Islam main Khawateen ke Huqooq which is about women rights . if compare the women rights to other religion they do not more respect and give rights like a Islam .so download it . Read full concept of women rights in Islam.
Read Islam mai Parda ki Ahmiat




Modifying Datetime

This class is used to modify a datetime format. The class name is DateTime and the file name is class.datetime.php. The class and the example can be downloaded here (2kb!). Below is the example of use:

<?php

    require_once(class.datetime.php);
    $time = time() - rand(0, 172800);
    $timeStr = DateTime::timeStampToString($time);
    
    echo "Compare $time to ", time(), : , DateTime::compareDates($time, time()), "<br /><br /> ";
    echo "$time to string: $timeStr<br /><br /> ";
    echo "$timeStr to time stamp: ", DateTime::timeStringToStamp($timeStr), "<br /><br /> ";
    echo "$timeStr as Y-m-D: ", DateTime::timeFormat($timeStr, Y-m-d), "<br /><br /> ";
    echo "$time as Y-m-D: ", DateTime::timeFormat($time, Y-m-d), "<br /><br /> ";
    echo "From $time to ", time(), as human readable: , DateTime::timeToHumanReadable(time() - $time), "<br /><br /> ";
    echo "$time as fuzzy time string: ", DateTime::fuzzyTimeString($time), "<br /><br /> ";

?>