Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Executing PHP script in TWebbrowser

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

Expert Comment

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

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
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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.

 
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 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 83

Expert Comment

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

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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

Suggested Solutions

Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

840 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