As I mentioned in the previous post, basically, there are three main things to understand in web development.
- Server-side scripting (PHP, Python, Pearl, Java, C++, etc)
- Client-side scripting (HTML, Javascript, CSS, etc)
- Database (Oracle, MySQL, etc)
For server-side and database scripting, commonly, you only need to understand only one of the languages. For example, with a very simple understanding of PHP and MySQL, and a little bit of client-side scripting knowledge, you can already create a very powerful site.
As we can see in the picture above, Client Side is really in the client side, but developer must also create the code for them. This is because although we develop something in the server side, the server will process the code and send it to clients. One basic thought that we must consider is that server side script will convert itself to client side script based on how we create it to do so. So, users in the client side won’t be able to see our PHP script at all. What they see is just codes of HTML, CSS, Javascript, and other client side scripts. For instance, we create a code like this in our index.php page :
<?php echo 'This is my beautiful website.'; ?>
Whenever a user requested index.php page, the server is not going to send that code to client. Instead, PHP will convert it to client side code. In this case, the code above will convert to HTML code below.
As you can see, clients can only see HTML code, not the PHP code. They can only see other client side scripts such as javascript, CSS, and HTML. For those who wonder how to see raw HTML code as seen above, simply right click on any area in your browser, then click Inspect.
Now let’s dig in deeper into the collaboration of Server, Client, and Database scripting. Let’s create a simple PHP code below called simpleweb.php.
<!DOCTYPE html> <html> <head> <style> table { width: 100%; border-collapse: collapse; } table, td, th { border: 1px solid black; padding: 5px; } th {text-align: left;} </style> <script> alert('Hey, JS is working here'); </script> </head> <body> <?php $con = mysqli_connect('localhost','root','','test'); if (!$con) { die('Could not connect: ' . mysqli_error($con)); } mysqli_select_db($con,"test"); $sql="SELECT * FROM tb_user"; $result = mysqli_query($con,$sql); echo "<table> <tr> <th>Firstname</th> <th>Lastname</th> <th>Age</th> <th>Hometown</th> <th>Job</th> </tr>"; while($row = mysqli_fetch_array($result)) { echo "<tr>"; echo "<td>" . $row['firstname'] . "</td>"; echo "<td>" . $row['lastname'] . "</td>"; echo "<td>" . $row['age'] . "</td>"; echo "<td>" . $row['hometown'] . "</td>"; echo "<td>" . $row['job'] . "</td>"; echo "</tr>"; } echo "</table>"; mysqli_close($con); ?> </body> </html>
Code above contains all client side programming languages I mentioned earlier (HTML, Javascript, and CSS), and PHP and MySQL code. Let’s see how it looks like in the client side.
At first, because we added javascript in our code containing Alert function, Chrome interprets it as an alert to be shown first before showing other things. Let’s see the rest of the response it received after I clicked OK in the alert box.
From picture above, we can see that there is no more PHP or MySQL code at all. What wee see is just a bunch of HTML, Javascript, and CSS code based on how we code on PHP. The table is nicely styled in CSS, and the content is like being hard coded, although actually it is taken directly from MySQL database, which is very dynamic.
So that is a very simple understandings on how server, client, and database scripts works in web development. I recommend you to try yourself using my code above in order to understand it very well. After this, I will post another interesting topic to learn deeper about each individual languages. So, keep learning and don’t forget to code.
Green Leaf Healing CBD Oil
Loving the information on this web site, you have
done great job on the blog posts.
my homepage Green Leaf Healing CBD Oil
Aktiv Keto Reviews
I know this if off topic but I’m looking into starting my own blog and was curious
what all is needed to get setup? I’m assuming having a blog like
yours would cost a pretty penny? I’m not very web smart so I’m not 100% positive.
Any tips or advice would be greatly appreciated. Cheers
my blog Aktiv Keto Reviews
https://www.yelp.com/user_details?userid=G_AOhA8uadztSolIbPm4Hw
Definitely consider that which you said. Your
favorite justification appeared to be at the internet the easiest thing to take into account
of. I say to you, I certainly get irked while people consider issues that they plainly do not
recognise about. You controlled to hit the nail upon the top and defined out the
whole thing without having side-effects , people could take a signal.
Will likely be again to get more. Thank you
http://24kradiantaquacream.com/
I know this site offers quality dependent posts and other data, is
there any other web page which provides these
stuff in quality?
Also visit my blog http://24kradiantaquacream.com/
24K Radiant Aqua Cream Reviews
Hey There. I found your blog using msn. This is a very well written article.
I will be sure to bookmark it and come back to read more of your
useful information. Thanks for the post. I’ll definitely return.
Visit my blog: 24K Radiant Aqua Cream Reviews
http://cognimaxreview.com/
You are a very intelligent person!
Here is my page: http://cognimaxreview.com/
essay helper
Seriously a good deal of wonderful advice!
essay helper
essay helper https://webcustomwritinghelp.com/
buy cheap essays online
Fine wrote ups Cheers.
Best Essay writing
buy cheap essays online https://writingmypaper.com
DangoBuds Earbuds
I don’t even know how I finished up here, however I assumed this put up used
to be great. I do not realize who you’re however definitely you are
going to a famous blogger for those who are not already.
Cheers!
My website :: DangoBuds Earbuds
https://prozyte.net/
I am glad to be a visitant of this thoroughgoing site,
thank you for this rare info!
Also visit my page https://prozyte.net/
https://solohostbook.com/index.php/SODMitchel5229
Hello.This article was really remarkable, especially
because I was investigating for thoughts on this topic last Tuesday.
my blog https://solohostbook.com/index.php/SODMitchel5229
Ultimate Keto Fuel Reviews
I used to be able to find good information from your
content.
Review my webpage – Ultimate Keto Fuel Reviews
xml
I see something truly special in this website.
my website – xml
https://www.groovelineentertainment.com/HerbertPercy8553
Since the admin of this website is working, no doubt very soon it will
be renowned, due to its quality contents.
Also visit my web page: https://www.groovelineentertainment.com/HerbertPercy8553
porn
I’ve read several excellent stuff here. Certainly value bookmarking for revisiting.
I surprise how much effort you set to make any such magnificent informative website.
Here is my blog post … porn
http://advertising-services.org/blogs/viewstory/8331
Good – I should certainly pronounce, impressed with your web
site. I had no trouble navigating through all tabs as well as related information ended up being truly easy to do to access.
I recently found what I hoped for before you know it in the least.
Reasonably unusual. Is likely to appreciate it for those who add
forums or something, website theme . a tones way for your customer to communicate.
Nice task.
Feel free to surf to my web-site … http://advertising-services.org/blogs/viewstory/8331
Full Releaf CBD Reviews
Excellent site. A lot of helpful information here. I’m sending it to some
buddies ans additionally sharing in delicious.
And of course, thanks to your sweat!
my web page – Full Releaf CBD Reviews
Full Releaf CBD Review
Ahaa, its nice dialogue regarding this piece of writing here at this web site, I have
read all that, so now me also commenting at this place.
Feel free to surf to my webpage :: Full Releaf CBD Review
https://www.groovelineentertainment.com/blog/8098/tips-very-best-quit-smoking-pot-yet-sadly-get-in-the-black-hole/
It’s amazing in favor of me to have a site, which
is beneficial for my know-how. thanks admin
Feel free to surf to my page; https://www.groovelineentertainment.com/blog/8098/tips-very-best-quit-smoking-pot-yet-sadly-get-in-the-black-hole/
hoodksa
We stumbled over here different web address and thought I may
as well check things out. I like what I see so i am just
following you. Look forward to looking into your web page repeatedly.
Myrna
This paragraph will help the internet visitors for creating new webpage or even a weblog from start to
end.
Rowena
Very rapidly this web site will be famous amid all blogging and site-building viewers, due to
it’s fastidious content
homepage
An immpressive share! I’ve just forwarded this
onto a co-worker who has been doing a little
homework on this. And he in fact bought me dinner duee to
the fact that I found it for him… lol. So let me reword
this…. Thanks forr the meal!! But yeah, thnanx for
spending the time to discuss this mater here on your web page.
homepage
solar hybrid catamaran
My brother recommended I would possibly like this web site.
He was entirely right. This publish truly made my day.
You cann’t imagine just how a lot time I had spent
for this information! Thank you!
education
Hi there! I simply want to give you a big thumbs
up for the excellent information you have here on this post.
I will be coming back to your web site for more
soon.
lawn care Omaha
Generally I don’t read article on blogs, but I wish to say that this
write-up very pressured me to check out and do it! Your writing style has been surprised me.
Thanks, very nice post.
nearest marijuana dispensary
Ні there, There’s no doubt that your site could possibly
be having internet browsеr compatibility іssսes.
Whenever I take a look at your ƅlogg in Safari, it looҝs fine bbut when opening in I.E., it haas some ߋverlapping issues.
I simply wanted to give yoou a quick heaads up! Besides tһat,
fаntastic weЬsite!
My webpage; nearest marijuana dispensary
Mahalia
you are in reality a just right webmaster. The web site loading velocity is amazing.
It sort of feels that you’re doing any unique
trick. Also, The contents are masterwork.
you’ve performed a fantastic task on this topic!
helion-ltd.ru
I’m really loving the theme/design of your weblog. Do you ever run into any browser compatibility problems?
A few of my blog readers have complained about my
blog not working correctly in Explorer but looks great in Firefox.
Do you have any recommendations to help fix this problem?
situs judi slot online terpercaya 2019
Its not my first time to pay a quick visit this site, i am visiting this site dailly and
get pleasant information from here everyday.