Useful scripts for everyday use!
This is a small bundle of script I've developed, it's made for small projects. It comes with complete registration, login, password recovery and password changing system. Just to lessen load on server I wrote some client validation too.
Using these scripts is quite straight forward. Just import the ‘website_name.sql’ database, change your database information in ‘connection.php’ file and you should good to go. Just make sure in 'php_form_validator.php' you change the details for email, like your website name, address, reply to email etc. Other than this there's nothing really to be concerned about. Any suggestions/commits are welcome.
- Authentication/login system requires that there's people in registration table. It stores the client data in $_POST, then hashes the password, and using SQL query it tries matching it against data in the table. If data is matched it will log the user in and create session. No account will be able to login unless it has been confirmed.
- Registration system also uses SQL to store data in our registration table. It hashes the password when storing. Registration script also comes with email verification methods, and aswell as captcha.
- Password recovery system asks for and sends it link to check whether user who put the email is the true owner. When user clicks that link, it check if it matches with temporary password and username in recover_password table and then generates new password and stores in registration table.
- Password changing sytem is quite easy too. You have to be logged in, enter new password and hit the button!
Download
Git
https://github.com/phpdevsami/Registration-Login-Password-Recovery-and-Password-Changing-system
Thursday, 18 June 2015
Friday, 5 June 2015
[Auto] Random Proxy, Referal and Useragent visitor
After the release of Proxy visitor 1.0 I've been getting quite a bit of requests from people to add random useragent and referal userbar. In this new script I've added both along with user friendly txt files where you post your agents, proxies and referals - just to make process easier.
To understand how referal works, check this post.
To understand how this script works, check this post.
Before I proceed. I'd like to mention I do not recommend this. It's so much better to attract visitor legitimate way - this script can easily be detected.
This script comes with 5 different files. There's index.php where I call function of my static class - code inside this file should be posted on your website's main page, or page you'd open to start the script. This is also where you'll be providing your website's name.
There's also time option in same file, default refresh time is 30 seconds.
include("proxy_visitor_class.php");
webDevTown::load_files("http://www.whatismyreferer.com/");
Next 3 files are pretty obvious, proxies.txt, useragents.txt and referals.txt. Provide proxies with post. One proxy on each line, not separated by comma.
As for referal and agent do the same.
Demo Agents
Alright so that's pretty much it, as you may not it uses traditional cURL extension.. written in OO so only method I suggest you run is load_files.. I've set others to private for a reason.
https://dl.dropboxusercontent.com/u/28490184/webdevtown/Proxy%20visitor%201.2.rar
To understand how referal works, check this post.
To understand how this script works, check this post.
Before I proceed. I'd like to mention I do not recommend this. It's so much better to attract visitor legitimate way - this script can easily be detected.
This script comes with 5 different files. There's index.php where I call function of my static class - code inside this file should be posted on your website's main page, or page you'd open to start the script. This is also where you'll be providing your website's name.
There's also time option in same file, default refresh time is 30 seconds.
include("proxy_visitor_class.php");
webDevTown::load_files("http://www.whatismyreferer.com/");
Next 3 files are pretty obvious, proxies.txt, useragents.txt and referals.txt. Provide proxies with post. One proxy on each line, not separated by comma.
As for referal and agent do the same.
Demo Agents
Alright so that's pretty much it, as you may not it uses traditional cURL extension.. written in OO so only method I suggest you run is load_files.. I've set others to private for a reason.
https://dl.dropboxusercontent.com/u/28490184/webdevtown/Proxy%20visitor%201.2.rar
Run PHP from command line. It's just like executing Javascript code from console!
Apparently learning Javascript through console seems like a pretty decent way to get basic stuff down, and goo new is, it can be done in for PHP too!
What you'll need:
- XAMPP Installer. It's just environment for windows where you can execute PHP scripts.
- Access to command line.
Alright, lets crack on! Install XAMPP form this link. When you're done. Open Command prompt and type in basic echo function that echos 5 + 1. Like this, "echo(10 + 1);". Without strings of course.
So! is it working!? Did it return 6? See.. well it's not working! but don't worry. I'm about to tell you how to make it work.
Alright! Step number 1.
Open My Computer.
Step number 2.
Right click anywhere - except on the drives and select Properties.
Step number 3.
On the left hand side, click on Advanced System Settings.
Step number 4.
You've now System properties window open. At the bottom click on Environment Variables..
Step number 5.
In the System variables area, find Path or PATH and click on Edit.. if you cant find it, click on new..
Step number 6.
In the Variable name field type "Path". And in the Variable value field type the path to the php.exe file. This file will be inside xampp folder, in php folder. So my path is C:\xampp\php. Click okay and close it.
Now lets head back to CMD and try the same thing we tried in the beginning - however with a little change, we want to tell CMD we're about to throw in some PHP code. So it does like this. "php -r 'echo 5+1'". It will return 6! -r parameter allows us to write in PHP code.
To see what different commands are available type in "php -h".
As you can see you can easily run PHP through command prompt now!
What you'll need:
- XAMPP Installer. It's just environment for windows where you can execute PHP scripts.
- Access to command line.
Alright, lets crack on! Install XAMPP form this link. When you're done. Open Command prompt and type in basic echo function that echos 5 + 1. Like this, "echo(10 + 1);". Without strings of course.
So! is it working!? Did it return 6? See.. well it's not working! but don't worry. I'm about to tell you how to make it work.
Alright! Step number 1.
Open My Computer.
Step number 2.
Right click anywhere - except on the drives and select Properties.
Step number 3.
On the left hand side, click on Advanced System Settings.
Step number 4.
You've now System properties window open. At the bottom click on Environment Variables..
Step number 5.
In the System variables area, find Path or PATH and click on Edit.. if you cant find it, click on new..
Step number 6.
In the Variable name field type "Path". And in the Variable value field type the path to the php.exe file. This file will be inside xampp folder, in php folder. So my path is C:\xampp\php. Click okay and close it.
Now lets head back to CMD and try the same thing we tried in the beginning - however with a little change, we want to tell CMD we're about to throw in some PHP code. So it does like this. "php -r 'echo 5+1'". It will return 6! -r parameter allows us to write in PHP code.
To see what different commands are available type in "php -h".
As you can see you can easily run PHP through command prompt now!
Tuesday, 2 June 2015
Learn TCP/IP basics in 5 minutes!
First things first alright. Yes I mentioned two strange acronyms in my title, which you know nothing about! But you will, in 5 minutes starting from now you will know everything that you didn't! So lets get started, shall we eh!?
Okay, TCP stands for Transmission Control Protocol and IP for Internet Protocol. They're just protocols. WHAT! WHAT'S A PROTOCOL YOU ASK! Protocols are rules. They're used to communicate - in other words they let computers talk to each other.
And that's pretty much what TCP/IP is! Keep on reading to find out what exactly they're there for and how they work. I promise, you'll understand every single bit of it!
Did you know that TCP/IP have for different layers. There's a network interface layer, Internet layer, Transport layer and Application layer.
Here's cute picture I found on https://technet.microsoft.com
On the left hand side are 4 layers I mentioned above.
Now you gotta wonder, okay I see the layers but what's that on right hand side!? Not to be afraid my friend, they're also protocols, each layer of TCP/IP has its own set of protocols.
Some of the protocols that exists in Application layer are following: HTTP, Telnet, FTP, TFTP, SNMP, DNS, SMTP, X Windows, other application protocols. You can read more about HTTP here by the way, it's quite important to know to be honest.
Here's a quick example, lets say there's two different computers and computer A is transferring a file to computer B. What TCP will do is cut the file into small pieces. Note that it doesn't just cut it randomly it does it in a certain way so that when computer B receives it, it can paste the chunks and form a file again. Quick question: How does the computer know what computer to send data to? hm? Correct answer is, IP! Unique address. Every network has it like I mentioned above.
You should also know that these layers interact with each other, for example. Application layer includes application that uses Transport, so when this layer receives data it cuts data into small pieces using TCP.
What else should you know, well as a beginner that's pretty much it! now we could continue talking about it all day long but as I promised in the title this tutorial wont take more than 5 minutes.
If you want to go more in depth have a read, here.
So what you know now:
- TCP/IP is a protocol - set of rules.
- It's used for computers to communicate with each other on internet.
- It consists of 4 different layers.
- Each layer has its own protocols.
- We learned about packets(chunks)
- We now know what identifies our computer on internet, IP address.
- Layers interact with each other.
I hope you now have abetter understanding of TCP/IP, if you couldn't understand something, leave a comment.
Okay, TCP stands for Transmission Control Protocol and IP for Internet Protocol. They're just protocols. WHAT! WHAT'S A PROTOCOL YOU ASK! Protocols are rules. They're used to communicate - in other words they let computers talk to each other.
And that's pretty much what TCP/IP is! Keep on reading to find out what exactly they're there for and how they work. I promise, you'll understand every single bit of it!
Did you know that TCP/IP have for different layers. There's a network interface layer, Internet layer, Transport layer and Application layer.
Here's cute picture I found on https://technet.microsoft.com
On the left hand side are 4 layers I mentioned above.
Now you gotta wonder, okay I see the layers but what's that on right hand side!? Not to be afraid my friend, they're also protocols, each layer of TCP/IP has its own set of protocols.
Some of the protocols that exists in Application layer are following: HTTP, Telnet, FTP, TFTP, SNMP, DNS, SMTP, X Windows, other application protocols. You can read more about HTTP here by the way, it's quite important to know to be honest.
Here's a quick example, lets say there's two different computers and computer A is transferring a file to computer B. What TCP will do is cut the file into small pieces. Note that it doesn't just cut it randomly it does it in a certain way so that when computer B receives it, it can paste the chunks and form a file again. Quick question: How does the computer know what computer to send data to? hm? Correct answer is, IP! Unique address. Every network has it like I mentioned above.
You should also know that these layers interact with each other, for example. Application layer includes application that uses Transport, so when this layer receives data it cuts data into small pieces using TCP.
What else should you know, well as a beginner that's pretty much it! now we could continue talking about it all day long but as I promised in the title this tutorial wont take more than 5 minutes.
If you want to go more in depth have a read, here.
So what you know now:
- TCP/IP is a protocol - set of rules.
- It's used for computers to communicate with each other on internet.
- It consists of 4 different layers.
- Each layer has its own protocols.
- We learned about packets(chunks)
- We now know what identifies our computer on internet, IP address.
- Layers interact with each other.
I hope you now have abetter understanding of TCP/IP, if you couldn't understand something, leave a comment.
Subscribe to:
Comments (Atom)








