Solved

Executing PHP script in TWebbrowser

Posted on 2011-02-27
9
1,241 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 36

Expert Comment

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

Assisted Solution

by:Dave Baldwin
Dave Baldwin earned 75 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
 
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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 45

Accepted Solution

by:
aikimark earned 175 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 45

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 82

Expert Comment

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

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

707 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now