Jump to content
xisto Community
Sign in to follow this  
shahzadkhandotcom

PHP Help

Recommended Posts

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

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

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | 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.