473,881 Members | 1,561 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

7 New Member
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 2136
pbmods
5,821 Recognized Expert Expert
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
pratibharaut
7 New Member
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
2436
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, isCenter) { //v3.0 if(window.screen)if(isCenter)if(isCenter=="true"){ var myLeft = (screen.width-myWidth)/2; var myTop = (screen.height-myHeight)/2; features+=(features!='')?',':''; features+=',left='+myLeft+',top='+myTop;
5
1885
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_ acceptable, but not char entities (such as &quote;), decimal characters (such as ‛) or style-sheet defined elements (such as <q>). Re. <meta name="description">, is a line break acceptable here? My impression is that for the enclosed descriptor...
18
1818
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
2234
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 I have been doing it right. I think I overdo it. Please have a look: -- using System; using System.IO;
11
3134
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 non-trivial exercise. inserting '&lt;' and '&gt;' causes the browser to write the text to the page as literal text rather than as the intended script element. Using escape codes seemed to work (makes it standard compliant) but the text is not written to...
1
4263
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"/> The cnlUnit01.xslt file below should recursively concatenate the string "Level", the string " ", and the numeric value of the number (level) of recursions that occur, and print that 10073 times in
6
2508
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 the bottom of the page. How can I achive the same effect in IE? Thanks
9
1363
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." In Internet Explorer of course you get total rubbish. Anything from "page cannot be loaded" to "403 no permission." The thing is, I figured the first two at least could handle it, maybe
15
16083
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 field name was spelled incorrectly. One or more of the values was blank. You tried to insert the wrong datatype (e.g. surrounded a numeric value with quotes, or forgot to put quotes around a string).
0
9927
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, weíll explore What is ONU, What Is Router, ONU & Routerís main usage, and What is the difference between ONU and Router. Letís take a closer look ! Part I. Meaning of...
0
11098
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10814
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10401
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7109
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5781
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5977
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4597
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4196
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.