Posts marked with "Posts" in posts

Subins Update 1.2

Subins has been updated to 1.2. The new changes have been made on Subins and is updated today. The sites that affected the changes are:

Contents

<ul class="toc_list">
  <li>
    <a href="#subins-chat"><span class="toc_number toc_depth_1">1</span> Subins Chat</a>
  </li>
  <li>
    <a href="#accounts"><span class="toc_number toc_depth_1">2</span> Accounts</a>
  </li>
  <li>
    <a href="#subins"><span class="toc_number toc_depth_1">3</span> Subins</a>
  </li>
  <li>
    <a href="#friendshood"><span class="toc_number toc_depth_1">4</span> Friendshood</a>
  </li>
  <li>
    <a href="#subins-get"><span class="toc_number toc_depth_1">5</span> Subins GET</a>
  </li>
</ul>

Subins Chat

In Subins Chat the design has been changed. The bugs have been fixed and It’s more fast than before.
Subins Chat is not only a group chat but a place for submitting suggestions, bugs, errors and feedback.
Please report any errors or bugs happening on any of the sites of Subins in Subins Chat.

... [READ MORE]

What is SQL Injection and how to make your PHP site free from SQL Injection hacking

SQL Injection (SQLi) is a very dangerous thing that a hacker can do to your site. This happens mostly in SQL queries. Let me make you understand this in a simple way. Suppose you’re SQL query code is this:

$user=$_GET[‘user’];
$sql=mysql_query("SELECT * FROM users WHERE user='".$user."‘");

It’s a normal code. BUT it is a very easy method for hacker to easily destroy your database.
The user ID is getting from a GET request. If the file’s name (where the request is going) is user.php. The URL may be like this:

http://example.com/user.php?user=subin

... [READ MORE]

Create a free .tk domain website with free hosting by AppFog

This free .tk domain is made available by a company called Dot TK and the free hosting is provided by AppFog.

Create free hosting for site

Fill up the form and click Signup.
Choose an application:
Choose a infrastructure and a subdomain (I use HP):
After filling up form, click on Create App.
You will be automatically redirected to the app panel.
That’s it. You created your AppFog app.
To learn how to upload files to your app. Here are some pages that will help you understand about AppFog.
The created app domain will be .hp.af.cm. You can link this app to Dot TK. See How to do that below.

Create Free Website

Go to Dot TK website.
Login with a service provider (Google, Facebook etc…)
Go to Add Domain
Fill up the form and click NEXT.
A new page will be visible and in it click the Use DNS for this domain button.
Go to AppFog panel in another tab. Click your app and from the app panel click Domain Names.
Type the url of site you made in Dot TK in the input box as shown in the picture:
 
Then Click on Update button.
 

Getting the IP address of AppFog app.

Open a new tab and go to http://www.getip.com/
Type the URL of the AppFog app in to the selfseo input box and click Get IP.
 
The page will show the IP address of the site :
Go to the Dot TK tab we already opened. Type the IP address we just found on to the two IP address input box :
Change the Registration length to 12 months.
Type the verification code in the picture and click on the Next button.
Visit the site you created on Dot TK to verify that your site is created.
If you have any doubts or problems, feel free to comment the problem/doubt.
... [READ MORE]

Get Google Profile Picture URL by email id using PHP

This is a trick using Google Profile.
First of all we are going to set a variable with a Google E-mail address (Gmail address). We are going to set it with my E-mail address

$email=’subins2000@gmail.com’; 

Then we are going to split @ from the mail address.

list($id, $domain) = split("@",$email);

Next we are going to send a request to Google Profiles to fetch the IMAGE url.

$headers = get_headers("https://profiles.google.com/s2/photos/profile/".$id, 1);

The variable $id above is from the splitted part.
Finally we have to get the URL of the user’s profile picture.

... [READ MORE]

10 Songs for Making Programming Better

When I am coding my site Open or my blog, I hear a lot of songs along with coding. It makes me energetic and will help calm me down when an error occurs. The error probably will be a simple mistake but causes a lot of time to solve it. To calm me down I will play a song and BINGO ! I fixed the error.

Here are the songs that make my coding easier and refreshes my mind. The text in brackets are the detail of which the song do to my mind.

... [READ MORE]

How to edit/clear Ubuntu Terminal commands history ?

This simple trick will help you to clear or edit terminal commands you entered in Terminal of Ubuntu.
Open the file /home/user/.bash_history (Replace red text with your username.

To make it simple Go to your home folder and Press CTRL + H. It will show hidden files.
search for the file .bash_history
Edit the file.
You can see all the commands you entered in Terminal.

Remove what you don’t want and save.

... [READ MORE]

Using Regex to validate E-mail and Phone Number

Here is the RegEx expression to validate Phone number and E-mail.

RegEx expression for validating E-mail :

/^(([^<>()[].,;:s@"]+(.[^<>()[].,;:s@"]+)*)|(".+"))@(([[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}])|(([a-zA-Z-0-9]+.)+[a-zA-Z]{2,}))$/

and the RegEx expression for validating Phone number :

/^(?([0-9]{3}))?[-. ]?([0-9]{3})[-. ]?([0-9]{4})$/

Here is an example of usage of these RegEx expressions in JavaScript.

var emailregex=/^(([^<>()[].,;:s@"]+(.[^<>()[].,;:s@"]+)*)|(".+"))@(([[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}])|(([a-zA-Z-0-9]+.)+[a-zA-Z]{2,}))$/;var phoneregex=/^(?([0-9]{3}))?[-. ]?([0-9]{3})[-. ]?([0-9]{4})$/;if (emailregex.test(string)){// valid email}else{// Invalid email}if (phoneregex.test(string)){// valid phone number}else{// Invalid phone number}

You can replace string with whatever you want. For Example:

if (phoneregex.test($("#phone").val())){// valid phone number}else{// Invalid phone number}

... [READ MORE]

My Short URL – a site for shortening URL’s

My Short URL is my latest invention. A site for shortening URL’s like goo.gl and bit.ly.

<div>
  You can short URL&#8217;s on the site <a href="http://msurl.tk/" style="font-weight: bold;">MSURL.TK</a>.
</div>

<div>
</div>
As other projects the site is also hosted by AppFog and the free domain is given by My.Dot.TK.
The project was created under 30 minutes and the lines of code is less that 64.
It’s written in PHP as you already know it. 
The shortened URL only has 13 characters (without HTTP://).
The shortened URL will not have .php extension. I will tell you how to view page without file extension on the next tutorial.
Enjoy Shortening URL !
... [READ MORE]

Follow/Subscribe

Telegram 

Mastodon  Twitter

GitHub GitLab

Subdomains

Demos  Lab

Past

This blog was once on WordPress. Now a static site. See source code on

GitLab