Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Executing PHP script in TWebbrowser

Posted on 2011-02-27
9
Medium Priority
?
1,353 Views
Last Modified: 2013-12-13
I'm trying to call a website and pass/receive information back.
A php script was provided and I am trying to run it locally thru Delphi and not on a web server.
I've navigated to blankpage and loaded the following as a persistent stream into the WebBrowser-
  <http><body><? php require ("C:xxxxxxxx.php") ?></body></html>
The script has functions that can be called to pass URLs and keyword values such as
 function buildxml($item,$key).
How can I access these functions in the php script from the webbrowser page?
0
Comment
Question by:sshirey
9 Comments
 
LVL 38

Expert Comment

by:Geert Gruwez
ID: 34992744
you mean you want your delphi program actually working as a php webserver ?
0
 
LVL 84

Assisted Solution

by:Dave Baldwin
Dave Baldwin earned 225 total points
ID: 34992843
It really doesn't work that way.  PHP can be used thru the command line or on a web server to generate a page.  The PHP interpreter normally has to be called first and you get it's output (STDOUT) unless you have written a method to call PHP in your Delphi code.
0
 
LVL 9

Expert Comment

by:Mahdi78
ID: 34993143
Impossible, PHP script work just inside a webserver.
But you can execute javascript in webbrowser
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 2

Expert Comment

by:rrusch
ID: 34993260
You could run a php script in php command line interpreter. It is possible to open a browser window with php com. See http://www.tuxradar.com/practicalphp/14/1/3

If you want your application to talk to the web site you should use WinInet library.
0
 
LVL 46

Accepted Solution

by:
aikimark earned 525 total points
ID: 34994566
You could use the TIdHttp class, as illustrated in this article:

http://stackoverflow.com/questions/5050714/how-to-send-data-to-a-php-script-and-imediatelly-get-data-back-from-the-same-scri

There is also a PHP4Delphi opensource interface now at SourceForge:
http://sourceforge.net/projects/psvlib/files/PHP4Delphi/
0
 
LVL 46

Expert Comment

by:aikimark
ID: 35224312
@sshirey

We sure could use some feedback from you about our comments.
0
 

Author Closing Comment

by:sshirey
ID: 35228065
Based on information given, I created a package to perform the editting done by the php script and generate the XML page to POST.
I wish to thank everyone for their assistance.
0
 
LVL 84

Expert Comment

by:Dave Baldwin
ID: 35228267
Cool, thanks for the points.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
Suggested Courses

885 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question