User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 455,968 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,739 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 1221 | Replies: 4
Reply
Join Date: Jul 2006
Posts: 15
Reputation: mike4 is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 0
mike4's Avatar
mike4 mike4 is offline Offline
Newbie Poster

Question Execute Once?

  #1  
Nov 22nd, 2007
Hey,
How can I cause a block of php code be executed once using a command like the include_once();If i use this directly it includes the contents of the include file like HTML content!
What can I do?
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Aug 2007
Location: Cavite,Philippines
Posts: 508
Reputation: ryan_vietnow is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 68
ryan_vietnow's Avatar
ryan_vietnow ryan_vietnow is offline Offline
Posting Pro

Re: Execute Once?

  #2  
Nov 23rd, 2007
what block of code are you trying to execute?if php file then you can exclude your html content if you want to or better yet use functions.
"death is the cure of all diseases..."
http://ryantetek.wordpress.com
Reply With Quote  
Join Date: Jul 2007
Posts: 111
Reputation: Designer_101 is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 2
Designer_101 Designer_101 is offline Offline
Junior Poster

Re: Execute Once?

  #3  
Nov 25th, 2007
hi
Could i see the code to give me an idea of what you need.
Reply With Quote  
Join Date: Jul 2006
Posts: 15
Reputation: mike4 is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 0
mike4's Avatar
mike4 mike4 is offline Offline
Newbie Poster

Re: Execute Once?

  #4  
Nov 26th, 2007
Thanks,
Actually I made my fuction inside a loop
I a certain case it should parse only once so I thought of using the include once to do this but It printed all the contents of the included file like plain html.
I dont have the code here since I'm working in a cyber
Reply With Quote  
Join Date: Oct 2007
Location: Pennsylvania, US
Posts: 37
Reputation: maddog39 is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 3
maddog39 maddog39 is offline Offline
Light Poster

Re: Execute Once?

  #5  
Dec 1st, 2007
You can execute a block of PHP code in plain text directly. I would recommend taking a look at the eval() function, as that will allow you to do what your trying to do (as far as I know).
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb PHP Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the PHP Forum

All times are GMT -4. The time now is 9:11 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC