PHP and HTML combined...

Fedlerner

Former Adm & Team Manager
Community Support
Messages
12,934
Reaction score
6
Points
38
Can they be combined??

For example...

<?php
SOMETHING ?>
<HTML>
SOMETHING
</HTML>
<?php>
SMOETHING
?>

And like that as many times i want...
Can it be done?
 

Corey

I Break Things
Staff member
Messages
34,551
Reaction score
204
Points
63
Yes

Code:
<?php
include('/include/here.php');
?>
<HTML>
Random HTML txt Here
<?
echo 'using PHP now';
?>
</HTML>
 

Fedlerner

Former Adm & Team Manager
Community Support
Messages
12,934
Reaction score
6
Points
38
Thanks!
I can make more things with my website now :p
 

Richard

Active Member
Messages
2,028
Reaction score
0
Points
36
You can even use it in loops and If's

// For loop
Code:
<?php
for ($x = 1; $x <= 10; $x++) {
?>
    <div>This is div tag #<?php print $x ?></div>
<?php
}
?>
OR

// IF, THEN, ELSE
Code:
<?php
if ($x = 1) {
?>
    <div>x is equal to 1</div>
<?php
}else {
?>
    <div>x is not equal to 1</div>
<?php
}
?>
 

Fedlerner

Former Adm & Team Manager
Community Support
Messages
12,934
Reaction score
6
Points
38
Hey Richard!!!
That's too complicated for mee
Let me handle it in the other way which is easyer :p
 

Fedlerner

Former Adm & Team Manager
Community Support
Messages
12,934
Reaction score
6
Points
38
Yes... :p
But i only know HTML...
I use Nukestilo (A PHP-Nuke changed version)... So i only add/modifie things with HTML...
And i also consider myself an expert in HTML...
I would love to learn HTML and PHP really good...
But most tutorials are not really good..
If you know about ony usefull from HTML or PHP let me know please! :D
 

Fedlerner

Former Adm & Team Manager
Community Support
Messages
12,934
Reaction score
6
Points
38
Thanks!!! :D
I'll take a look at them
 

jensen

Active Member
Messages
1,168
Reaction score
22
Points
38
After you have combined HTML and PHP you will want to venture into MySQL/PHP combination.Then you get dynamic websites. Websites that can change and update itself. Of course there's planetplanet.com that can help you make self-updating websites
 
Top