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.