2 Great Screenshot Capture Tools

Have you ever wanted a a tool that lets you make quick screenshots and upload them on the internet without you needing to save the screenshot you made with paint and waste your time finding a good image uploader website ? These 2 tools I’m going to show you let you capture your screen and automatically upload them online in a matter of seconds.I’ve used both of them and they are really good and they deserve a tryout.

Lightshot

Lightshot is probably the best screenshot tool I’ve ever used and because of that I’m still using it.One of the things that I like is that after you Select the area you want to upload you can actually draw, write text, make rectangles with a simple interface that is pretty well designed.If the developers of this continue developing the system they will probably be considered the best.

Gyazo

Gyazo is considered to be more complex and it probably is but because the Free version doesn’t provide many features I chose not to use it anymore and go for the Lightshot.I can say that if Gyazo wouldn’t be so greedy and give out more features like Lightshot has, they will be above them with many advantages since Gyazo has better Marketing.

Conclusion

I’ve just presented you 2 Screenshot Capture Tools that I’ve used in the past and gave you my thought on them.Lightshot is better for those who are not willing to pay monthly for extra features and Gyazo is for those who have the budget to invest in these things.Thank you for reading my review !

Check if a domain is Registered with PHP

Hi there guys! We are going to look at a very simple php snippet that lets you know if a specific domain is registered / available for purchase or not.You could expand / grow this snippet and make your own website that checks websites domains for availability. To check if a domain is registered or not we will use the checkdnsrr function that PHP provides us.This function searches for the DNS records of the specific website / domain and if they aren’t available that means the domain isn’t registered.Here is a simple script that you can use:

All you need to do is replace the value of the $domain variable with the one you want to check and you’re good to go.For this example, the result / output is: grohsfabian.com is already registered !

How to change XAMPP / Apache Port

Today we’re gonna look at how we can change the XAMPP port because I know some people ( me included ) might have had problems with the “localhost”.My problem was that I could not access my localhost but with my actual IP ( ex: http://127.0.0.1/script_name/ ) because my router blocked the 80 port and used it for the router admin panel login page so I basically couldn’t access my projects from anywhere else when I was away from home.

I found out about a good solution on how to kind of fix this problem by making XAMPP work on the 8080 port and I’m gonna share that information with you.

  1. Open your XAMPP folder, access apache -> access conf
  2. Open the httpd.conf file with your favorite text editor
  3. Find the line where the  “Listen 80” is located
  4. Add another line with the “Listen 8080” and then save the file
  5. Restart your XAMPP and you are ready to access your work space with http://yourip:8080

apache-port-change

Thanks for reading this tutorial, if you find it helpful please share the information.

OOP MySQLi : How to use Prepared Statements

Hi there guys ! In the last tutorial we talked about How to connect to your database via MySQLi and today we are going to discuss a very important topic in learning how to handle the new MySQLi.If you didn’t read the first article on MySQLi, I suggest you check it out before.

Why use Prepared Statements?

  • Security – You won’t need to escape characters when using prepared statements
  • Perfomance – The statement is prepared only once, but you can execute it multiple times
  • Possibly Cleaner Code – As you won’t need to escape the variables, you are writing less and more organised code

Downsides of Prepared Statements

The first downside of using prepared statements that I can think of it that you can echo out the query so that you can easily check if you created the query correctly or if you have some errors and you want to debug it, you can easily output it and see what’s wrong.As with the Prepared statements, you can’t echo out the query.Another downside is that it can be confusing at start if you don’t have much background in programming but that shouldn’t scare you.I encourage you guys to learn how to use prepared statements.

How to use Prepared Statements

Alright, so you’ve decided to learn how to use Prepared Statements, that’s a really good thing and will definitely help you in your future projects.
$database – variable which contains the OOP database connection.

prepare()

Alright, so you are probably asking what we just did.. When we prepare the statement, instead of using WHERE id = {$id}like we would’ve used normally we replaced the variable with a question mark ( ? ).If you have more than one variable, for example you have WHERE email = {$email} AND id = {$id}.All you need to do is replace all the variables from the query with ? so we would have this query WHERE email = ? AND id = ?.

bind_param()

What does bind_param() do? Well, remember the ? (question mark) signs that we just used ? I guess you already figured it out what it does, but I’ll tell you anyway.It binds / assigns every question mark you used with the prepare() function in the beginning with a variable.

It requires 2 or more parameters.The first parameter will always be a string which contains the type of variable you are sending to the database.I know it sounds weird but let me give you and example, examples are good.Lets say we have 2 variables that we want to assign, $email and $id.The email variable is a string so we will use the s character and for the id variable, which is an integer we’ll use the i character.Check out this example.

The s represents the type of the $email variable and the i represents the type of the $id variable.

I hope you learned something today, thanks for reading my tutorial.Stay tune for the part 2 where we learn to execute the statement and if needed get some results from the database.

 

OOP MySQLi : Connect to your database

Why should you use MySQLI ?

Firstly, MySQLi stand for: MySQL Improved. Since PHP 5.5.0 old mysql extension is deprecated and will soon be removed.This is the first reason you should use mysqli over mysql.

Secondly and what I think it’s the most important and useful feature that mysqli give us is that you can use prepared statements for your queries.That is a much much safer way of querying your database and preventing sql injection.

Connecting to your database using MySQLi

Create a new file named something like connect.php, database.php or whatever your want.Now open it with your favourite text editor.

First thing we need to do is defining the variables which contain information of your database, of course you don’t need to define them but it’s a much cleaner and will may be helpful later in your projects.

Great, we are now ready to proceed to actually connecting to the database using the new mysql improved extension by adding this variable.

After this you are pretty much all set and you can test it on your localhost or webhost and if you get no errors and the page is blank then you connected successfully to your database.

I personally like to let it as it is without checking for errors because if there is any error php will automatically tell you that something went wrong.For example if you have a larger PHP project and you setup your database connection wrong, you can easily tell because of all the errors you will get all over the page if the database connection doesn’t work.

Thats it for today’s tutorial, I will probably do part 2 very soon for you guys.Thanks for reading !