Solved

Curl + Https + Cookies [HELP]

Posted on 2010-11-10
3
380 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 

Author Comment

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

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
SEO, SSL, and Canonical URL Tags 5 139
SSL - A Registrar-Level Change? 4 42
Admin Certificates in my browser 2 51
Disable TLS1.0 on Win 2012 server 7 117
New Relic: Our company recently started researching several products to figure out what were the best ways for us to increase our web page speed and to quickly identify performance problems that we may be having. One of the products we evaluated wa…
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…
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…
Learn how to set-up custom confirmation messages to users who complete your Wufoo form. Include inputs from fields in your form, webpage redirects, and more with Wufoo’s confirmation options.

751 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