| | 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 |
|
|
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.
Sorry, I don't use PHP, I use an IPB for my site.
QUOTE(shahzadkhandotcom @ Oct 11 2004, 09:59 AM) 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 Your question is a bit hard to understand. You can escape and re-enter php. Instead of doing something like CODE <?php ... your code echo '<p>Hello</p>'; ... more code ?> You could just do HTML <?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
You can have HTML code and PHP code in one php file.
Just make sure all PHP code start with:- <?php and 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. |
|
![]() PHP Help |