473,387 Members | 1,304 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,387 software developers and data experts.

xmlhttp get + innerHTML + php embedded coding

I have a .txt file that has some PHP coding (<?php echo setUrlVariables(); ?>) embedded into it.

It worked fine (the variables actually worked) when I had my PHP file 'include("myfile.txt")' (treating the .txt file as part of the php scripting and not as plain text).

Now, I have it retrieving the .txt file from an XMLhttp get request and including it with the document.all.divID.innerHTML command.

But now it treats the "<?php...." code in the .txt file as regular text when imported. Is there any way to make it recognize the php code as code instead of plain text??

Thanks in advance for any advice!!

-John
Sep 25 '10 #1
2 1898
Dormilich
8,658 Expert Mod 8TB
the easiest way would be to rename the file to .php, as this will trigger the PHP parser to process the file.
Sep 25 '10 #2
I couldn't just rename it to .php because it didn't have any headers in it. So I ended up adding a replace() command. Thanks for the suggestion though.
Sep 28 '10 #3

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

Similar topics

12
by: Botan Guner | last post by:
Hi all, Here is the problem, i'm using Microsoft.XMLHTTP for ie and XMLHttpRequest for mozilla, on my local server which is win2000 server i've no problem with that but when i uploaded the file...
6
by: fmdevelopertim | last post by:
New to AJAX so sorry if this is simple. Have a page that gives the user a list to select a brand. Based on the brand selected it shows a list of sizes available using the following code: ...
1
by: wkerplunk | last post by:
Below is what I have build with several different languages. It works great but I need help, I am stuck. When you click on an item in the dropdown autocomplete div it does a mousedown function...
7
by: ankitoshniwal | last post by:
Hello, I have been having this problem for the whole day today, so even after i googled for the solution i was not able to get one, so i had to post to this forum. I had checked the solutions...
3
by: Andrewh | last post by:
Hi, I am having a bit of a problem with using xmlhttp. The code of the javascript file is shown below used in Windows XP. var xmlhttp = null; function SetURLDiv(url) { if...
3
by: Jeff Louie | last post by:
A bit of background. I have been asked to offer an independent programming study for high school students. I thought it would be really cool to challenge them with an embedded coding challenge on...
2
by: trpost | last post by:
Is it possible to execute javascript as passed in xmlHttp.responseText Here is what I am doing: search.js var xmlHttp xmlHttp=GetXmlHttpObject() var url="search.php"...
5
by: vinay550783 | last post by:
I have developed a web application which uses ajax to display some result in a div. Now this result works fine in explorer in xp or vista, but this when I run this page in windows CE IE 6.0...
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
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...

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.