Go Back   Web Server Hosting Forum by BODHost > Support > PHP Forum
 

Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old 05-24-07, 11:38
BOD Member
 
Join Date: Jul 2006
Posts: 107
Default How to Mix Xhtml and PHP?

In order to mix Xhmtl and PHP, it must be set with PHP start / End tags.


"<"""!DOCTYPE html PUBLIC "-//W3C//DTD/XHTML 1.0 Transitional//EN""""
""""http://www.w3.org/TR/xhtml1/DTD/xhtml11-transitional.dtd"""">

<""""html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"""">
<""head""">
<"""title""">A Web Page</title""">
<"""/head""">
<"""body""">

<"""p""">
<"""?php echo "learn basic";?""">
<"""/p""">

<"""p""">
<"""?print "Here's a mix!";?""">
<"""/p""">

<"""p""">

<"""script language="php"""">
"""$myvar = "Everything is fine"""";
"""echo $myvar""";
<"""/script""">

<"""/p""">

<"""/body""">
<"""/html""">

The above includes the following -

Three PHP block in Xhtml document -

First block -

<"""php ... ?""">

Open and close tag

It also uses PHP echo

The second uses <"""? ... ?"""> inorder to mark the beginning the start and end

It uses PHP print in order to display the text

The Third block uses <"""script language="php""""> ... <"""/script"""> to give it to start and end of PHP code

*Please remove """ from all lines before applying
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump


All times are GMT -6. The time now is 22:30.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
Copyright © 1999-2012, BODHost Ltd. All rights reserved.