Explaining all this stuff but then I kind of gave you
the cheese steps that make your life a little easier.
So now, so here we are at the resume.
I'm going to use my local host one here, not the global one.
So you can watch what's happening in the database.
I got a profile,
a data table and a user's table.
So, the first thing is that you're supposed,
this is the JavaScript that you're supposed to do in browser validation.
And so if I do a view source on this page,
you can see what I've got.
And I've got, on the click of the login button,
I've got, I'm going to run do validate, okay?
And it's either going to give me a true,
if it's valid and then actually submit
the form or it's going to give me a false and blow up.
And so you see there's a return true and return false etc, etc, etc.
Now the interesting thing about JavaScript is I can't hide it from you.
I mean the JavaScript runs in the browser.
And so deep in the request response cycle,
this is out here in your browser and no server action is going on at all right now.
And so I can't hide it from you.
So, I even show you all this.
I give you all this code somewhere in here,
right here, JavaScript validation.
So I'm going mine will tell it to you because I'm going to show it to you.
If you're smart enough to do a view source you can figure it out.
So what happens is when I type this stuff,
so I type this with no at sign and hit log in,
JavaScript is going to run.
And now what's going on is this alert,
invalid email address has popped up.
If I blank them all out and I hit it,
the JavaScript will stop and say both fields must be filled out.
Now if I get it right,
so let's just put it in like the wrong stuff,
that's going to be a server side check.
No, that was the client's side check.
Server, now it's a server side check.
That's a server side check with a redirect,
with the flash message.
The whole thing, right?
And so if I take a look at login.php.
You know, this looks a lot like the login.php you've been doing all along.
You know, this is a redirect.
And then here is the do validate.
And then, there's the script code.
So, I put that all together in the login.
That's very similar to the logins you've been working in before.
Okay. So, let's log in successfully.
UMSI, I have to redo the JavaScript here.
PHP one, two, three.
Login. Add a new entry.
There's no JavaScript in these although soon we will.
In the next assignment we'll be going crazy in these add
things so we'll be changing the add and edit more in the next few assignments.
Let's do a valid thing.
There we go.
Yeah, this is just CRUD, right?
We're just going into like the profile table and it got first name,
last name, email summary.
It's a little different than the previous one that you did.
But not that difficult to do.
And so, there's no real JavaScript here.
You just got to make the edit work.
You got to do things like,
you know, be able to put dancing characters in and do validation.
You know, drop, drop, table,
students, right?
So, you've got to be able to put evil characters in
and not have anything go bad, neither.
Of course, SQL and Jackson is not going to happen because we're using PTO.
But also not HTML injection, either.
And of course, we take a look at this.
We just see, oh that's what's in there.
Okay. And then there we go.
And so that's pretty all it.
And then the delete just has a verification.
Done make sure you HTML on all these and on this stuff as well.
And there you go.
And then you log out.
So now, I want to log back in and show you a little bit about how the foreign key works.
So, let me get logged back in.