-
<?php
-
$username="user";
-
$password="pass";
-
$cookie="cookie.txt";
-
$url = 'http://www.affilate.mikkelsenmedia.dk/partnersystem/mylogins.php';
-
$postdata = "username=".$username."&password=".$password."&send=Submit";
-
-
$ch = curl_init();
-
curl_setopt ($ch, CURLOPT_URL, $url);
-
curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
-
curl_setopt ($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.6) Gecko/20070725 Firefox/2.0.0.6");
-
curl_setopt ($ch, CURLOPT_TIMEOUT, 60);
-
curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 1);
-
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
-
curl_setopt ($ch, CURLOPT_COOKIEJAR, $cookie);
-
//curl_setopt ($ch, CURLOPT_REFERER, 'http://www.euroads.dk');
-
curl_setopt ($ch, CURLOPT_POSTFIELDS, $postdata);
-
curl_setopt ($ch, CURLOPT_POST, 1);
-
$result = curl_exec ($ch);
-
curl_close($ch);
-
-
echo $result;
-
?>
-
I tried this code to automatically login to a website where form action is not an absolute path. Each time i try this code in the locally, it redirects me to the index of localhost. Maybe because the form action has a relative path. Question is, how would i be able to change the action from relative to absolute before actually submitting the form and before executing the curl session. Need immediate response. Thanks
0 1632 Sign in to post your reply or Sign up for a free account.
Similar topics
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...
|
by: Shannon |
last post by:
Hi everyone,
I am trying to post some data to a form using the XMLHTTP object, and have run into a problem trying to find the proper
location of the receiving page.
The form points to a...
|
by: Shannon |
last post by:
Hi, all -- this is a weird question that does not really have to do with javascript, but I used to spend a lot of time
here, and am hoping someone might be able to help...
I am trying to...
|
by: Rizaan Jappie |
last post by:
is it possible to get the relative path based on a absolute path in c#?
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
|
by: dw |
last post by:
Hello, all. I have a site that I'm testing on my LOCALHOST and also on a
remote server, depending on whether I'm at work or at home. I don't want the
OLEDBDATAAdapter to be pointing to the remote...
|
by: openleren |
last post by:
Hi all, how can I use a relative path in my web.config file for an Access
db?:
Instead of using
<configuration>
<appSettings>
<add key="conAccess" value="microsoft.jet.oledb.4.0;data...
|
by: Win, Pats |
last post by:
I have a snippet of HTML that I inject into a number of pages throughout my
Web site at runtime. My problem is that I'm not getting the image to appear
in all documents into which this snippet is...
|
by: Paul M. |
last post by:
Hi,
we have 2 www systems one which we wrote ourselves the other is a parent
company one over which we have no control. The 2nd system involves the user
having to enter a username & password in a...
|
by: D Godwin |
last post by:
This is probably more of a straight HTML question, but here goes: I want to
change from http to https during a form submit. This it pretty
straightforward with a complete path...
|
by: Ruymán |
last post by:
Hello!,
is possible use relative path in access? for example use "photo\image1.jpg"
instead of "c:\db\photo\image1.jpg", I try it but I cann't, but in Visual
Basic if is possible.
Other...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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...
|
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
|
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...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
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: 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,...
|
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: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
| |