Steven Kirby

Portfolio - Personal


Return to Home Page | Highlights Web Development | Coursework Follow me on GitHub

Website Development


SellCards.co.uk (Ecommerce Site)

An Ecommerce website that facilitates selling trading cards


PHP Login/SQL Database

Hashing of user passwords using bcrypt.

User can sign up, however no email verification is in place, and log in using this email and the password chosen.

The website is secure and uses https:// however it does not redirect to this when accessing over http://, this is shown here.



PHP Mail

Uses GET to pass the data to the mail php file, although this potentially allows for spam requests accidentally so will be changing this to POST.

Below is the very simple code for this.

$name=$_GET['name'];
$email=$_GET['email'];
$phone=$_GET['phone'];
$message=$_GET['message'];

$to = "Email@EMail.com";
$subject = "Sent from contact form on sellcards.co.uk";
$txt = $name." ('".$email."/".$phone."') ".$message;
mail($to,$subject,$txt);
header( 'Location: https://sellcards.co.uk/index.php' ) ;
?>

PHP/SQL Search & Sort

This function works by reloading the page with new GET parameters which it reads to determine how to order the cards.

A query is sent to the database and returns the cards based on the above parameters and the search parameter.

This returns back an array of cards which are displayed in rows on the page to the user; the more results that are returned however the longer it takes to load, other then this it is a quick function.


CSS Transition

Upon hovering over each card, the background will go black, and the card will enlarge and remain highlighted as well as pop out in front of the other cards.

This took alot of trial and error, however the result is very satisfactory.


PHP/SQL Cart & PayPal

The account page includes all the items that the user has added to their cart, able to remove these and is stored in a seperate table in the database, with the fields below to create a connection or foreign key between tables.

The user's details are also included on this page and in the future I will make this editible by the user.

Once the user has decided to buy the cards in their cart, they can checkout with PayPal either by logging in or as a guest, secure and quick.

The PayPal method I used allows the listing of each item in the transaction, although easier using the built in PayPal buttons, this was not viable for the quantity of different items that my site could potentially handle, just over 15,000 if you were wondering, and possibly more depending on any diversity of items that could be sold.

$sql="SELECT * FROM cart WHERE userID =".$_SESSION['user'];

This is a simple sql query using php to get relevent information to select everything from the current users cart.

while ($row = mysqli_fetch_array($query)){
   $query2 = mysqli_query($conn,"SELECT * FROM card WHERE cardID={$row['cardID']}");
   while($row2 = mysqli_fetch_array($query2)){
      ${'item'.$i} = $row2['cardName'];
      $i+=1;
      ${'item'.$i} = $row2['cardPrice'];
      $i+=1;
   }
}

This takes the results of the last query and creates another query for each card that was in the cart of the current user returning the card details such as name and price, adds it to the PayPal itemlist with its requirement to have a name and a price for each item.


RetroHub.co.uk (Ecommerce Site) </a>

Built upon the successful parts of sellcards ecommerce website, using what I had learned to make this website more maintainable.


Account/Cart

The account page shows the user the products currently in their cart with an ability to remove the item, which can be inspected further by clicking on the item itself.

The user can checkout using paypal, and has a section where they can view which items are on their wishlist, the wishlist can also contain items that are out of stock.

The user can subscribe or unsubscribe to marketing emails here as required by GDPR regulations.


Security and GDPR

The Website has an SSL certificate and uses https in all sections of the website where is it is needed, if the user does go to these sections of the website using http, they are redirected to https automatically.

The user must agree to terms and conditions and privacy policy before they are able to sign up for the website.

Also the user can subscribe or unsubscribe to marketing emails here, either option will allow the user to sign up.

The website tracks IP addresses and times for tracking website usage and security, however doesn't use any custom cookies other then the PHP session cookies.


Preventing Simultanious Sales

Due to the unique nature of the items for sale, being that most if not all items are second hand and in varyings states of condition (which the customer can see before they purchase the item). Each item cannot sell more then once.

These images show a couple of measures to prevent this, being that if the item is in another users cart, they will be told so and given a timeframe before this item can be added to their own cart.

If an item has already been sold, this item will change to out of stock but is still able to be added to the users wishlist, this is useful for knowing what items are in demand; I would be able to send them an email if they had subscribed to marketing emails.


Freegram.co.uk (Wordpress Blog/Charity Site)

A website that facilitated charity posts and connecting developers with charities.


WordPress/Social Media Login

The site uses WordPress and enables users to signup and login with facebook, google, twitter or youtube quickly and securely in a couple of clicks.


Blog Categories

I chose to lay the site out as a blog, which would enable users to post their own blogs, projects and news. By setting the correct category, they could be separated and easily found.

The main categories include News, Blogs and Projects, this is because the site is primarily supposed to be aimed toward companies with little to no budget/charities who need programming jobs done in exchange for a programmer to gain experience and a reference to add to their portfolio.


Editing of Plugins

The use of plugins make it very easy to knock up a website in a very short time with great functionality, however to get the very best out of WordPress, you need the ability to edit or modify plugins to your liking, I have done this here with limited success as it is a very manual process, by excluding my own posts into the blogs by users, and likewise with only including my own blogs in the blogs by me section.

Blogs by users will only show other peoples blogs, Blogs by Freegram will only show the blogs posted by me.

I also replicated the behaviour of showing all posts whereby the picture for the post is showing beside the blurb as this was not a default option with the plugin I used.


Tutorial Island

This page is a one stop place for many of a budding programmers needs to learn, without having to leave the page they have access to alot of resources from youtube about web development, programming and SEO.


Social Media

Using the application IFTTT (If This Then That), I have made each and every blog, news or project that is posted, also be posted to facebook and twitter.


Custom HTML Pages

Of course just because the website uses wordpress predominantly, there is no reason why not to use custom html pages, as such I have created a smoking calculator.