यदि आप पीओपी अप विज्ञापनों जैसे किसी वेबसाइट से कुछ अवरुद्ध करना चाहते हैं या किसी वेबसाइट से आने वाले कुछ को IFRAME में दिखा रहे हैं - यह काफी आसान है।
एक framefilter.php और javascriptfilter.php अपने iframe अंक जो करने के लिए सुनिश्चित करें। आप इसे अपनी जरूरतों को पूरा करने के लिए संशोधित कर सकते हैं जैसे कि ऑनलोड ब्ला ब्लाह आदि। लेकिन जैसा/है - यह थोड़ी देर के लिए मेरे लिए ठीक काम कर रहा है। आशा करता हूँ की ये काम करेगा।
इस के साथ अपने मानक IFRAME एचटीएमएल बदलें:
<IFRAME SRC="http://www.yourdomainhere.com/framefilter.php?furl=http://www.domainname.com" WIDTH=1000 HEIGHT=500>
If you can see this, your browser doesn't
understand IFRAMES. However, we'll still
<A HREF="http://www.domainname.com">link</A>
you to the page.
</IFRAME>
Framefilter.php
<?php
//Get the raw html.
$furl=trim($_GET["furl"]);
$raw = file_get_contents($furl);
$mydomain="http://www.yourdomainhere.com/";
//Kill anoying popups.
$raw=str_replace("alert(","isNull(",$raw);
$raw=str_replace("window.open","isNull",$raw);
$raw=str_replace("prompt(","isNull(",$raw);
$raw=str_replace("Confirm: (","isNull(",$raw);
//Modify the javascript links so they go though a filter.
$raw=str_replace("script type=\"text/javascript\" src=\"","script type=\"text/javascript\" src=\"".$mydomain."javascriptfilter.php?jurl=",$raw);
$raw=str_replace("script src=","script src=".$mydomain."javascriptfilter.php?jurl=",$raw);
//Or kill js files
//$raw=str_replace(".js",".off",$raw);
//Put in a base domain tag so images, flash and css are certain to work.
$replacethis="<head>";
$replacestring="<head><base href='".$furl."/'>";
$raw=str_replace($replacethis,$replacestring,$raw);
//Echo the website html to the iframe.
echo $raw;
?>
javascriptfilter.php
<?php
//Get the raw html.
$jurl=trim($_GET["jurl"]);
$raw = file_get_contents($jurl);
//Note, if trickyness like decode detected then display empty.
if(!preg_match("decode(", $raw)){
//Kill anoying popups.
$raw=str_replace("alert(","isNull(",$raw);
$raw=str_replace("window.open","isNull",$raw);
$raw=str_replace("prompt(","isNull(",$raw);
$raw=str_replace("Confirm: (","isNull(",$raw);
//Echo the website html to the iframe.
echo $raw;
}
?>
Parhaps आप अपने प्रश्न –
पर विस्तृत चाहिए एम्बेड न करें वे पृष्ठ जिनके व्यवहार में आपको पसंद नहीं है। – Quentin
उन्हें एक वैध सवाल पूछ रहा है ... "अवांछनीय व्यवहार के साथ कोड एम्बेड न करें" एक बुरा जवाब है मुझे देखने दो .... कैसे आप इस या उस कोड है .... अच्छी तरह से कोड नहीं है यह .. एक प्लम्बर ... वहाँ समस्या हल हो जाते हैं .... मैं एक ही समस्या है ... और मैं अपने मालिक कुछ की तरह कह के लक्जरी नहीं है ... अच्छी तरह से हम सिर्फ नहीं है इसे एम्बेड करें .... पॉल .. क्या आपने कभी इस समस्या को हल किया है ??? ??? –