473,383 Members | 1,717 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,383 software developers and data experts.

POSTing a form programatically with cURL

Apologies for the cross post. I am quite desperate and do not know which
ng would be the most appropriate.

I am trying to programatically POST an ASP form, to allow me to log on
to a site programatically.

<form name="aspnetForm" method="post" action="Default.aspx"
id="aspnetForm">
<input name="_ct99:Content:UsrName" type="text"
id="_ct99_Content_UsrName" />
<input name="_ct99:Content:Pwd" type="password"
id="_ct99_Content_Pwd" />
<input type="submit" name="_ct99:Content:btnLogon" value="Logon"
id="_ct99_Content_btnLogon" />
<input id="_ct99_Content_SavePwd" type="checkbox"
name="_ct99:Content:SavePwd" /></p>
</form>
Could anyone please specify the data I should pass with the
CURLOPT_POSTFIELDS flag option (i.e. passed to curl_easy_setopt()) ?
I have not been succesful so far in trying to log on.
Jul 12 '07 #1
1 2826
Hello,

on 07/12/2007 04:42 AM Grey Alien said the following:
Apologies for the cross post. I am quite desperate and do not know which
ng would be the most appropriate.

I am trying to programatically POST an ASP form, to allow me to log on
to a site programatically.

<form name="aspnetForm" method="post" action="Default.aspx"
id="aspnetForm">
<input name="_ct99:Content:UsrName" type="text"
id="_ct99_Content_UsrName" />
<input name="_ct99:Content:Pwd" type="password"
id="_ct99_Content_Pwd" />
<input type="submit" name="_ct99:Content:btnLogon" value="Logon"
id="_ct99_Content_btnLogon" />
<input id="_ct99_Content_SavePwd" type="checkbox"
name="_ct99:Content:SavePwd" /></p>
</form>
Could anyone please specify the data I should pass with the
CURLOPT_POSTFIELDS flag option (i.e. passed to curl_easy_setopt()) ?
I have not been succesful so far in trying to log on.
I rarely use Curl, only as fallback for when it is not possible to
execute SSL fsockopen requests for some reason.

What I use is this HTTP client class that abstracts me everything about
an HTTP connection. Submitting a form just requires me to pass an
associative array with field names and their values. Take a look at the
test_http_post.php example:

http://www.phpclasses.org/httpclient
--

Regards,
Manuel Lemos

Metastorage - Data object relational mapping layer generator
http://www.metastorage.net/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/
Jul 13 '07 #2

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

Similar topics

2
by: TJ Talluto | last post by:
Hi, I'm using the curl functions in php to scrape the wan ip address from my home router (the router is an SMC product). This is a two step process: 1. post the password value to the login.htm...
9
by: Dave Martin | last post by:
I've successfully used CURL to maneuver around and through sites but a new site I've been trying to work with has got me stumped. To retrieve the data I'm trying to get a login is required. If...
1
by: ynotssor | last post by:
Hello, can someone please tell me the correct way to use "curl" to complete an online form? I am trying to eventually retrieve my account balance via a cron job that will email me the parsed output...
5
by: apinti | last post by:
Here is my code, and the problem: $st="...(string to post is formed from different variables read from file)..."; $lngth=strlen($st); $ch = curl_init(); curl_setopt($ch,...
2
by: Norman Peelman | last post by:
From: "Norman Peelman" <npeelman@cfl.rr.com> Subject: Re: posting form data to two php scripts at once Date: Sunday, December 17, 2006 12:06 AM <one.1more@gmail.comwrote in message...
4
by: zorro | last post by:
Hello there, I can't figure out why is it that when i use an array for my postfields it doesn't work : this works curl_setopt($curl, CURLOPT_POSTFIELDS, "clown=bozo" ); this doesn't...
0
by: existatus | last post by:
In a form there are entries like this: <input type="text" name="first_name" size="24" /> <input type="text" name="last_name" size="24" /> <input type="hidden" name="must_have" value="12345" />...
2
by: Grey Alien | last post by:
I am trying to programatically POST an ASP form, to allow me to log on to a site programatically. <form name="aspnetForm" method="post" action="Default.aspx" id="aspnetForm"> <input...
4
by: adam.waterfield | last post by:
I am just wondering if anyone here can help with a problem that we have here. We have a PHP based website/application that has a user login that is connected to our AD setup. This works fine....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
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: 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
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...

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.