Jump to content

PHP in HTML


coreyphp

Recommended Posts

No.
Ok, so i have one huge PHP program to put into my html code, but there are end tag within the PHP program and it screws it up when I try to load the page.  So i want to wrap the whole php code in one large tag so it does not confuse the html with the end tags.  Does that make more sense?  Thanks for the quick responce.
Link to comment
https://forums.phpfreaks.com/topic/28699-php-in-html/#findComment-131343
Share on other sites

ok so this is just a random part of the code

[code]$ipregexp='/^((?:[0-2]{0,2}[0-9]{1,2}\.){3}[0-2]{0,2}[0-9]{1,2})\:([0-9]{1,5})$/';

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

<html>
<head>
<title>Proxifier</title>
<meta name="robots" content="index, nofollow" />
<style>
body{font-family: bitstream vera sans, trebuchet ms}
input{border: 1px solid #000000}
select{border: 1px solid #000000}
a{color: #000000}
a:hover{text-decoration: none}
.advanced_stuff{display: <?php echo(SIMPLE_MODE?'none':'table-row'); ?>}
.simple_stuff{display: <?php echo(SIMPLE_MODE?'table-row':'none'); ?>}
.url{width: <?php echo(SIMPLE_MODE?SIMPLE_MODE_URLWIDTH:'99%'); ?>}
.signature{float: left}
<?php if(FORCE_SIMPLE){ ?>
.noscript_stuff{display: none}
.signature{text-align: center; float: none}
<?php } ?>
</style>[/code]

The whole thing is supposed to be in a .php file but it goes in and out of php.  It does not work correctly when i don't have it all in php so  i want to wrap the whole thing in a php tag.
Link to comment
https://forums.phpfreaks.com/topic/28699-php-in-html/#findComment-131349
Share on other sites

It should work fine if the script is in a .php file. Going in and out of PHP is not a problem. Do you have a link to the script that shows the problems.

"It does not work correct" doesn't tell us much. What doesn't work? Do you get any errors?

Ken
Link to comment
https://forums.phpfreaks.com/topic/28699-php-in-html/#findComment-131350
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.