Is it possible to write a code using html5 css3 javascript and php?

+3 yannick aremou · December 18, 2014
Is it possible to write a code using html5 css3 javascript and php?all in the same code for a website?thank you

Post a Reply


Oldest  Newest  Rating
+3 Muamet Shasivari · December 19, 2014
I say,YES
+1 Sašo Plut · December 18, 2014
You can use everything inside a PHP code.. don't have any examples at the moment but if you really need them i can browse some simple website i did for an assignment..
+1 Steven the awesome · December 18, 2014
What do you mean?
+1 yannick aremou · December 19, 2014
thank you. that would help. 
+1 Steven the awesome · December 19, 2014
You can do this for example. 


echo  "<h1>Hello World!</h1>";


+1 Domnick Knowlton · December 19, 2014
Yes however your index.html is replaced with index.php. Within your PHP you can include a footer file linked to a css file that would contain the footer css. 
+1 Steven the awesome · December 19, 2014
Yepp that's a really good point you must edit you file extension to .php. 
+1 Branislav Lazic · December 19, 2014
Yes of course. And oh! Pro tip: Don't mix your code (i.e. PHP, JS, CSS in one file)! That's called "macaroni code"
+1 Sašo Plut · December 19, 2014
Found those examples. Just make a php file. you can write an html code inside it but every time you need a php code just put it in <?php code ?>. i have a seperate file for css but it can be put in as well.. JS the same but i did not use it in this code..
just please for the love of god don't put all the code in one file..
my index.php from waaay back

<!DOCTYPE html>
    <link rel="stylesheet" type="text/css" href="template.css" />
<meta charset="UTF-8"> 

<div id="container">
<div id="header">
<div id="navigation">

<div id="content-container">
<div id="content">
                        if (isset($_SESSION['login'])&& $_SESSION['name']!='admin'){
                    else if (isset($_SESSION['login']) && $_SESSION['name']=='admin'){
<div id="aside">
                    if (!isset($_SESSION['login'])){
                        <form action="login.php" method="post">
                            Username: <input type="text" name="username" /><br />
                            Password: <input type="password" name="password" /><br />
                             <input type="submit" name="submit" value="Login" />
                        echo "<p>Logged in successfully</p>";
                     <a href="logout.php">Log Out</a>
<div id="footer">
Copyright © Site name, 20XX
0 yannick aremou · December 20, 2014
thank you everyone
  • 1

HTML / CSS / Web Design


Discuss, share, ask, learn and teach HTML5 and CSS3.