shahzadkhandotcom 0 Report post Posted October 10, 2004 i need to know , how can i add html codes in PHP site ,like <?phpprint("Hello");?>i ever use the print command , i am fed up from writing print any easy solution....Please Share this post Link to post Share on other sites
japanick 0 Report post Posted October 12, 2004 I think you should clarify what you are trying to get an answer for.If you have a PHP file, and you want to write html in it, you do not need to write it in between the <?php and ?> tags, instead just put your html tags and text outside those tags as normal.For example:<H1>This is a Heading</H1><?php echo "This is PHP code.";?><B>Here is more HTML</B>If you need to have the HTML inside the PHP, then you will just have to get used to writing either print or echo whenever displaying HTML. It's not that bad. Share this post Link to post Share on other sites
chronogamer28 0 Report post Posted October 12, 2004 Sorry, I don't use PHP, I use an IPB for my site. Share this post Link to post Share on other sites
iGuest 3 Report post Posted October 12, 2004 i need to know , how can i add html codes in PHP site , like <?php print("Hello"); ?> i ever use the print command , i am fed up from writing print any easy solution.... Please <{POST_SNAPBACK}> Your question is a bit hard to understand. You can escape and re-enter php. Instead of doing something like <?php... your codeecho '<p>Hello</p>';... more code?> You could just do <?php ... your code ?> <p>Hello</p> <?php ... more code ?> by escaping out of PHP, we can use normal HTML code. We can even write a .php file and only have HTML code in it by not using <?php ?> tags, what purpose does it serve?, maybe just the ability to later include PHP to that file, but it's not hard renaming a .html file to .php. If you mean, you use PHP to write all your HTML code, using print or echo, there are convertors out there that can turn your HTML code to PHP, but all it's doing is putting echo statements in place of the HTML tags, escaping characters that could give php trouble and enclosing it within quotes, it's not really worth processing cycles to do HTML with php echo statements. Cheers, MC Share this post Link to post Share on other sites
avalon1405241471 0 Report post Posted October 27, 2004 You can have HTML code and PHP code in one php file.Just make sure all PHP code start with:-<?phpand end with:-?>As for HTML code, just leave it as it is, just like a normal HTML page.Need more detail explaination?Just let me know. Share this post Link to post Share on other sites