473,386 Members | 1,733 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.

filling out forms through proxies with php

i'm connecting to the internet via a proxy, and am having problems
filling out forms... below is the code i have, and below that is the
http request i am trying to make it look like. they look the same to
me, but it isn't working, so i guess they aren't...

$proxy = fsockopen("tcp://someaddresshere", 80, $errno,
$errstr);
$temp = "somethingelse=blablabla";
fputs($proxy,"GET somesite HTTP/1.0\r\n");
fputs($proxy,"Accept: */*\r\n");
fputs($proxy,"Referer: http://someothersitesite\r\n");
fputs($proxy,"Content-Type:
application/x-www-form-urlencoded\r\n");
fputs($proxy,"Content-Length: " . strlen($temp) . "\r\n\r\n");
fputs($proxy,$temp . "\r\n");
while (!feof($proxy))
print fgets($proxy);
fclose($proxy);

with that script, i don't get anything. however, with this http
request, from opera 7.10, i do:

POST http://somesite HTTP/1.0
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1) Opera
7.10 [en]
Host: somesite
Accept: text/html, image/png, image/jpeg, image/gif, image/x-xbitmap,
*/*;q=0.1
Accept-Language: en;q=1.0
Accept-Charset: windows-1252, utf-8, utf-16, iso-8859-1;q=0.6, *;q=0.1
Accept-Encoding: deflate, gzip, x-gzip, identity, *;q=0
Referer: http://someothersite
Proxy-Connection: close
Content-type: application/x-www-form-urlencoded
Content-length: xx

somethingelse=blablablaHTTP/1.1 200 OK
Via: 1.1 DELTANS
Connection: close
Content-Type: text/html
Date: Fri, 20 Jun 2003 17:54:37 GMT
Server: Apache/1.3.27 (Unix) (Red-Hat/Linux) mod_ssl/2.8.12
OpenSSL/0.9.6b DAV/1.0.2 PHP/4.1.2 mod_perl/1.26
X-Powered-By: PHP/4.1.2
Set-Cookie: PHPSESSID=6c6baebea48c1ee4ad562d7fef3a46a4; path=/
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0,
pre-check=0
Pragma: no-cache
Set-Cookie: something
Set-Cookie: something

now the last part of the http request isn't a request persay, but
whatever, hehe :)

anyways... any ideas as to what i'm doing wrong? thanks! :)
Jul 16 '05 #1
0 2218

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

Similar topics

0
by: hboothe_no_spam | last post by:
Hello, all, I've read through both of the groups I'm posting to, and all over the groups, regarding filling PDF forms with data from VB. I have Acrobat 5 (and the SDK), and am using VB 6. I can...
10
by: Clive Backham | last post by:
I tried posting this on comp.infosystems.www.misc, but that group appears to get very little traffic. So now I'm trying here. If there is a more appropriate group, please let me know. I'm...
1
by: Krzysztof Karnicki | last post by:
I have such a problem… I have create my custom DataGridColumn inheriting from System.Windows.Forms.DataGridColumnStyle on using it on DataGrid, to show rows painted by me self. Because dates ...
4
by: Molina | last post by:
Hi !!! I have a VB.Net application that consumes an WebService. The problem is that the HTTP address works fine, but it will change to an HTTPS address, and it isn't working. The weird thing...
6
by: | last post by:
Hi, can someone provide some advise on how to get around with using auto generated proxies? basically I already have the proxy classes, and they are used by other places. I'd like use these...
1
by: tomazi75-nospam(at)gmail.com | last post by:
Hello all, I've a problem using urllib2 with a proxy which need authentication. I've tested the 'simple way' : -- code -- import urllib # example values for the post
1
by: John | last post by:
Is there an automatic way of filling forms that have been generated using javascript? I tried to use python+mechanize but am having trouble with javascript forms. This is the way the form is...
3
by: Thirdworld | last post by:
I'm building my first database and I'm having trouble using data as a reference on different forms. Is there any way that data submitted by one form could be used immediately as a reference for...
2
by: Toni Pohl | last post by:
Hi, some years ago I´ve implemented an classic ASP form which fills in data from a database into a PD-form. I used the free FDF Toolkit which worked very well. After submitting the PDF the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: 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
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,...

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.