coreyphp Posted November 28, 2006 Share Posted November 28, 2006 I wanted to put my PHP in my HTML code using the <?php and ?> tags, but the PHP code is very long and has several end (?>) tags in it. Is there a way to wrap the entire php code in one big start and end tags? Link to comment https://forums.phpfreaks.com/topic/28699-php-in-html/ Share on other sites More sharing options...
doni49 Posted November 28, 2006 Share Posted November 28, 2006 HUH?I'm REALLY not too sure what you just asked. But I'll take a swing at guessing. Are you saying that you want to ECHO all of your HTML to the browser? If so, THAT can be very hard to deal with. Link to comment https://forums.phpfreaks.com/topic/28699-php-in-html/#findComment-131342 Share on other sites More sharing options...
coreyphp Posted November 28, 2006 Author Share Posted November 28, 2006 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 More sharing options...
kenrbnsn Posted November 28, 2006 Share Posted November 28, 2006 Please post some of the code that is not working.Ken Link to comment https://forums.phpfreaks.com/topic/28699-php-in-html/#findComment-131345 Share on other sites More sharing options...
coreyphp Posted November 28, 2006 Author Share Posted November 28, 2006 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 More sharing options...
kenrbnsn Posted November 28, 2006 Share Posted November 28, 2006 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 More sharing options...
trq Posted November 28, 2006 Share Posted November 28, 2006 [quote]i want to wrap the whole thing in a php tag.[/quote]So do it. Rememeber you will need to echo all html though. Link to comment https://forums.phpfreaks.com/topic/28699-php-in-html/#findComment-131351 Share on other sites More sharing options...
corbin Posted November 28, 2006 Share Posted November 28, 2006 if you mean all the breaking in and out of php bothers you, you could put all the php in one file and then put in the html file include("filename.php"); Link to comment https://forums.phpfreaks.com/topic/28699-php-in-html/#findComment-131364 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.