Avatar of Igiwwa
Igiwwa

asked on 

Include PHP in VB script

Hey,

I have an access database and that generates a html file as output(eg:output.html) if I execute a form in access. This form has VB script in the backend and so its writing out to a html file.  In that html I would like to include some dynamic data using php. I have the php file workng fine if its executed directly but I want it to be as an include file in the VB script so that I will get the output in HTML file.To achieve that  I am trying to see how to include php file in the ms access VB script code(for the the form). Can anyone guide me with this?

Thanks.
PHPVB Script

Avatar of undefined
Last Comment
Igiwwa
Avatar of purplepomegranite
purplepomegranite
Flag of United Kingdom of Great Britain and Northern Ireland image

The only way you could possibly get this to work would be to process the php by directly sending the php script to php.exe.  However, you wouldn't be able to send or return any parameters.

PHP is a web-language, it primarily works on a web-server.  What you would be best doing is converting the PHP to VB to run it natively in Access.
Avatar of anakinjay
anakinjay

purple is right.

PHP is a server-side language.

What you're trying to do requires a client-side language.
Avatar of Igiwwa
Igiwwa

ASKER

Hi

Thanks both for the reply but I would need to use parameters as  I am trying to get the data from db using this php script and showing it up in the html page. Can you please explain more about converting PHP to VB? You mean I can write this php code in VB type?

thanks
Yes, basically whatever the PHP code does you can implement in VB.  VB can do whatever PHP can.  And converting is basically writing the PHP code in VB, yes.  Fortunately as they are both high-level languages, this isn't usually a huge task.
Avatar of anakinjay
anakinjay

Here's the general concept of what you need to do.  I can't answer the fine details, but a quick google or two should do the trick for you.

Your php script will be acting like a data source instead of a web page.  Have it get all the information you need from the DB, and echo it out in XML format.

Then in VB, load the XML from php by loading it's url.  (http://yourserver.com/yourphpfile.php)

Then use the information from the XML file in VB to create your HTML output file.
Avatar of Igiwwa
Igiwwa

ASKER

Hey

Again thanks both for the reply. So basically I should get my php script out to a XML file and then include this xml insde the VB script of my access db then that should generate the required output when I create the html  right?

 I do not have good idea in VBscript so can you please tell me  how to  inlcude/call  xml inside VBscript?

I will try this xml method and update here.

thanks
Avatar of Igiwwa
Igiwwa

ASKER

hey

forgot to mention this : The html that is created from access is going to have different content for each day and this php script output also corresponds to this html page...so here how can I get the xml for the html file if I cannot include php script in VB?

thanks.
ASKER CERTIFIED SOLUTION
Avatar of anakinjay
anakinjay

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of Igiwwa
Igiwwa

ASKER

hey,

I had that in my mind that the output  interpretation is XML and not as PHP..

I will see the link you gave and try to implement it. Again thanks.

I will reply after I try out this and accept as solution.

thanks
PHP
PHP

PHP is a widely-used server-side scripting language especially suited for web development, powering tens of millions of sites from Facebook to personal WordPress blogs. PHP is often paired with the MySQL relational database, but includes support for most other mainstream databases. By utilizing different Server APIs, PHP can work on many different web servers as a server-side scripting language.

125K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo