Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.

Reading secure files from different domains and servers

[es] :: PHP :: Reading secure files from different domains and servers

[ Pregleda: 3062 | Odgovora: 9 ] > FB > Twit

Postavi temu Odgovori

Autor

Pretraga teme: Traži
Markiranje Štampanje RSS

sosingus

Član broj: 31461
Poruke: 140
195.252.94.*

Sajt: www.sportin.biz


Profil

icon Reading secure files from different domains and servers27.06.2006. u 15:52 - pre 216 meseci
Pokusavam iz npr. http://2ndtdomain.com/readremote.php citati https://1stdomain.com/getxml.php i nikako ne uspevam ni sa fopen, include, niti fsockopen.
Da li je mozda slucaj da na 2nddomain nisu dobro podesene ssl/tls soket operacije kroz php, ili mozda je u pitanju openssl koji nije verifikovani-placeni.
Ili nesto, drugo, trece?
 
Odgovor na temu

Jezdimir Lončar
Aka Blazeme
PHP/jQuery Dev, BildStudio
Crna Gora / Pljevlja

Član broj: 74833
Poruke: 674
*.crnagora.net.

Jabber: jezdonet@gmail.com


+4 Profil

icon Re: Reading secure files from different domains and servers27.06.2006. u 15:57 - pre 216 meseci
Da, bas je i mene to zanimalo...
Npr. kako da sa sajta example.com ucitam stranicu http://www.google.com/ ikako bi recimo na vrhu stavio neki iframe, banner ili nesta slicno?
“I never think of the future - it comes soon enough.” - Albert Anštajn (Albert Einstein)
 
Odgovor na temu

sosingus

Član broj: 31461
Poruke: 140
195.252.94.*

Sajt: www.sportin.biz


Profil

icon Re: Reading secure files from different domains and servers27.06.2006. u 16:23 - pre 216 meseci
To bas i nema veze sa ovom temom.
Ukljuciti http stranicu u http stranicu i manipulisati s njom se razlikuje od ukljucivanja https strane u http stranu. U pitanju su dva protokola i obrada podataka sa jednog na dugome. I jos vaznije ti ne moras koristiti php da postognes to sto ti treba.
Bilo sta mozes ucitati sa iframe a ostalo je stvar (d)html umeca ... probaj u forumu web dizajn :)

 
Odgovor na temu

Jezdimir Lončar
Aka Blazeme
PHP/jQuery Dev, BildStudio
Crna Gora / Pljevlja

Član broj: 74833
Poruke: 674
*.crnagora.net.

Jabber: jezdonet@gmail.com


+4 Profil

icon Re: Reading secure files from different domains and servers27.06.2006. u 18:29 - pre 216 meseci
1. Izvinjavam se zbog toga sto nisam vidio ovo s
2. Znam za iframe ali bih da vidim da li moze to da se zavrsi preko PHPa.
3. Evo otkrio sam kako da otvorim file sa drugog domaina (fopen funkcija ali treba da se fino chmoduje...)
“I never think of the future - it comes soon enough.” - Albert Anštajn (Albert Einstein)
 
Odgovor na temu

The Sekula

Član broj: 53829
Poruke: 76
*.eunet.co.yu.

Sajt: www.sekulovic.net


Profil

icon Re: Reading secure files from different domains and servers29.06.2006. u 12:10 - pre 216 meseci
Koju verziju php-a koristis? Wrapper za https protokol je dostupan "tek" od verzije 4.3.0.
 
Odgovor na temu

sosingus

Član broj: 31461
Poruke: 140
195.252.94.*

Sajt: www.sportin.biz


Profil

icon Re: Reading secure files from different domains and servers29.06.2006. u 12:43 - pre 216 meseci
Verzija na serveru (2nddomain) je 4.4.1 i ja ne administriram taj server tako da ne znam sta su radili.
A mogu ce je da i postoji bug http://bugs.php.net/bug.php?id=21653
U svakom slucaju provereno na verziji 4.4.2 radi pa bi trebali update-ovati php na poslednju 4
Mada mislim da su nesto menjali i ko zna sta radili, blokirali neke sockete ...
 
Odgovor na temu

cartmanlee
cartmanlee
FLEX/PHP specijalist, Adobe UG Manager
Zagreb

Član broj: 50997
Poruke: 436
*.adsl.net.t-com.hr.

Sajt: www.zgflex.org


+1 Profil

icon Re: Reading secure files from different domains and servers29.06.2006. u 14:15 - pre 216 meseci
jesi probao koristiti CURL library?
 
Odgovor na temu

sosingus

Član broj: 31461
Poruke: 140
195.252.94.*

Sajt: www.sportin.biz


Profil

icon Re: Reading secure files from different domains and servers29.06.2006. u 14:53 - pre 216 meseci
Nisam. Mada me zanima.
Sta bi mi to pomoglo, npr.
 
Odgovor na temu

cartmanlee
cartmanlee
FLEX/PHP specijalist, Adobe UG Manager
Zagreb

Član broj: 50997
Poruke: 436
*.adsl.net.t-com.hr.

Sajt: www.zgflex.org


+1 Profil

icon Re: Reading secure files from different domains and servers30.06.2006. u 13:32 - pre 216 meseci
CURL - client URL

evo ti uvod iz PHP manuala

PHP supports libcurl, a library created by Daniel Stenberg, that allows you to connect and communicate to many different types of servers with many different types of protocols. libcurl currently supports the http, https, ftp, gopher, telnet, dict, file, and ldap protocols. libcurl also supports HTTPS certificates, HTTP POST, HTTP PUT, FTP uploading (this can also be done with PHP's ftp extension), HTTP form based upload, proxies, cookies, and user+password authentication.

These functions have been added in PHP 4.0.2.

Ja recimo koristim CURL za dohvat sadržaja s pojedinih stranica, dohvatim HTML kod čitave stranice i spremim ga kao string pa se onda dalje igram s time.

Postoji jako puno opcija i stvari koje možeš time raditi. Npr. na jednom projektu sam trebao napraviti aplikaciju koja dohvaća podatke sa stranice koja se nalazi iza logina. I onda sam napravio nešto slično ovome.

Code:

<?php
/*
This script is an example of using curl in php to log into on one page and 
then get another page passing all cookies from the first page along with you.
If this script was a bit more advanced it might trick the server into 
thinking its netscape and even pass a fake referer, yo look like it surfed 
from a local page.
*/

$ch = curl_init();
curl_setopt($ch, CURLOPT_COOKIEJAR, "/tmp/cookieFileName");
curl_setopt($ch, CURLOPT_URL,"http://www.mysite.com/checkpwd.asp");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "UserID=username&password=passwd");

ob_start();      // prevent any output
curl_exec ($ch); // execute the curl command
ob_end_clean();  // stop preventing output

curl_close ($ch);
unset($ch);

$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_COOKIEFILE, "/tmp/cookieFileName");
curl_setopt($ch, CURLOPT_URL,"http://www.myterminal.com/list.asp");

$buf2 = curl_exec ($ch);

curl_close ($ch);

echo "<PRE>".htmlentities($buf2);
?>


Tu sam uspio raditi i sa https-om.

Pogledaj u PHP manual, na google upiši "PHP CURL" pa malo pročitaj što ima.

Evo ti neki od linkova:

http://curl.haxx.se/libcurl/php/
http://blog.unitedheroes.net/curl/
http://www.phpfreaks.com/tutorials/49/1.php


 
Odgovor na temu

sosingus

Član broj: 31461
Poruke: 140
195.252.94.*

Sajt: www.sportin.biz


Profil

icon Re: Reading secure files from different domains and servers30.06.2006. u 15:24 - pre 216 meseci
thanks, baci cu pogled :)
 
Odgovor na temu

[es] :: PHP :: Reading secure files from different domains and servers

[ Pregleda: 3062 | Odgovora: 9 ] > FB > Twit

Postavi temu Odgovori

Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.