Warptweet Posted December 13, 2007 Share Posted December 13, 2007 I'm testing Curl out with php and I used the below code to see if I could login through my site warptweet.com's login panel. (www.warptweet.com/login.php) <?php $phoneNumber = "Curtis Hunter"; $message = "6151851"; $curlPost = 'username=' . urlencode($phoneNumber) . '&password=' . urlencode($message) . '&submit=login'; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'http://www.warptweet.com/login.php'); curl_setopt($ch, CURLOPT_HEADER, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $curlPost); curl_exec($ch); curl_close($ch); ?> When I test it out, all I see is a blank web page with no errors or results. www.warptweet.com/a_curltest.php The above link is the location of the place I tested the code. What seems to be the problem? Did I do anything wrong? I'd appreciate any help. Thanks, -Warptweet Quote Link to comment Share on other sites More sharing options...
dsaba Posted December 13, 2007 Share Posted December 13, 2007 try this: <?php $phoneNumber = "Curtis Hunter"; $message = "6151851"; $curlPost = 'username=' . urlencode($phoneNumber) . '&password=' . urlencode($message) . '&submit=login'; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'http://www.warptweet.com/login.php'); curl_setopt($ch, CURLOPT_HEADER, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $curlPost); $out = curl_exec($ch); curl_close($ch); echo $out; ?> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.