homepage Welcome to WebmasterWorld Guest from 107.20.131.154
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Pubcon Website
Visit PubCon.com
Home / Forums Index / Hardware and OS Related Technologies / Website Technology Issues
Forum Library, Charter, Moderators: phranque

Website Technology Issues Forum

    
Run php script from remote server
And pass username and password
aspdaddy




msg:4405496
 8:42 am on Jan 10, 2012 (gmt 0)

I need to call a php script to import data. I am doing this via VB.NET as follows


Dim myProcess As New System.Diagnostics.Process()
myProcess.StartInfo = New System.Diagnostics.ProcessStartInfo("iexplore.exe", "http://......./pages_system/datasync.php")
myProcess.Start()
myProcess.Kill()


I have put username and password on the php page but now the automation fails. Any ideas how to pass the credentials (LAMP) - any language will do ?

Thanks

 

coopster




msg:4405568
 2:58 pm on Jan 10, 2012 (gmt 0)

Are you saying that you have secured the PHP script on the remote server and it requires authentication first before it will respond to the http request?

aspdaddy




msg:4405703
 10:04 pm on Jan 10, 2012 (gmt 0)

Yes, thats right when I navigate to it manually it now prompts me to logon.

coopster




msg:4406221
 5:39 pm on Jan 12, 2012 (gmt 0)

I do not know how to do this in ASP or .NET but what I do when I need to post to a site like that is open a socket connection and handle the transaction on the server side. So your VB.NET server talks to the remote PHP-enabled server via a socket connection. A handy tool for this is cURL. Rather than open and control the socket and communication you can use the cURL API's for your particular server platform.

aspdaddy




msg:4409027
 4:01 pm on Jan 20, 2012 (gmt 0)

I think thats what the .net code is doing, somewhere beneath the TCP/IP layers in the .net line of code a socket is being created to the remote server...

I just need to figure out how to pass credentials to authenticate when challenged by the server, in any language - PHP, .Net, cURL

coopster




msg:4413550
 3:48 pm on Feb 2, 2012 (gmt 0)

The basics are laid out in the text docs on the cURL site:
[curl.haxx.se...]
and searching for something like "curl post login" or variations on that search should turn up some examples you could follow to get started. Wish I could offer more my friend.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Hardware and OS Related Technologies / Website Technology Issues
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About
© Webmaster World 1996-2014 all rights reserved