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

Storing/Retrieving/Executing Php

I want to creating an application where all my php(with html) is stored in the database.
So my index.php would find the appropriate the php file associated with the index page. It should execute this new code
as part of the original index.php. Can you please let me know if it is doable?
Thanks,
--
-Ankur Gupta
Jul 16 '05 #1
3 1885
"Ankur Gupta" <ag****@cc.gatech.edu> wrote in message
news:bi**********@solaria.cc.gatech.edu...
I want to creating an application where all my php(with html) is stored in the database. So my index.php would find the appropriate the php file associated with the index page. It should execute this new code as part of the original index.php. Can you please let me know if it

is doable?

Yes this is doable with http://php.net/eval

Why you would want to do something like that I'm not sure - a database
would be more suited to storing the data as opposed to the code.
Jul 16 '05 #2
Ankur Gupta <ag****@cc.gatech.edu> wrote in message
news:<bi**********@solaria.cc.gatech.edu>...

I want to creating an application where all my php(with html)
is stored in the database. So my index.php would find the
appropriate the php file associated with the index page. It
should execute this new code as part of the original index.php.
Can you please let me know if it is doable?


Yes. Read about the eval() function; you will have to use it
extensively:

http://www.php.net/eval

Cheers,
NC
Jul 16 '05 #3
powerboy <po******@rarextreme.com> wrote:
: "Ankur Gupta" <ag****@cc.gatech.edu> wrote in message
: news:bi**********@solaria.cc.gatech.edu...
:> I want to creating an application where all my php(with html) is
: stored in the database.
:> So my index.php would find the appropriate the php file associated
: with the index page. It should execute this new code
:> as part of the original index.php. Can you please let me know if it
: is doable?

: Yes this is doable with http://php.net/eval

: Why you would want to do something like that I'm not sure - a database
: would be more suited to storing the data as opposed to the code.

The idea is to have bunch of templates and associate them with a page. So for instance,
each user can have totally different looking index page based on their preferences.

So when a user is directed to a index.php page. This page would have the code
to find an appropriate template and render it.

I am still having problems with using eval function though. Here's what I am trying to do:

<?php
$var = "2344";
$phpCode = '<html><body><?php echo $var; ?> </body></html>';
echo $phpCode. "\n";
eval ("\$phpCode = \"$phpCode\";");
echo $phpCode. "\n";
?>
No output why??
Thanks,

--
-Ankur Gupta
Jul 16 '05 #4

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

Similar topics

5
by: Don Vaillancourt | last post by:
I'm building a system when one can upload a document to the website. I will be storing the document on the hard-drive for quick/easy access, but I was also thinking of storing it in an existing...
7
by: clr | last post by:
I like to stamp trace logs with the name of the executing Class and Method. I can get the Class Name using GetType.Name and I can get a list of every Method in the class using...
0
by: kid4rilla | last post by:
I can successfully write the binary data to an image data type, and successfully retrieve it, but when I attempt to play the file in media player after retrieving it, I get the file type isn't...
2
by: Alejandro Kwiatkowski | last post by:
How I can do to store and retrieve files to/from a fields in a SQL Server table using .NET 2.0 Thanks you in advance Alejandro
2
by: Gitesh | last post by:
Hi All, Could anyone help me out with storing PDFs into Oracle DB and then retrieving and displaying it back in the browser. Thanks in Advance, Gitesh
6
by: yasodhai | last post by:
Hi, I used a dropdown control which is binded to a datagrid control. I passed the values to the dropdownlist from the database using a function as follows in the aspx itself. <asp:DropDownList...
3
by: RSH | last post by:
Hi, I have a situation where I have created an object that contains fields,properties and functions. After creating the object I attempted to assign it to a session variable so i could retrieve...
1
by: ashishdubey | last post by:
Hi folks I am newbie in this mail api arena.what i am trying to do is storing and retrieving the messages in the database.but whenever i get the message from database and try to preview it(A...
2
by: pavanip | last post by:
Hi, I am developing one application in that i have to develop inbox and outbox functionality. I have to display message like the following format "Dear member, This is a notice to let...
0
by: VivesProcSPL | last post by:
Obviously, one of the original purposes of SQL is to make data query processing easy. The language uses many English-like terms and syntax in an effort to make it easy to learn, particularly for...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...

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.