• Questions? (908) 864-7283

2 Weeks Left To Make The Most Of Your eCig Related Google Adwords Ads

2 Weeks Left To Make The Most Of Your eCig Related Google Adwords Ads


At the start of September Google announced a change to their Google Adwords policy banning the advertisement of electronic cigarettes, airsoft guns, paintball guns, bb guns, gun scopes, ammunition ... read more

HostGator's Smoke The Competition Sale Is Live!

HostGator's Smoke The Competition Sale Is Live!


Running right now and lasting through until midnight tonight (11:59PM CST) HostGator is running a brand new flash sale giving you 45% off all new hosting packages and domain name registrations starting at just $8/year. The 45% off discount applies to all billing ... read more

Weekly Post Roundup 8/9/2014 - 8/15/2014

Weekly Post Roundup 8/9/2014 - 8/15/2014


Discounts & Coupons Midphase Hosting Launches New Plan & 40% Off Coupon Internet News I Get To Play With Google Domains Hey Photographers, Yahoo Wants You To Get Paid! Russia Launches New Legislative Restrictions on Bloggers Knowledge Widget Now Integrated Into Bing Webmaster Tools Bing Makes Technical ... read more

Issuing SQL Statements Using PHP Data Objects

Issuing SQL Statements Using PHP Data Objects


This tutorial expands upon our previous PHP Data Objects tutorial, which discusses how to connect to a MySQL database, and showcases how to communicate with that MySQL database once you are connected. Depending on the type of query you want to run ... read more

I Get To Play With Google Domains

I Get To Play With Google Domains


Google sent me over an invite to the new Google Domains beta a few days ago and since then I've been playing around with the platform and getting familiar with it. After using it for a few days and going ... read more

Hey Photographers, Yahoo Wants You To Get Paid!

Hey Photographers, Yahoo Wants You To Get Paid!


Late at the end of July Yahoo, quietly, released Curated Connections on Flickr - a program aimed at helping photographers to partner with photo agencies, editors, bloggers and other creative minds who are looking for original content. More-so Flickr seems to ... read more



PHP/MySQL File Upload – Error Checking

Posted on by Michael Boguslavskiy in | 2 Comments
Tags: , ,

A while back I had written a PHP/MySQL tutorial discussing how to upload an image to your server, and store the information about that uploaded image into your MySQL database. That tutorial covered really only the basics, and I knew that eventually someone would post a comment asking about some more advanced features – such as limiting the file size of uploaded images, as requested by Evaleen Tan. So this tutorial aims to expand upon the basic file upload functionality that was discussed previously and introduce various error checking features for file size, and file types, etc.

Now, let’s quickly recap where we left off in the last tutorial. We have built our basic HTML form, which requests for the users username, password, and provides an avatar upload field. This information then gets stored into a MySQL directory. So here is our final submit.php file:

 $dbuser = "mysql_username";
 $dbpass = "mysql_password";
 $dbhost = "localhost";
 $db = "db_name";
 mysql_connect($dbhost, $dbuser, $dbpass);
 mysql_select_db($db);
 $username= trim($_POST['username']);
 $password= trim($_POST['password']);
 $avatar=($_FILES['avatar']['name']);
 $target = "avatars/";
 $target = $target . basename( $_FILES['avatar']['name']);
$results = mysql_query("INSERT INTO `users` VALUES ('','$username', '$password', '$avatar')");
if(move_uploaded_file($_FILES['avatar']['tmp_name'], $target))
 {
  echo "The image ". basename( $_FILES['uploadedfile']['name']). " has been uploaded.";
  echo "<center><img alt="" src="avatars/$avatar" /></center>"
 } 
else 
 { 
echo "Sorry, there was a problem uploading your venue photo file."; 
 } 
if ($results) { 
echo "New User Has Been Added!"; 
} 
mysql_close();

So the first thing we want to add to our submit.php file are a few setting options to limit what types of files we want uploaded, and how large we want them to be. We do this by an array of extensions for our file types, and a variable  that stores the maximum allowed size of any uploaded file (in bytes).

  
$allowed_filetypes = array('.jpg','.gif','.bmp','.png'); // These will be the types of file that will pass the validation.
$max_filesize = 524288; // Maximum filesize in BYTES (currently 0.5MB).

(more…)

1&1 Discontinues MySQL 4 Databases

Posted on by Michael Boguslavskiy in | Leave a comment
Tags: , , ,

Hosting provider 1&1 is “deactivating” MySQL 4 databases starting on May 1st, 2013. All WordPress sites hosted with 1&1 that have not migrated their databases from the old database to the new MySQL 5 databases may have their sites go offline, however 1&1 doesn’t explicitly say the sites will go down. If you host a database driven site on 1and1.com, log in, go to MySQL Administration and check what version of MySQL your site is using.

To quote directly from the 1&1 announcement:

The information below applies only to Linux Hosting packages with MySQL 4 databases. MySQL 4 is being phased out and therefore any data held within a MySQL 4 database must be migrated into a new MySQL 5 database.

Why is the migration not done automatically?
The migration can not be carried out automatically because of some features of MySQL 4 are not supported in MySQL 5 and in order to minimize the amount of transmission and handling of your private data. Because of this we are allowing customers to carry out the migration on their own, at their leisure.

How do I know if my databases are affected?
Any database created in the 1&1 Control Panel that says MySQL 4 as the version, will need to be migrated to a newly created MySQL 5 database. You can check what version of MySQL your databases are by logging into your 1&1 Control Panel and clicking on MySQL Administration from the Domains & Web Space section.

Full instructions on upgrading your MySQL version on your 1&1 hosting account can be found here: http://faq.1and1.com/web_space__access/mysql/20.html

SQL Injections – A Powerpoint Presentation

Posted on by Michael Boguslavskiy in | Leave a comment
Tags: , ,

If you haven’t noticed more and more web-related services have been getting hacked lately – and these aren’t small websites either. Infragard – an FBI affiliate, the CIA website and the FBI’s Detroit phone network, the threats and attacks on Unveillance, and ofcourse who can forget the Sony hacking that has went on. What the news fails to mention is how often hacking attemps happen for the little guys as-well. Your local pizzeria’s website that has a mailing list, your photography website that has a backend of clients information. I was thinking about this on my drive in to work this morning – well to be honest while I was standing in traffic and I remembered a presentation a friend of mine sent me a short while back about SQL Injections. It was originally a school project but it has some great information that everyone developing or managing a website should be aware of.

SQL Injection by Vadim Gellerman

Sign Up To Our Newsletter

  • Stay Updated With All The Latest Webmaster News
  • Be The First To Hear Of New Hosting & Domain Name Coupons & Sales
  • Get Exclusive Webmaster Freebies

Sign up today and I'll send you a free gift!

Stay Connected With Us

Stay in touch with us by following us on Facebook, Twitter, and Google+. There's always plenty of new articles being shared that you won't find within the Rapid Purple blog.