Search
Search titles only
By:
Search titles only
By:
Log in
Register
Search
Search titles only
By:
Search titles only
By:
Menu
Install the app
Install
Forums
New posts
All threads
Latest threads
New posts
Trending threads
Trending
Search forums
What's new
New posts
New ads
New profile posts
Latest activity
Free Ads
Latest reviews
Search ads
Members
Current visitors
New profile posts
Search profile posts
Contact us
Latest ads
Ad icon
ZTE MF283U 4G Unlocked Router (Used)
ayanthamaxi
Updated:
Sunday at 8:26 PM
ලංකාවේ හොඳම උපකාරක පන්ති සහ ගුරුවරුන් එකම තැනකින් - TopTuition.lk
dulithapathum
Updated:
Saturday at 8:07 AM
Colombo
RidhMathraa ’26 🎶✨
Tmadhusanka
Updated:
Jul 15, 2026
Ad icon
Colombo
PXN V10 Pro Direct Drive Racing Wheel (Under Warranty)
Abdur Rahman
Updated:
Jul 15, 2026
Ad icon
USDT ණය සේවාව - USDT Loan Service
පුරවැසියා
Updated:
Jul 15, 2026
Electronics
Vehicles
Property
Search
Reply to thread
Forums
General
ElaKiri Talk!
PHP,CURL,HTTP REQEST
Get the App
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Message
<blockquote data-quote="mldarshana" data-source="post: 17415478" data-attributes="member: 25657"><p>PHP CURL walin karanna puluwan</p><p></p><p>[PHP]</p><p>$username = 'user';</p><p>$password = 'pass';</p><p>$loginUrl = 'http://www.remote-domain.com/login.php';</p><p> </p><p>//init curl</p><p>$ch = curl_init();</p><p> </p><p>//Set the URL to work with</p><p>curl_setopt($ch, CURLOPT_URL, $loginUrl);</p><p> </p><p>// ENABLE HTTP POST</p><p>curl_setopt($ch, CURLOPT_POST, 1);</p><p> </p><p>//Set the post parameters</p><p>curl_setopt($ch, CURLOPT_POSTFIELDS, 'user='.$username.'&pass='.$password);</p><p> </p><p>//Handle cookies for the login</p><p>curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookie.txt');</p><p> </p><p>//Setting CURLOPT_RETURNTRANSFER variable to 1 will force cURL</p><p>//not to print out the results of its query.</p><p>//Instead, it will return the results as a string return value</p><p>//from curl_exec() instead of the usual true/false.</p><p>curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);</p><p> </p><p>//execute the request (the login)</p><p>$store = curl_exec($ch);</p><p> </p><p>//the login is now done and you can continue to get the</p><p>//protected content.</p><p> </p><p>//set the URL to the protected file</p><p>curl_setopt($ch, CURLOPT_URL, 'http://www.remote-domain.com/member/data');</p><p> </p><p>//execute the request</p><p>$content = curl_exec($ch);</p><p> </p><p>[/PHP]</p></blockquote><p></p>
[QUOTE="mldarshana, post: 17415478, member: 25657"] PHP CURL walin karanna puluwan [PHP] $username = 'user'; $password = 'pass'; $loginUrl = 'http://www.remote-domain.com/login.php'; //init curl $ch = curl_init(); //Set the URL to work with curl_setopt($ch, CURLOPT_URL, $loginUrl); // ENABLE HTTP POST curl_setopt($ch, CURLOPT_POST, 1); //Set the post parameters curl_setopt($ch, CURLOPT_POSTFIELDS, 'user='.$username.'&pass='.$password); //Handle cookies for the login curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookie.txt'); //Setting CURLOPT_RETURNTRANSFER variable to 1 will force cURL //not to print out the results of its query. //Instead, it will return the results as a string return value //from curl_exec() instead of the usual true/false. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); //execute the request (the login) $store = curl_exec($ch); //the login is now done and you can continue to get the //protected content. //set the URL to the protected file curl_setopt($ch, CURLOPT_URL, 'http://www.remote-domain.com/member/data'); //execute the request $content = curl_exec($ch); [/PHP] [/QUOTE]
Insert quotes…
Verification
Awruddata maasa keeyada?
Post reply
Top
Bottom