Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Executing PHP script in TWebbrowser

Posted on 2011-02-27
9
Medium Priority
?
1,323 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
[X]
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
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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
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: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

This article discusses four methods for overlaying images in a container on a web page
This article discusses how to implement server side field validation and display customized error messages to the client.
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.

721 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