Solved

Curl + Https + Cookies [HELP]

Posted on 2010-11-10
3
381 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

Are You Using the Best Web Development Editor?

The worlds of web hosting and web development are constantly evolving. Every year we see design trends change, coding standards adapt and new frameworks/CMS created. With such a quick pace of change it’s easy to get lost trying to keep up.

See if your editor made the list.

Question has a verified solution.

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

SSL stands for “Secure Sockets Layer” and an SSL certificate is a critical component to keeping your website safe, secured, and compliant. Any ecommerce website must have an SSL certificate to ensure the safe handling of sensitive information like…
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
This video teaches viewers how to create their own website using cPanel and Wordpress. Tutorial walks users through how to set up their own domain name from tools like Domain Registrar, Hosting Account, and Wordpress. More specifically, the order in…
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to selectively show certain fields based on user input using rules to gather relevant information and data from your forms. The rules feature provides you with an opportunity…

623 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