Page 1 of 1

Php and css on in html?

Posted: Sun Mar 26, 2006 9:13 am
by Cheeseboy
feyd | Please use

Code: Select all

and

Code: Select all

tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


Hi i want to have css html and php on one page. Is there a way toget allthree towork together? If theres a easier way (my ears are open). Here my code:

Code: Select all

<!DOCTYPE html PUBLIC
"-//h3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml-strict.dtd"

<html>
<head><title>www.Example.com</title>
<link rel="stylesheet" type="text/css" href="css.css" />
</head>
<body>
<?php echo date("m-d-Y g:i A"); ?>
<form name="login" method="post" action="validate.php">
username:<input type="text" name="user_name"><br>
password:<input type="password" name="password"><br>
<input type="submit" value="submit">
</form>
</body>
</html>

I'll let you guys have some fun and through some css in it. :D

Thx


feyd | Please use

Code: Select all

and

Code: Select all

tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]

Posted: Sun Mar 26, 2006 9:14 am
by John Cartwright
and what is your problem??

Posted: Sun Mar 26, 2006 9:21 am
by Cheeseboy
i want to have css html and php on one page
And when i try this in my browser i dont get php

Posted: Sun Mar 26, 2006 9:26 am
by jrd
What is your file name?

Posted: Sun Mar 26, 2006 9:32 am
by Cheeseboy
phptest.html

Posted: Sun Mar 26, 2006 9:47 am
by feyd
Did you make .html processed by PHP?

Code: Select all

AddType application/x-httpd-php .php .html
In the posted code, the <!DOCTYPE> tag isn't closed.

Posted: Sun Mar 26, 2006 10:01 am
by jrd
listen to the dude, he's never wrong.

Posted: Sun Mar 26, 2006 10:44 am
by John Cartwright
Although I usually won't recommend adding .html to AddType, because all your html pages will be processed through the PHP engine even though there may not be any php present. Typically you just change .html to .php

Posted: Sun Mar 26, 2006 11:31 am
by Cheeseboy
ok thx