Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Curl + Https + Cookies [HELP]

Posted on 2010-11-10
3
Medium Priority
?
382 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 2000 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

Plesk WordPress Toolkit

Plesk's WordPress Toolkit allows server administrators, resellers and customers to manage their WordPress instances, enabling a variety of development workflows for WordPress admins of all skill levels, from beginners to pros.

See why 2/3 of Plesk servers use it.

Question has a verified solution.

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

Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
While opting for any web-to-print solution, you need to discuss with your team and some of your end users and know their opinions about your decisions. In this article we list down some questions you need to ask yourself.
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.

721 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