Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
get my server to select a file, then press a button on a website
Old 12-12-2009, 11:17 AM get my server to select a file, then press a button on a website
Junior Talker

Posts: 1
Trades: 0
Hi,
heres what I am trying to do. Been trying to do it in SSH or PHP as I don't have KVM or physical access to the server.

1. get my server to browse to uploadmirrors.com
2. get it to click browse and select a file, mysqlbackup53.tar.gz
3. get it to click upload.

relevant code is

the browse button code is
Code:
 
 <form name="form_upload" id="form_upload" method="post" enctype="multipart/form-data" action="#" style="margin: 0px; padding: 0px;">
and upload button is

Code:
<input src="/images/uploadbtn.gif" id="upload_button" name="upload_button" value="Upload" onclick="linkUpload();" type="image">
if anybody has any ideas on how to do this I would be very grateful
NicolaB is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 12-12-2009, 12:54 PM Re: get my server to select a file, then press a button on a website
lizciz's Avatar
Super Spam Talker

Posts: 807
Name: Mattias Nordahl
Location: Sweden
Trades: 0
You can't browse to sites and click buttons with php. You need some kind of program that you install on your computer that allows you to run macros to control the mouse and key inputs.

Or perhaps you can manually send tcp/ip headers and your file to the same address the form is sent, just like the browser does when you click the submit button. But I dont know if that's evan possible with php...
__________________
Your answers will only be as good as your question. Formulate it well and give all the necessary information.
lizciz is offline
Reply With Quote
View Public Profile Visit lizciz's homepage!
 
Old 12-12-2009, 03:28 PM Re: get my server to select a file, then press a button on a website
tripy's Avatar
Do not try this at home!

Posts: 3,621
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
Quote:
You can't browse to sites and click buttons with php
Not exactly, but you can mimic it.

For that, you need to use the Curl library (with PHP), and a request sniffer (like httpfox in firefox: https://addons.mozilla.org/en-US/firefox/addon/6647).

Go to the site you want to use, and copy, for each link you follow, which request is sent to the server (get or post).
You can see those requests and answers with httpfox.
Like:
open page www.site.com => GET http://site.com/index.php
upload the file => POST http://site.com/upload.php
show comfirm => GET http://site.com/thanks.php

Just filter what is local (IE an action => the file selection and the links/buttons click) and what is remote (IE an answer => the sending of datas back after an action)

Once you have the complete path, with the parameters sent on each requests, you can use Curl to build programmaticaly the same sequence.
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is offline
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Reply     « Reply to get my server to select a file, then press a button on a website
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.11855 seconds with 12 queries