cURL werkt niet zoals het moet

Gestart doorJoeryy21 reacties50 weergaven

22 berichten · pagina 2 van 2

Joeryy

Lid · Topicstarter

Berichten
1.533
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Hmm, op een of andere manier werkt hij niet meer..

[COLOR= #0000BB]<?php[/COLOR]
[COLOR= #007700]function[/COLOR] checkaccount[COLOR= #007700]([/COLOR][COLOR= #0000BB]$username[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$password[/COLOR][COLOR= #007700]) {[/COLOR]

[COLOR= #0000BB]$url[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]http://www.z8games.com/loging/globelogin.aspx[/COLOR][COLOR= #007700];[/COLOR]

[COLOR= #0000BB]$ch[/COLOR] [COLOR= #007700]=[/COLOR] curl_init[COLOR= #007700]();[/COLOR]

curl_setopt[COLOR= #007700]([/COLOR][COLOR= #0000BB]$ch[/COLOR][COLOR= #007700],[/COLOR] CURLOPT_URL[COLOR= #007700],[/COLOR] [COLOR= #0000BB]$url[/COLOR][COLOR= #007700]);[/COLOR] 

    [COLOR= #0000BB]$html[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/file_get_contents"]file_get_contents[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$url[/COLOR][COLOR= #007700]);[/COLOR]

    [URL="http://www.php.net/preg_match"]preg_match[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]~<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="(.*?)" />~[/COLOR][COLOR= #007700],[/COLOR][COLOR= #0000BB]$html[/COLOR][COLOR= #007700],[/COLOR][COLOR= #0000BB]$viewstate[/COLOR][COLOR= #007700]);[/COLOR]
    [URL="http://www.php.net/preg_match"]preg_match[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]~<input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="(.*?)" />~[/COLOR][COLOR= #007700],[/COLOR][COLOR= #0000BB]$html[/COLOR][COLOR= #007700],[/COLOR][COLOR= #0000BB]$eventvalidation[/COLOR][COLOR= #007700]);[/COLOR]

    [COLOR= #0000BB]$vstate[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$viewstate[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]1[/COLOR][COLOR= #007700]];[/COLOR]
    [COLOR= #0000BB]$eval[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$eventvalidation[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]1[/COLOR][COLOR= #007700]];[/COLOR]

    [COLOR= #0000BB]$post_fields[/COLOR][COLOR= #007700]=[/COLOR][COLOR= #DD0000]__EVENTTARGET=&__EVENTARGUMENT=&__VIEWSTATE=[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/urlencode"]urlencode[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$vstate[/COLOR][COLOR= #007700]) .[/COLOR] [COLOR= #DD0000]&__EVENTVALIDATION=[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/urlencode"]urlencode[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$eval[/COLOR][COLOR= #007700]) .[/COLOR] [COLOR= #DD0000]&tb_loginid=[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$username[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #DD0000]&tb_password=[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$password[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #DD0000]&ib_login.x=40&ib_login.y=10[/COLOR][COLOR= #007700];[/COLOR]

curl_setopt[COLOR= #007700]([/COLOR][COLOR= #0000BB]$ch[/COLOR][COLOR= #007700],[/COLOR] CURLOPT_RETURNTRANSFER[COLOR= #007700],[/COLOR] false[COLOR= #007700]);[/COLOR]
curl_setopt[COLOR= #007700]([/COLOR][COLOR= #0000BB]$ch[/COLOR][COLOR= #007700],[/COLOR] CURLOPT_HEADER[COLOR= #007700],[/COLOR] false[COLOR= #007700]);[/COLOR]
curl_setopt[COLOR= #007700]([/COLOR][COLOR= #0000BB]$ch[/COLOR][COLOR= #007700],[/COLOR] CURLOPT_FOLLOWLOCATION[COLOR= #007700],[/COLOR] false[COLOR= #007700]);[/COLOR]
curl_setopt[COLOR= #007700]([/COLOR][COLOR= #0000BB]$ch[/COLOR][COLOR= #007700],[/COLOR] CURLOPT_ENCODING[COLOR= #007700],[/COLOR] [COLOR= #DD0000]""[/COLOR][COLOR= #007700]);[/COLOR]
curl_setopt[COLOR= #007700]([/COLOR][COLOR= #0000BB]$ch[/COLOR][COLOR= #007700],[/COLOR] CURLOPT_USERAGENT[COLOR= #007700],[/COLOR] [COLOR= #DD0000]"Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.8.1.7) Gecko/20070914 Firefox/2.0.0.7s"[/COLOR][COLOR= #007700]);[/COLOR]
curl_setopt[COLOR= #007700]([/COLOR][COLOR= #0000BB]$ch[/COLOR][COLOR= #007700],[/COLOR] CURLOPT_REFERER[COLOR= #007700],[/COLOR] [COLOR= #0000BB]$url[/COLOR][COLOR= #007700]);[/COLOR]
curl_setopt[COLOR= #007700]([/COLOR][COLOR= #0000BB]$ch[/COLOR][COLOR= #007700],[/COLOR] CURLOPT_POST[COLOR= #007700],[/COLOR] [COLOR= #0000BB]1[/COLOR][COLOR= #007700]);[/COLOR]
curl_setopt[COLOR= #007700]([/COLOR][COLOR= #0000BB]$ch[/COLOR][COLOR= #007700],[/COLOR] CURLOPT_POSTFIELDS[COLOR= #007700],[/COLOR] [COLOR= #0000BB]$post_fields[/COLOR][COLOR= #007700]);[/COLOR]
curl_setopt[COLOR= #007700]([/COLOR][COLOR= #0000BB]$ch[/COLOR][COLOR= #007700],[/COLOR] CURLOPT_COOKIEJAR[COLOR= #007700],[/COLOR] [COLOR= #DD0000]cookie.txt[/COLOR][COLOR= #007700]);[/COLOR]
curl_setopt[COLOR= #007700]([/COLOR][COLOR= #0000BB]$ch[/COLOR][COLOR= #007700],[/COLOR] CURLOPT_RETURNTRANSFER[COLOR= #007700],[/COLOR] [COLOR= #0000BB]1[/COLOR][COLOR= #007700]);[/COLOR]


[COLOR= #0000BB]$store[/COLOR] [COLOR= #007700]=[/COLOR] curl_exec[COLOR= #007700]([/COLOR][COLOR= #0000BB]$ch[/COLOR][COLOR= #007700]);[/COLOR]



curl_close[COLOR= #007700]([/COLOR][COLOR= #0000BB]$ch[/COLOR][COLOR= #007700]);[/COLOR]

file_put_contents[COLOR= #007700]([/COLOR][COLOR= #DD0000]"cookie.txt"[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]""[/COLOR][COLOR= #007700]);
}[/COLOR]


Invalid postback or callback argument. Event validation is enabled using in configuration or <%@ Page EnableEventValidation="true" %> in a page. For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them. If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation.
0
Berichten
13.482
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Met de preg_match sla je de viewstate op in $viewstate, maar bij $post_fields vraag je om $vstate
Idem dito met $eventvalidation en $eval
0
Joeryy

Lid · Topicstarter

Berichten
1.533
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Sjoerd schreef:
Met de preg_match sla je de viewstate op in $viewstate, maar bij $post_fields vraag je om $vstate
Idem dito met $eventvalidation en $eval
Nee hoor,

Ik doe namelijk dit ?
$vstate = $viewstate[1];
$eval = $eventvalidation[1];

toevoeging op 20 maart 2013, 19:35:58:
Poedeltje schreef:
Eerdere citaten tonen
Sjoerd schreef:
Met de preg_match sla je de viewstate op in $viewstate, maar bij $post_fields vraag je om $vstate
Idem dito met $eventvalidation en $eval

Nee hoor,

Ik doe namelijk dit ?
$vstate = $viewstate[1];
$eval = $eventvalidation[1];

// Daar kan me het lijkt me ook niet aan liggen, want hij werkt sinds vandaag niet meer en heb niks aan het script aangepast.
0
Berichten
13.482
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Oh excuses, was mij het oog ontglipt redface
0
Joeryy

Lid · Topicstarter

Berichten
1.533
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Sjoerd schreef:
Oh excuses, was mij het oog ontglipt redface
Maar op een of andere manier pakt hij de viewstate en eventvalidation niet.
0
Berichten
13.482
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
[COLOR= #0000BB]<?php
$url[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]http://www.z8games.com/loging/globelogin.aspx[/COLOR][COLOR= #007700];[/COLOR]
[COLOR= #0000BB]$ch[/COLOR] [COLOR= #007700]=[/COLOR] curl_init[COLOR= #007700]();[/COLOR]
curl_setopt[COLOR= #007700]([/COLOR][COLOR= #0000BB]$ch[/COLOR][COLOR= #007700],[/COLOR] CURLOPT_URL[COLOR= #007700],[/COLOR] [COLOR= #0000BB]$url[/COLOR][COLOR= #007700]);[/COLOR] 
[COLOR= #0000BB]$html[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/file_get_contents"]file_get_contents[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$url[/COLOR][COLOR= #007700]);[/COLOR]


Wat staat er in je $html ?
Moet je de cURL instantie niet meer opties geven?

curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);


bijvoorbeeld?
0
Joeryy

Lid · Topicstarter

Berichten
1.533
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
nvm was gewoon z8games ofzo sm_eerie
0

Jouw reactie

Deel je idee, stel een vraag of help een ander verder.

Editor laden…

Praat mee met de One2xs-community.

Inloggen om te reageren