You are not logged in.
Advanced Search
Skip user information
Torben Brodt
Administrator
Lexicon articles: 104
Sunday, September 26th 2010, 8:32am
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
<html><head> <title>AJAX als IFRAME Ersatz</title> <script type="text/Javascript"> <!-- function geturl(elem, url) { var req; try { req = window.XMLHttpRequest?new XMLHttpRequest(): new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) { //Kein AJAX Support } req.onreadystatechange = function() { if ((req.readyState == 4) && (req.status == 200)) { document.getElementById(elem).innerHTML = req.responseText; } }; req.open('POST', 'fetch.php'); req.setRequestHeader( 'Content-Type', 'application/x-www-form-urlencoded' ); req.send('url='+url); } //--> </script> </head> <body onload="geturl('hier','http://web.de')"> <div id="hier" style="width:230px;height:230px;overflow:auto"></div> </body> </html>
1 2 3 4 5
<?php if(0 !== strpos($_POST['url'], 'http://')) { throw new Exception('url muss mit http beginnen'); } echo file_get_contents($_POST['url']);
Remember me?