Uploading Our PHP Project to a Bluehost Server

This lesson is exclusive to members

Questions

Course info

13 lessons / 1 hours

Overview

Hi, In this course we are going to add a newsletter sign up form that will save our new subscribers to a database.

To do this we are going to be using a backend programming language called PHP and a MySQL database.Don’t worry if that doesn’t make any sense to you, we will be going over all of the basics and walking you through it step by step.

This course does however assume you have a basic understanding of html and css, and that you know how to push any updates up to a server and make them live.

If you don’t have that experience then I can recommend this course by Daniel Scott, it starts at the very beginning and will easy get you up to speed so you can start taking the next steps like working with PHP and databases.

So if you’re ready to get started with our PHP database project … then sign up to the course and lets get started :)
Daniel Scott

Daniel Scott

Founder of Bring Your Own Laptop & Chief Instructor

instructor

I discovered the world of design as an art student when I stumbled upon a lab full of green & blue iMac G3’s. My initial curiosity around using the computer to create ‘art’ developed into a full-blown passion, eventually leading me to become a digital designer and founder of Bring Your Own Laptop.

Sharing and teaching are a huge part of who I am. As a certified Adobe instructor, I've had the honor of winning multiple Adobe teaching awards at their annual MAX conference. I see Bring Your Own Laptop as the supportive community I wished for when I was first starting out and intimidated by design. Through teaching, I hope to bring others along for the ride and empower my students to bring their stories, labors of love, and art into the world.
True to my Kiwi roots, I've lived in many places, and currently, I reside in Ireland with my wife and kids.

Downloads & Exercise files

Transcript

In this video, we're going to release our project  to the Wild, which includes uploading  to a blue host server and making a few updates to our code. Okay, so to release our little PHP project  to the wild and actually get it saving information  from real people, we're gonna need to upload it to a server. So I'm going to use Bluehost as an example. This is the affiliate page for Bring Your Own Laptop. This is Dan who, um, kindly let us use his example website  so we could skip a few steps in this tutorial. So I'm just gonna promote his affiliate page here.

Not only does this give a little back  to bring your own laptop,  but you also get a pretty good discount from Bluehost  to help you get up and running. I'm gonna assume that  because you're doing this tutorial on PHP  that you are already familiar with how to sign up  to a hosting company and get your website  uploaded and running. All I've done is sign up to Bluehost  and this is basically the um, the dashboard that you get  to once you've signed up. Bluehost will try and get you to install a WordPress site. Just skip over all of that. I've gone down to Advanced File Manager  and that takes you here.

And all I've done is uploaded the files  that we've been working on in ex exam. So all of the files that are  inside our HC Docs project Meet yogurt website,  all I've done is used the upload button here  to upload a project. And that's enough to get it running just with the images. You need to create a folder and then go into that folder  and upload all of the images separately. So once you've done that, you should end up with your meat,  yogurt, web website, running on your own domain. So let's go back to the file manager  because there's a couple of things that we need to do  to get our project up and running on the server.

And the first thing that we probably should do is  create a database. Okay? So to add our database, we wanna go to advanced  and then to databases. And what we need to do here is first of all,  create our new database. So if you wanna put in meat yogurt,  which is gonna be the name of our database,  create database, and then we go back. And then the next step is we need to create a user  and assign that user to the database.

So I'm just gonna go with Malcolm,  I'm just gonna throw a password in here. And the same down there. There's also a password generator if you want to use that. But make sure you keep a record of what the password is. Create user, let's go back. And now what we need to do is assign  that user to the database.

So if we change this to the user we just created  into our meat yogurt website  and click add, we will give this  user all privileges. And now we have our meat yogurt database  with a user assigned to it. That was a bit different from  how we created our database using X amp. But most hosting providers will have the same  or very similar workflow on how to create a new database  and add a user to that database. But now if we go click on the advanced tab  and then under databases we have a link to PHP, my admin. So this is the same PHP, my admin that we saw in X amp,  except for this one, is running on our Blue Host server.

If we click this um,  menu item over here on the left hand side  and expand it, we can see our  meat yogurt database. So let's go ahead  and create our newsletters table with four columns. Set the go button. So now we need to add in the columns  that we'd already created in exam. So the first one was an id, it was an integer with a length  of 11 and it was auto incrementing. So we had go on that.

We had a name  that was VACHER 2 5 5. We had an email that was also VACHER 2 5 5,  and we had our created at that was a date. And we'll hit save on that. So now we have our database with the columns. So this should be a copy of what we already did in X exam. Now that we've got our database set up, there's a couple  of code changes we need to make before our formal work.

So let's head over to the file manager and if we go to index  and edit, What we need  to change here is the action on our form tag. We just need this to submit to newsletters, sign up. Now we don't need it to go to projects, meat yogurt anymore. So let's save the changes and close that down. And we also need to edit our signup PHP script. So we'll edit that.

Click edit here. So we need to update our database connection information. So if we head back over to Blue Host,  and if you wanna go to Advanced Databases,  and we are just gonna grab the database  name that we created. We're gonna copy that and head back to the file manager  and update the database name. We also need to get the user  that we assign to that database. So we'll copy the name.

And we also need the password  that you would have added when you created that user. And we also need to update where this will redirect  after it's been submitted. So we're just gonna redirect back to slash,  which is the homepage, save those changes. Okay, so let's head to our website  and we'll give that a refresh. Let's enter in some information and hit the submit button. So that looks like it worked.

We got redirected back  to the homepage, which is what we wanted. So let's go to PHP, my admin  and browse. And then we can see it's added this in as an ID of two  because I already did some testing,  but it looks like it's added in a new record. So let's just go back to our website  and add one more just to make sure that  that's working properly. Let's sign up my dog, head back  to PHP, my admin, give that a refresh. And there we go.

That's added Baxter  to our newsletters table. And it also means  that our signup form is working on our live website.
  • Powered by Marvin
  • Terms of use
  • Privacy policy
  • © Bring your Own Laptop Ltd 2025