473,386 Members | 1,969 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,386 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 1466
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.