473,770 Members | 2,781 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

using echo but need something to execute php code

I have some code that loads up some php/html files and does a few things to
them and ultimately returns an html file with some php code in it. I then
pass that file onto the user by using echo. Of course then the file doesn't
get seen by the user.

Is there any command that essentially executes the code and then echo's it?

something that will take a string like

'<body>blah<?ph p echo 'Hello'; ?></body>' and actually interpret the php
code?

e.g., doing

echo '<body>blah<?ph p echo 'Hello'; ?></body>';

does me no good caues the php code isn't interpreted.

Saving it to a file and then redirecting the user to that file so it will be
executed seems like a roundabout way and causes more problems.
essentially I am trying to include php/html files in one another but I need
to do some parsing on them first. I'd rather not do something like
file_get_conten ts($Page)
parse($Page)
save($Page)
include "$Page"
as it seems uncessary to have to write the page to disk just to include it.

At

http://us2.php.net/include/
"Another way to "include" a PHP file into a variable is to capture the
output by using the Output Control Functions with include(). For example:"

Seems like I might be able to use that to replace when I use
file_get_conten ts to get the php code to execute?

Thanks,
Jon

Apr 28 '07
25 3131

"Toby A Inkster" <us**********@t obyinkster.co.u kwrote in message
news:1s******** ****@ophelia.g5 n.co.uk...
Jon Slaughter wrote:
>file_get_conte nts($Page)
parse($Page)
save($Page)
include "$Page"

as it seems uncessary to have to write the page to disk just to include
it.

Mount an area of RAM as a virtual disk.
Ok, thats something new, I haven't done anything like that. I'll have to
look into it.

Thanks,
Jon
Apr 29 '07 #21
>
Maybe if you would have explained it this way in the start you would have
gotten better answers. This is NOT the problem you started with!
It is exactly the problem I started with. I might have not explained as well
but that is entirely different.
As it is, I can think of a couple of ways to do it. But after seeing the
way you treat people trying to help you, I'm not inclined to post them.
Well, its your choice. I might have overreacted and then that was my fault.
Now that I look at my original post I can see how it doesn't explain it that
well. I thought it was clear at the time.. in any case you just have to look
at the line

"Is there any command that essentially executes the code and then echo's
it?"

you know, Janwillem had no problem with it and he was the first to post. So
it can't be all that unclear.

I just don't like people trying to dictate to me how I'm suppose to think or
what I am thinking about.

"The answer was correct. It's the question we are having a problem with"

Thats just total BS. Now maybe I did overreact. If so then I apologize.
But when I read that I read that Geoff is telling me that my question is
wrong. I'll be damned if questions are wrong. Questions are not
propositions. He could have just said "Hey, I don't understand what your
exactly trying to do." instead of trying to make seem like I'm wrong and
he's right kinda crap. Its not about who's smarter or who's wrong or right
but about solving the problem.
In any case. Whether it was clear or not is unimportant at this point.
Janwillem got it from the start and even if my post was completely unclear
then someone should have been asking "Why would Janwillem say that instead
of what Toby said"?.

Hell, maybe I did overreact but statements like

"The answer was correct. It's the question we are having a problem with"

just piss me off to no end ;/ Its like someone trying to tell me that wrong
answers are right because its the question thats wrong. If I did that in a
class on a test and then after the test went up to him and said "no, the
answer is 1. Your question: "1+1="? is wrong because it should have been
"1+0="". You think he would say "Hey, thats great; Your right!! You get an
A+"? Even in a philosophy class that wouldn't work... even more so.
Wouldn't work in a business either. Its just wrong and Geoff is trying to
feed me that BS.

Jon
Apr 29 '07 #22
Jon Slaughter wrote:
>Maybe if you would have explained it this way in the start you would have
gotten better answers. This is NOT the problem you started with!

It is exactly the problem I started with. I might have not explained as well
but that is entirely different.
>As it is, I can think of a couple of ways to do it. But after seeing the
way you treat people trying to help you, I'm not inclined to post them.

Well, its your choice. I might have overreacted and then that was my fault.
Now that I look at my original post I can see how it doesn't explain it that
well. I thought it was clear at the time.. in any case you just have to look
at the line

"Is there any command that essentially executes the code and then echo's
it?"

you know, Janwillem had no problem with it and he was the first to post. So
it can't be all that unclear.

I just don't like people trying to dictate to me how I'm suppose to think or
what I am thinking about.

"The answer was correct. It's the question we are having a problem with"

Thats just total BS. Now maybe I did overreact. If so then I apologize.
But when I read that I read that Geoff is telling me that my question is
wrong. I'll be damned if questions are wrong. Questions are not
propositions. He could have just said "Hey, I don't understand what your
exactly trying to do." instead of trying to make seem like I'm wrong and
he's right kinda crap. Its not about who's smarter or who's wrong or right
but about solving the problem.
In any case. Whether it was clear or not is unimportant at this point.
Janwillem got it from the start and even if my post was completely unclear
then someone should have been asking "Why would Janwillem say that instead
of what Toby said"?.

Hell, maybe I did overreact but statements like

"The answer was correct. It's the question we are having a problem with"

just piss me off to no end ;/ Its like someone trying to tell me that wrong
answers are right because its the question thats wrong. If I did that in a
class on a test and then after the test went up to him and said "no, the
answer is 1. Your question: "1+1="? is wrong because it should have been
"1+0="". You think he would say "Hey, thats great; Your right!! You get an
A+"? Even in a philosophy class that wouldn't work... even more so.
Wouldn't work in a business either. Its just wrong and Geoff is trying to
feed me that BS.

Jon

Jon,

Well, get over it. He answered the question you asked. Then you told
him it wasn't the answer you wanted.

You asked if "Is there any command that essentially executes the code
and then echo's it?". include() does exactly that.

The fact is, you don't want to just execute and echo the code. Now you
tell us you want to modify results before it's output. That's a
different problem.

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===
Apr 29 '07 #23
Well, get over it. He answered the question you asked. Then you told him
it wasn't the answer you wanted.
No, thats the point. he didn't answer it. He answered the question he
thought I asked and then when I said it wasn't Geoff has to jump in and give
me some BS.
You asked if "Is there any command that essentially executes the code and
then echo's it?". include() does exactly that.
yeah, and if thats all you read of my post then obviously your going to post
the wrong thing. Maybe its not clear because you fail to read the full post?

How bout reading the full post? Is that to much to ask?

"essentiall y I am trying to include php/html files in one another but I need
to do some parsing on them first. I'd rather not do something like"

If that isn't clear then I don't know what is.
The fact is, you don't want to just execute and echo the code. Now you
tell us you want to modify results before it's output. That's a different
problem.
I said that. I'm not going to bother wasting energy quoting my original post
but if you bother to actually look at it then you'll see thats exactly what
I said. It might not have been clear but it was obviously clearn enough for
Janwillem.
Apr 29 '07 #24
Message-ID: <FV************ *****@newssvr27 .news.prodigy.n etfrom Jon
Slaughter contained the following:
>No, thats the point. he didn't answer it. He answered the question he
thought I asked and then when I said it wasn't Geoff has to jump in and give
me some BS.
Frankly I wish I'd made a much more critical comment. Then at least I'd
feel I deserved this outpouring of angst.

Still if it relieves your tension feel free to continue acting like an
arse.

--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Apr 29 '07 #25
Jon Slaughter wrote:
>Well, get over it. He answered the question you asked. Then you told him
it wasn't the answer you wanted.

No, thats the point. he didn't answer it. He answered the question he
thought I asked and then when I said it wasn't Geoff has to jump in and give
me some BS.
If that wasn't the question you asked, then you are not clear with your
question. IME Geoff is pretty knowledgeable and accurate in his response.
>You asked if "Is there any command that essentially executes the code and
then echo's it?". include() does exactly that.

yeah, and if thats all you read of my post then obviously your going to post
the wrong thing. Maybe its not clear because you fail to read the full post?
Or maybe it's not clear because you don't explain thoroughly?
How bout reading the full post? Is that to much to ask?
I did. And I came to the same conclusion Geoff did.
"essentiall y I am trying to include php/html files in one another but I need
to do some parsing on them first. I'd rather not do something like"

If that isn't clear then I don't know what is.
That's perfectly clear. As clear as mud.
>The fact is, you don't want to just execute and echo the code. Now you
tell us you want to modify results before it's output. That's a different
problem.

I said that. I'm not going to bother wasting energy quoting my original post
but if you bother to actually look at it then you'll see thats exactly what
I said. It might not have been clear but it was obviously clearn enough for
Janwillem.

And I'm not going to bother wasting my energy trying to answer someone
who 1) doesn't make his question clear, and 2) attacks people trying to
help him.

Even if I got paid for this (I don't), I've put in too many years to put
up with your BS.

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===
Apr 30 '07 #26

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
19885
by: Dariusz | last post by:
I have a problem where I need to pass two variables using GET from a form I have, to solve a page selection problem I have. The code is written that if a new visitor arrives at the front page of the site, because the page id is null, PHP loads the default design. But when I execute one of my other pages which has a form on it, because I cannot pass back the id of the page that the form is on (the "submit" GET's the desired page id...
2
3227
by: Tobias Hesselmann | last post by:
Hi folks, i have a problem using a PHP script as a custom handler in Apache. What i wanna do is this: Whenever a .html file is requested by a browser, i want Apache to call a CGI that outputs a header, then the requested file and then a footer. I want to use PHP for this, as i also want to do some template parsing. Well, basically, this can be done using Apache's mod_action module,
9
11234
by: Lauren Quantrell | last post by:
Is there a way to create a text file (such as a Windows Notepad file) by using a trigger on a table? What I want to do is to send a row of information to a table where the table: tblFileData has only one column: txtOutput I want to use the DB front end (MS Access) to send the text string to the SQL backend, then have the SQL Server create a file to a path, such as F:/myfiledate.txt that holds the text in txtOutput, then the trigger...
11
6600
by: Grasshopper | last post by:
Hi, I am automating Access reports to PDF using PDF Writer 6.0. I've created a DTS package to run the reports and schedule a job to run this DTS package. If I PC Anywhere into the server on where the job is running, the job runs sucessfully, PDF files got generated, everything is good. If I scheduled the job to run at the time that I am not logged into the server, Access is not able to print to the printer. The error is pretty...
16
3499
by: Ian Davies | last post by:
Hello Needing help with a suitable solution. I have extracted records into a table under three columns 'category', 'comment' and share (the category column also holds the index no of the record in a hidden field) I wish the user to be able to edit the data in the table, so I have extracted the records into hiddenfield, textareas, dropdown list and checkbox so that they can make changes. I named these elements as arrays and wish to run an...
1
4704
by: balas1 | last post by:
hi i need to execute unix command from browser. but i cant get any output in my browser side.. need to enable anything to execute unix command from browser using php my coding is <?php $output = exec('ls -lart');
221
367728
Atli
by: Atli | last post by:
You may be wondering why you would want to put your files “into” the database, rather than just onto the file-system. Well, most of the time, you wouldn’t. In situations where your PHP application needs to store entire files, the preferred method is to save the file onto the server’s file-system, and store the physical location of the file in your database. This is generally considered to be the easiest and fastest way to store files. ...
1
1601
by: =?Utf-8?B?Sm9obkJhdGVz?= | last post by:
Problem: I need to backup and clear the security event log. I have this working via a vbsscript which I will post below. However while I can use this script manually it is not user friendly and my end users who have to perform the backup and clear chore weekly are the "where is the button" types. I have written a vb.net 2005 gui as a front end that can launch my script and run it ok but the problem is since it is a script running in a...
6
1860
by: BOMEz | last post by:
So i've recently been starting to program PHP in an object oriented way, but I'm running into some difficulties in from a design stand point and from an object oriented stand point: Issue 1: In my class I cannot give visibility to any variable, it simple breaks everything. For example if I do: private $private = 'Private'; I get the error : The error is the same if I use public or protected. I have tried declaring a a private variable in...
0
9591
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
9425
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10057
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10002
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
8883
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7415
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6676
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();...
1
3970
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
3
2816
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.