PHP equivelent of the ASP 'execute' command

  • Cae
  • Expert
  • Expert
  • User avatar
  • Posts: 734

Post 3+ Months Ago

ive been looking on google all day trying to find the PHP equivelent of the ASP 'execute' command, havent had any luck... do any of you know what it is, or if it is possible? ty
  • Axe
  • Genius
  • Genius
  • User avatar
  • Posts: 5739
  • Loc: Sub-level 28

Post 3+ Months Ago

You know, I just figured I'd try http://www.php.net/execute for a laugh, and while there is no function by that name, guess what the first suggestion was? :)

http://www.php.net/exec

;)
  • Cae
  • Expert
  • Expert
  • User avatar
  • Posts: 734

Post 3+ Months Ago

i dont want to exucute an external program, i want to store PHP code in a table different pages, and the execute that code inside my template page when you go to that page... i was looking at that page you had... i think that this: <a href = "http://us4.php.net/manual/en/function.oci-execute.php">oci_execute</a> might be what im looking for... im not able to get to the source to try it atm... but is this what im looking for?
  • Axe
  • Genius
  • Genius
  • User avatar
  • Posts: 5739
  • Loc: Sub-level 28

Post 3+ Months Ago

in a table? database table? <table>? I don't get what you mean.

Try http://www.php.net/eval
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Posts: 23455
  • Loc: Woodbridge VA

Post 3+ Months Ago

Axe. *lol you can't add an HTML element to your post without turning off HTML - especially <table> - it whacks the whole post. *wink

For reference, this is what the ASP execute command does:

http://www.webdesignforums.net/showthread.php?t=13440

I don't know if that will help or not. I don't know the php equiv either.
  • Cae
  • Expert
  • Expert
  • User avatar
  • Posts: 734

Post 3+ Months Ago

sorry... sql database table...
yes, ATNO, that is what i meant...

im going to go sit in my corner now...
  • diverdan
  • Beginner
  • Beginner
  • diverdan
  • Posts: 46
  • Loc: Alabama, USA

Post 3+ Months Ago

include() ?
  • Cae
  • Expert
  • Expert
  • User avatar
  • Posts: 734

Post 3+ Months Ago

that includes a separate php file doesnt it???
  • Axe
  • Genius
  • Genius
  • User avatar
  • Posts: 5739
  • Loc: Sub-level 28

Post 3+ Months Ago

Ok, so yo have PHP code stored in a record, inside a database table.

Load that code into a string array, then look at the URL I pasted above...

http://www.php.net/eval

:)
  • Axe
  • Genius
  • Genius
  • User avatar
  • Posts: 5739
  • Loc: Sub-level 28

Post 3+ Months Ago

ATNO/TW wrote:
Axe. *lol you can't add an HTML element to your post without turning off HTML - especially <table> - it whacks the whole post. *wink


Oops... well, gotta get the Super Mods doing at least SOME work fixing stuff for the rest of us ;)

hehe
  • ATNO/TW
  • Super Moderator
  • Super Moderator
  • User avatar
  • Posts: 23455
  • Loc: Woodbridge VA

Post 3+ Months Ago

*lol -- Axe...when you quote a quote that has an HTML element in it, you still have to turn off HTML when you post...Thanks anyway...that's twice I fixed it -- third time's a charm!
  • Axe
  • Genius
  • Genius
  • User avatar
  • Posts: 5739
  • Loc: Sub-level 28

Post 3+ Months Ago

lmao ;)

Sorry, I really didn't mean to do that :D
  • Carnix
  • Guru
  • Guru
  • User avatar
  • Posts: 1098

Post 3+ Months Ago

Perhaps the best way to do this would be to use a dynamic include file...

In other words, you create a temp file and dump the PHP code into it, then include that temp file. In theory, this would execute that file as if it were part of that page.... Then at the bottom of your template, you can simply delete the file. Since it's a temp file, it will have permissions based on the PHP engine, so you shouldn't run into problems.

I'm not sure about the order PHP does includes though, ASP runs all SSI commands first, then goes back and runs ASP commands, so this wouldn't work in ASP (hence the execute method). I've not tried anything like this in PHP myself, since I find it easier to write PHP function libraries that are included automatically as part of a template, and excecuted as needed, instead of having to maintain many pages (or in your case, records) of PHP (or ASP, or JavaScript, or whatever I'm developing in).

.c
  • guitrspaz
  • Graduate
  • Graduate
  • guitrspaz
  • Posts: 106
  • Loc: Baltimore, MD

Post 3+ Months Ago

OR write a function and then call it in the template...wouldn't that work ok? i mean, for example, if you were to use a loop command, the function would carry out the loop and the template would display it as a "static element" so to speak
  • Axe
  • Genius
  • Genius
  • User avatar
  • Posts: 5739
  • Loc: Sub-level 28

Post 3+ Months Ago

or just use eval() (That's how vBulletin does it. That's how you can have PHP code in your page templates)
  • Cae
  • Expert
  • Expert
  • User avatar
  • Posts: 734

Post 3+ Months Ago

Axe wrote:
or just use eval()


ya, that was it, ty Axe... sorry i sorta dorped this topic, stuff got hectic, and i forgot about it... but it works now! yay! ty again
  • Axe
  • Genius
  • Genius
  • User avatar
  • Posts: 5739
  • Loc: Sub-level 28

Post 3+ Months Ago

:)

Post Information

  • Total Posts in this topic: 17 posts
  • Users browsing this forum: No registered users and 83 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.