473,406 Members | 2,849 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Running PHP script in background

Jim
Hello,

After downloading a file, my WinForms application needs to run a PHP
script online. This PHP script deletes the downloaded file from the
online server.

How can I program my application to use a thread or something similar to
call this PHP script in the background? I don't want to use
Process.Start as that would open up a browser window.

Thank you for your time,
Jim
Nov 22 '05 #1
2 1467
Jim wrote:
Hello,

After downloading a file, my WinForms application needs to run a PHP
script online. This PHP script deletes the downloaded file from the
online server.

How can I program my application to use a thread or something similar to
call this PHP script in the background? I don't want to use
Process.Start as that would open up a browser window.

Thank you for your time,
Jim


Net namespace of the framework has various classes to do web requests.
If you use HttpWebRequest, it might work, try it:

using System.Net;
WebRequest r = WebRequest.Create("http://something.com/some.php");

if the server is configured to execute php before serving, it will
execute php before sending a response.

I have not tried it, so you might have to add a response to this too to
actually execute:

(code following previous one)
WebResponse res = r.GetResponse();
res.Close();

Laimis
Nov 22 '05 #2
Jim wrote:
Hello,

After downloading a file, my WinForms application needs to run a PHP
script online. This PHP script deletes the downloaded file from the
online server.

How can I program my application to use a thread or something similar to
call this PHP script in the background? I don't want to use
Process.Start as that would open up a browser window.

Thank you for your time,
Jim


Net namespace of the framework has various classes to do web requests.
If you use HttpWebRequest, it might work, try it:

using System.Net;
WebRequest r = WebRequest.Create("http://something.com/some.php");

if the server is configured to execute php before serving, it will
execute php before sending a response.

I have not tried it, so you might have to add a response to this too to
actually execute:

(code following previous one)
WebResponse res = r.GetResponse();
res.Close();

Laimis
Nov 22 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Sticks | last post by:
ok... im not quite sure how to describe my problem. i have a php script that runs through my entire php site and writes the resulting output to html files. this is necessary as the nature of the...
7
by: Arun | last post by:
Hi, This is a scripting question, but since I am writing the script in python I am posting this question here: I have a python script that runs a simulator (that was written in c++, so I use...
3
by: Harlin Seritt | last post by:
Hi, I have a script.py that is converted to .exe using py2exe. From another script I call script.exe and would like to be able to run this script.exe in the background (as well as in console --...
2
by: Lord Merlin | last post by:
Hi there Can someone please tell me how to run a script in the background? I have a stored procedure, which gathers a lot of info on various tables in a MSSQL , and from that rebulds a large...
5
by: Ben Dewey | last post by:
This is a repost, But I have some new information. I have a server that is configured for .NET 1.1 and 2.0. For some reason all my postback events for aren't firing when using .NET 1.1. Under...
1
by: Anonieko | last post by:
Query: How to display progress bar for long running page Answer: Yet another solution. REFERENCE: http://www.eggheadcafe.com/articles/20050108.asp My only regret is that when click the...
2
by: Dave Hughes | last post by:
Just noticed something rather annoying after upgrading my test box (a Linux server running DB2 UDB v8 for LUW) to fixpak 11 (for reference it was previously on fixpak 7). In the past I've relied...
13
by: wattersmt | last post by:
Hello, I am trying to write a python cgi that calls a script over ssh, the problem is the script takes a very long time to execute so Apache makes the CGI time out and I never see any output. ...
5
by: This | last post by:
I have a pretty basic emailing script that sends a relatively small number (150) of html emails. The emails are compiled, personalised from a mysql db subscribers list, and sent using mail() -...
5
by: camphor | last post by:
hi, I have found an upload script in hotscripts and have implemented it into the website, I followed the installation steps to 'give write permissions to php on the upload folder (which is...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.