Solved

Curl + Https + Cookies [HELP]

Posted on 2010-11-10
3
373 Views
Last Modified: 2012-05-10
Hello there,

i was wasting 7 days, to solve this problem :

i want verify  result of post username & password on a https:// web site they use a token + cookies to verify there form.

here is my code attached:

Please i want a Quick  solution, im new here and i hope that i will stay asking my question here for a long term.

Thank you in adnace!


<?php
if (isset ($_POST['curlme']) && $_POST['curlme'] === 'Envoyer') {

$url = 'https://sitename.com/portal/Index.do';
$ch = curl_init();
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $_POST);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, $url);
?>
<textarea>
<?php
echo $Rec_Data=curl_exec($ch);
echo $httpStatus=curl_getinfo($ch,CURLINFO_HTTP_CODE);
?>

</textarea>
<?php
exit;

}
?>
<form action="" method="post">
 <p>
  <label for="chiffre">Entrez un chiffre</label>
  <input type="text" name="login" id="username" />
  <input type="text" name="password" id="pwd" />
 </p>
 <p>
  <input type="submit" name="curlme" value="Envoyer" />
 </p>
</form>

Open in new window

0
Comment
Question by:imadt
  • 2
3 Comments
 

Author Comment

by:imadt
ID: 34104884
Any Answers? Pleaaaaaaaaaase
0
 
LVL 39

Accepted Solution

by:
noci earned 500 total points
ID: 34109607
why php in the first place?
why not native curl from a command prompt....
(You can at least validate your query that way and then translate the needed arguments into php or whatever).
This is what your query translates into (commandline options) do they work? then you script too.

curl  -k  -d curlme=Envoyer  -A "Some APACHE/LIGTHPD/HYAWATHA/NGINX user agent string"  https://sitename.com/portal/Index.do

0
 

Author Closing Comment

by:imadt
ID: 34113985
he is th only who reply ^^
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Foolproof security solutions has become one of the key necessities of every e-commerce or Internet banking website. If you too own an online shopping site then its vital for you to equip your web portal with customer security features that can allow…
Thoughout my experience working on eCommerce web applications I have seen applications succumbing to increased user demand and throughput. With increased loads the response times started to spike, which leads to user frustration and lost sales. I ha…
Wufoo.com provides powerful tools for surveying targeted groups, and utilizing data from completed surveys to find trends, discover areas of demand or customer expectation, and make business decisions on products or services.
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to choose which pages of your form are visible to your users based on their inputs. The page rules feature provides you with an opportunity to create if:then statements for y…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now