473,394 Members | 1,739 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Error occurs in XHTML pages when i write php code inside it

Hello friends,

I am trying to make XHTML pages with PHP . But when i write the php code it doesnt work. It works for plain XHTML.
For run that pages i am using WAP Proof software.

The code is here

--------------test.xhtml----------------
Expand|Select|Wrap|Line Numbers
  1. <!DOCTYPE html
  2. PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  3. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  4. <html>
  5. <head>
  6. <title>Sample code</title>
  7. </head>
  8. <body>
  9. <form action="test2.xhtml" method="post">
  10.       Search For:<input type="text" name="txt" value="" id="txt" size="25" />
  11.       <input type="submit" name="submit" value="submit"  />
  12.  
  13.   </form>
  14. </body>
  15. </html>
  16.  
[Please use CODE tags when posting source code. Thanks! --pbmods]

----------test2.xhtml--------
Expand|Select|Wrap|Line Numbers
  1. <!DOCTYPE html
  2. PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  3. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  4. <html>
  5. <head>
  6. <title>Sample code1</title>
  7. </head>
  8. <body>
  9.  
  10.     <p align="center" > Hello <?php echo $_POST['txt']; ?></p>
  11.  
  12. </body>
  13. </html>
  14.  

When I run test.xhtml file then following message occurs

" Binary data (application/octet-stream)
Click "Open in Shell" button to open " .

When i click on open in shell button then nothing happens.WAP software is not registered yet but another sample code is running properly on this WAP Proof software .

If I remove PHP tag from second code then also it works fine. Is there any settings for using the XHTML with PHP?

Pls tell where I am wrong

Thanks in advance
Pratibha
Jun 7 '07 #1
2 2118
pbmods
5,821 Expert 4TB
You need to configure your webserver to parse PHP files and serve them as web pages.

If you're using Apache on Mac or Linux, add the following lines to your httpd.conf file:
Expand|Select|Wrap|Line Numbers
  1. LoadModule php5_module        modules/libphp5.so
  2. AddType application/x-httpd-php .php
  3.  
Jun 7 '07 #2
Thank you for your kind reply.
But I am using this appliaction on windows (using XAMPP).

Will you pls tell me this for windows .
Jun 9 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Kerberos | last post by:
When I deliver a page as text/html, the javascripts work, but if delivered as application/xhtml+xml, the javascripts don't work: function OpenBrWindow(theURL,winName,features, myWidth, myHeight,...
5
by: Haines Brown | last post by:
Re. <title>, my impression has been that a line break is _NOT_ allowed in the contained text. Is that true? Also, I gather a double quotation mark in the text string (and ampersand, etc.) _IS_...
18
by: Geoff Cox | last post by:
Hello, I am trying to print out the array values for a second time but get error on page message? Thanks Geoff <html>
9
by: Gustaf | last post by:
I'm confused about structured error handling. The following piece of code is a simplification of a class library I'm working on. It works, and it does what I want, but I'm still not convinced that...
11
by: Michael Powe | last post by:
How can I make an XHTML-compliant form of an expression in this format: document.write("<scr"+"ipt type='text/javascript' src='path/to/file.js'>"+"</scr"+"ipt>"); this turns out to be a...
1
by: nancyisbell | last post by:
I used the following test01.xml file below to exercise the cnlUnit01.xslt. <?xml version="1.0"?> <?xml-stylesheet type="text/xsl" href="cnlUnit01.xslt"?> <cnlUnitXsl unitDataFile="111111"/> ...
6
by: Harris Kosmidhs | last post by:
Hello. Please check http://www.mavridis-hotel.gr/prices.php In FF the table -which is wide- goes way of the container it's in. And it displays nice. In IE7 since it doesn't fit it renders to...
9
by: -Lost | last post by:
In Firefox and Safari for example, if I serve my XHTML documents as application/xml or xhtml+xml they only display the top inch or so of the document. In Opera it says "object has been blocked."...
15
by: Dave | last post by:
I am getting the error above intermittantly with an ASP 3.0 page using an MS Access 2003 database. I have searched Google extensively and found the following possible causes for this error: A...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.