Jump to content
Server Maintenance This Week. ×

Using PHP functions inline in web viewer?


Justin Close

This topic is 4061 days old. Please don't post here. Open a new topic instead.

Recommended Posts

I was wondering if it is possible to use local html data (i.e. "data:text/html," & $OtherStuff) to access PHP functions?  My little tests haven't gone well so far.  Here is what I have tried:

 

Table "PHP_test"; 1 text field:  html_code

Layout:  1 edit box for PHP_test::html_code, one web viewer

    The web viewer has the 'web address' defined to be "PHP_test::html_code".  I populate the field on the layout, it shows on the web viewer (or at least that is the idea).

 

I am exploring the possibility of using some PHP functions to achieve results on FM data in the database.  My first test was simple:

<html><head><title>PHP Test</title></head>
<body>Hello World</body>
</html>
 

 

OK, that works.  Now a simple PHP test:

data:text/html,
<html><head><title>PHP Test</title></head>
<body>
<?php echo "Hello world" ; ?>
</body></html>

 

That doesn't work.  Neither does a call to:

<?php phpinfo(); ?>

 

I just get a blank web viewer.

 

 

Is it not possible to have the web viewer run PHP in this manner?

 

Thanks,

J

 

 

 

Link to comment
Share on other sites

(Hrmm...didn't get notification about this reply.  Sorry for the late response.)

 

Not doing anything 'served' up, just using FM's data URLs, defining the web viewer to be:  "data:text/html,   ...". 

 

So the full definition of the web viewer is:

 

data:text/html,
<html><head><title>PHP Test</title></head>
<body>
<?php echo "Hello world" ; ?>
</body></html>

Assuming that PHP is installed on the local machine, shouldn't that render the same in a web viewer as a client?  (Hmmm...that doesn't work in my client, either.)

 

--J

Link to comment
Share on other sites

  • 4 weeks later...

This topic is 4061 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.