mmk Posted June 27, 2005 Report Share Posted June 27, 2005 man ar skriptu vajag nolasiit citas lapas kontentu. visdriizaak ar fopen un fread pasaakumu. tikai tai lapai ir nepiecieshama autorizaacija. autorizaacija notiek caur http - nu tas logs, kas izlec atsevskji ar visiem tiem basic realm & stuff. taatad, ja man ir zinaami pieejas dati, kaa ar to savu skrptu pateikt tai lapai, ka esmu ok useris, tb kaa ar php veikt html autorizaaciju?? Link to comment Share on other sites More sharing options...
bubu Posted June 27, 2005 Report Share Posted June 27, 2005 (edited) Ja pareizi atceros (bet iespējams samelošos) jānodod papildus headeris: "Authorization: Basic ".base64_encode($username.':'.$password) Edit: laikam pareizi atcerējos: http://www.w3.org/Protocols/HTTP/1.0/draft...ec.html#BasicAA Edited June 27, 2005 by bubu Link to comment Share on other sites More sharing options...
v3rb0 Posted June 27, 2005 Report Share Posted June 27, 2005 no manuāļa komentāriem sanāk ka šitā: $urlHandle = fsockopen($addr, $port, $errno, $errstr, $timeout); .. $urlString = "GET $path HTTP/1.0\r\nHost: $addr\r\nConnection: Keep-live\r\nUser-Agent: MyURLGrabber\r\n"; $urlString .= "Authorization: Basic ".base64_encode("$user:$pass")."\r\n"; .. fputs($urlHandle, $urlString); Link to comment Share on other sites More sharing options...
Delfins Posted June 27, 2005 Report Share Posted June 27, 2005 no manuāļa komentāriem sanāk ka šitā kārtējais `nelasam manuāli`... :) Link to comment Share on other sites More sharing options...
mmk Posted June 27, 2005 Author Report Share Posted June 27, 2005 kārtējais `nelasam manuāli`... :) 18761[/snapback] nu nu. nebiju aizdomājies līdz fsockopen. un tavs komentārs ir vēl mazāk lietderīgs nekā stulbs jautājums. Link to comment Share on other sites More sharing options...
Delfins Posted June 27, 2005 Report Share Posted June 27, 2005 nu nu.nebiju aizdomājies līdz fsockopen. un tavs komentārs ir vēl mazāk lietderīgs nekā stulbs jautājums. atgādināju, ka ir tāda lieta `PHP Manual` + user comments. PS: ja cilvēks to nesaprata, tad sorry... PPS: ir tāds teiciens "Povtorenie - mat' uchenija" ... tikai tā var iznīdēt stulbus jautājumus Link to comment Share on other sites More sharing options...
smarty Posted June 27, 2005 Report Share Posted June 27, 2005 eerti ir izmantot snoopy Link to comment Share on other sites More sharing options...
Recommended Posts