Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Register Tags Active Topics RSS Search Mark Forums Read SiteMap

Tags: , , , , , ,

Sponsored Links



How to Switch from HTML to PHP?

Software Development


Reply
 
Thread Tools Search this Thread
  #1  
Old 05-03-2010
Beter 2 Burn Out's Avatar
Member
 
Join Date: Aug 2006
Posts: 136
How to Switch from HTML to PHP?

Hi friends,
I have completed the basic topics that are needed for doing the programs in PHP programming language. I want to know about the switching from HTML to PHP. Instead of searching on the Web, I thought it would be better to ask you since you explain the topics very clearly.!! So please explain me how to Switch from HTML to PHP? Hope that you got the point and will reply me soon.!!
__________________
AMD Sempron 2800+ @ 2Ghz
Asus A7V8X-LA
120Gb Seagate barracuda 7200Rpm Ultra-ATA 100
Elixir 512mb DDR Pc3200 (Soon 1Gb)
Club 3D Radeon 9600 256Mb
Lite-On Cd & Dvd writer combo
IDE-Dvd drive
400w Psu
Windows Xp Pro Sp2
Advent Wireless Mouse & Keyboard.
Reply With Quote
  #2  
Old 05-03-2010
Deabelos's Avatar
Member
 
Join Date: Jul 2006
Posts: 233
Re: How to Switch from HTML to PHP?

When PHP parses a file, it searches the tags of opening and closing, which define the code that must be interpreted. In this way, it allows PHP to be embedded in all kinds of documents because everything is out of opening and closing tags is ignored by PHP. Most of the time you will see php embedded in HTML documents, as in the example below :
PHP Code:
<p>This sentence is going to be ignored.</p>
<?php echo 'While this sentence is going to be parsed.'?>
<p>This sentence will also be ignored.</p>
__________________
IF you hate me, please don't mention it. I know who hates me and who doesn't. You really do not have to make fun of people....
Reply With Quote
  #3  
Old 05-03-2010
kyosang's Avatar
Member
 
Join Date: Jul 2006
Posts: 364
Re: How to Switch from HTML to PHP?

You can also use more advanced structures, like I have given below :
PHP Code:
<?php
if ($expression) {
    
?>
    <strong>This is true.</strong>
    <?php
} else {
    
?>
    <strong>This is false.</strong>
    <?php
}
?>
This works as expected, because when PHP encounters the closing tag?>, It simply starts outputting whatever it finds until that it hits another opening tag. The example above is simple, of course, but for outputting large blocks of text, the shelving of this type of block analyzer PHP more efficient than sending the entire text using the functions echo() or print().
__________________
"When they give you ruled paper, write the other way..." J.R.J.
Reply With Quote
  #4  
Old 05-03-2010
Allan.d's Avatar
Member
 
Join Date: Mar 2008
Posts: 672
Re: How to Switch from HTML to PHP?

There are four different pairs of opening and closing tags which can be used in PHP. Two of those, <? Php?> And <script language="php"> </ script>, are always available. The other two are short tags and ASP style tags, and can be activated or deactivated from the configuration file php.ini. However, despite the fact that people find short tags and ASP style tags practices, they are less portable and therefore generally not recommended. Also note that if you are embedding PHP within XML or XHTML you must use the <? Php?> so that you can remain compliant with standards.
Reply With Quote
  #5  
Old 05-03-2010
Reegan's Avatar
Member
 
Join Date: Oct 2005
Posts: 2,299
Re: How to Switch from HTML to PHP?

The following is the PHP Opening and Closing Tags that could be useful for you in switching from HTML to PHP :
PHP Code:
<?php echo 'You want to change XHTML or XML documents, do it like this'?>
 
  <script language="php">
        
echo 'some editors eg. FrontPage don\'t
              like processing instructions'
;
    
</script>
 
  <? echo 'this is the simplest, an SGML processing instruction'?>
    <?= expression ?> This is a shortcut for "<? echo expression ?>"
 
  <% echo 'You may optionally use ASP-style tags'; %>
    <%= $variable; # This is a shortcut for "<% echo . . ." %>
Reply With Quote
  #6  
Old 05-03-2010
Zecho's Avatar
Member
 
Join Date: May 2008
Posts: 2,267
Re: How to Switch from HTML to PHP?

Short tags are available that if they were enabled via the short_open_tag configuration file php.ini or if PHP was configured with - enable-short-tags. The ASP style tags are only available when enabled via the asp_tags configuration file php.ini. You should keep in mind that using short tags should be avoided when developing applications or libraries that are meant for redistribution, or deployment on servers that are not under your control, because short tags may not be supported on the target server. To make portable code that can be redistributed, never use short tags.
Reply With Quote
Reply

  TechArena Community > Software > Software Development


Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "How to Switch from HTML to PHP?"
Thread Thread Starter Forum Replies Last Post
Managed switch network speed vs. unmanaged switch network speed LLoLL Networking & Security 6 22-07-2011 08:28 PM
Toshiba a665 s6050 eco wireless switch, Led switch and play/pause are not working Emilian Portable Devices 4 14-04-2011 03:06 PM
Switch the 'action' field in an HTML form MarceloQuad Software Development 4 07-02-2010 06:05 AM
How to define HTML Validator and services provided by HTML Validator Aldous Software Development 3 22-09-2009 02:12 PM
How do I get the HTML code to display as HTML code? NAYASA Software Development 3 26-12-2008 01:35 PM


All times are GMT +5.5. The time now is 04:15 AM.