slitz Posted March 11, 2007 Report Share Posted March 11, 2007 Kādā veidā izmantojot PHP var dabūt citas lapas kodu? Vai vēl labāk izmantojot JS vai VBScript! Link to comment Share on other sites More sharing options...
v3rb0 Posted March 11, 2007 Report Share Posted March 11, 2007 kādu kodu htmlu? php? zionas kompjūtera? ja htmlu, tad kaur ar wget -m -np http://lapa.kuras."kodu".gribu ja php, tad tur vispirms jāuzlauž tā lapa.. Link to comment Share on other sites More sharing options...
Stopp Posted March 11, 2007 Report Share Posted March 11, 2007 Hakerīši? XD Bet ja tu domā html kodu, tad file_get_contents (ja ir atļauts fopen uz citām adresēm) vai fsockopen. Ar Javascript - izmanto ajax. Link to comment Share on other sites More sharing options...
andrisp Posted March 11, 2007 Report Share Posted March 11, 2007 Ar XHR nevarēsi nolasīt kodu no cita domēna (ja nemaldos). Link to comment Share on other sites More sharing options...
4e4en Posted March 11, 2007 Report Share Posted March 11, 2007 var... ar iframe palīdzību... :P Link to comment Share on other sites More sharing options...
slitz Posted March 11, 2007 Author Report Share Posted March 11, 2007 Ne php man nevajag! nu protms neateiktos ^^ Man vajag lai JS vai PHP dabun citas lapas html kodu! piemeram www.blabla.lv/index.htm , vot lai JS saglabatu tas lapas izvadi kada mainigaja piemeram! Link to comment Share on other sites More sharing options...
v3rb0 Posted March 11, 2007 Report Share Posted March 11, 2007 ja vien abas lapas nav vienā domēnā, tad ar pliku javascriptu nevarēsi vajadzēs arī php scriptu vēl pa vidu: [tavs xhr] ---------------> [ php scripts uz tava servera] -> [ www.blabla.lv/index.htm] ------\ [rezultats mainīgajā] <- [ php scripts uz tava servera] <- [ www.blabla.lv/index.htm] <---/ Link to comment Share on other sites More sharing options...
andrisp Posted March 11, 2007 Report Share Posted March 11, 2007 4e4en, man šķiet, kā jau v3rb0 saka, tad no iframe arī piekļūt nevarēsi saturam ar javascript. Link to comment Share on other sites More sharing options...
Delfins Posted March 11, 2007 Report Share Posted March 11, 2007 Liekas XMLHttpRequest varēja visu ko nolasīt :) Link to comment Share on other sites More sharing options...
andrisp Posted March 11, 2007 Report Share Posted March 11, 2007 Bet neko no citiem domēniem. Link to comment Share on other sites More sharing options...
Stopp Posted March 11, 2007 Report Share Posted March 11, 2007 <?php $fp = fsockopen("www.example.com", 80, $errno, $errstr, 30); if (!$fp) { echo "$errstr ($errno)<br />\n"; } else { $out = "GET / HTTP/1.1\r\n"; $out .= "Host: www.example.com\r\n"; $out .= "Connection: Close\r\n\r\n"; $content = ''; fwrite($fp, $out); while (!feof($fp)) { $content .= fgets($fp, 128); } fclose($fp); } ?> <html> <head> <script type="text/javascript"> <!-- var citas_lapas_kods='<?php echo $content; ?>'; //--> </script> </head> </html> Aproksimetlī. Link to comment Share on other sites More sharing options...
andrisp Posted March 11, 2007 Report Share Posted March 11, 2007 Tikai ja daram šādi: var citas_lapas_kods='<?php echo $content; ?>'; Tad vajag vēl arī eskeipot ' pēdiņas. php.net/strreplace ar to tiek galā. Link to comment Share on other sites More sharing options...
Recommended Posts