Thanks for this code I will try it because I have a site on a Windows Server but with php support that works pretty fine, however I have been trying to include an ASP page into the php with no results, including the trick of iframed it
wow mad4 may the sun shine over Nottingham for the rest of the week!!! I have images galore! you were right the wee "i" was holding it all up changing it to caps sorted the entire page and now all the images are hunky dory!!! So this "str_replace" is quite a handy snippet of code isnt it.. could one use this same idea to sort out the links on the called asp page also so that they travel to the right urls? Im going to try it and find out Thank you from the bottom of my heart Mad4 for taking the time to look at this for me. I was quite stuck! without your help and knowledge I would still be stuck!!! The more I see of php the more I like it Im smiling down here in Auckland!!!
Het Mystique - try Mad4s suggestions with ini set etc (see back thru replys) I am not using the $asp=file thing and using this instead and its working perfectly. I had trouble with the images not showing from the asp file - and his suggestion of using "str_replace" now has them all showing also.. best of luck!! Its awesome when you get it working!!
Excellent! Now i have some links on the asp page I would like to do two things to. This doesnt seem a simple task. I have two requirements. Here are the two issues: 1) some links in the asp page return users back to the other site. I dont want this 2) Some links are wanted but open up the other sites asp pages over the top of my site. Heres what I would like: 1) deactivate some links altogether as they take users back to the other persons site (which is not wanted.) 2) change some so that they call the new page from the other site in place of the original asp page Ive tried replacing the urls in question with: $filestring = str_replace("../events/eventdetail.asp?eventid=ZDM091261", "", $filestring); Which I thought would remove it altogether - but the link remains active and when clicked then sends the user to the index page in my directory the page sits in. Ive also tried $filestring = str_replace("a href="../events/eventdetail.asp?eventid=ZDM091261"", "", $filestring); a href= but the system didnt seem to like all the additional " involved in the lineup. Has anyone managed this before?
I had a pending job to finish before try this, but I'm about to check it right now. mod_rewrite does not work on Windows Based servers because it requires the use of directives via your .htaccess file, which is a not supported on a Windows online environment
Hi mad4 thanks for that - have you ever come across using string_replace to completely remove a url link? the second part of the string asks for the replacement but when I leave that empty eg "" it doesnt work. Is this task a misuse of string_replace?
That should work fine (I use it myself). Its probably the first part that is not matching the right text.
I've run into an issue trying to do something similar to what you're doing. I've got the page to load and work just fine except for one thing, and I swear it has to do with IIS or the ASP.net engine. Here's what I used: ------------------------------------------------------------ $handle = fopen("http://youraddresshere.com/","rb"); while (!feof($handle)) { $content .= fread($handle, 8192); } fclose($handle); ------------------------------------------------------------ It works fine except for Javascript that the ASP.net engine inserts into the code for certain ASP.net web user controls. The page I'm loading in has a "Log In" .Net framework control on it, which requires some javascript to exist for it to function. If I hit the ASP page directly and do a View Source from the browser this what is properly returned: ------------------------------------------------------------ <form name="aspnetForm" method="post" action="default.aspx" id="aspnetForm"> <div> <input type="hidden" name="__EVENTTARGET" id="__EVENTTARGET" value="" /> <input type="hidden" name="__EVENTARGUMENT" id="__EVENTARGUMENT" value="" /> <input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUJMjUzNTk5OTE4D2QWAmYPZBYCAgMPZBYEAgMPZBYCAgIPZBYCZg9 kFgJmD2QWBGYPDxYCHgRUZXh0BQ1Ob3QgTG9nZ2VkIEluZGQCAg8PFgIfAAUGTG9nIEluZGQCBQ9kFgYCAg9kFgJmD2QWAgIBD2QWAmYPZBYIZg9kFgJmDw8 WBB4IQ3NzQ2xhc3MFFWxlZnROYXZTZWxlY3Rpb25DbGFzcx4EXyFTQgICFgIeB29uY2xpY2sFKGphdmFzY3JpcHQ6bG9jYXRpb24uaHJlZj0nZGVmYXVsdC5hc3B4 JztkAgEPZBYCZg8PZBYCHwMFKWphdmFzY3JpcHQ6bG9jYXRpb24uaHJlZj0nZnVsbGxpc3QuYXNweCc7ZAICD2QWAmYPD2QWAh8DBSdqYXZhc2NyaXB0OmxvY 2F0aW9uLmhyZWY9J3NlYXJjaC5hc3B4JztkAgMPZBYCZg8PZBYCHwMFKmphdmFzY3JpcHQ6bG9jYXRpb24uaHJlZj0nZmF2b3JpdGVzLmFzcHgnO2QCBg8PFgIeB1 Zpc2libGVoZGQCCA8PFgIfBGhkFgJmD2QWAgIBD2QWAmYPZBYGZg9kFgJmDw9kFgIfAwUsamF2YXNjcmlwdDpsb2NhdGlvbi5ocmVmPSdhZG1pbkdlbnJlcy5hc3B4 JztkAgEPZBYCZg8PZBYCHwMFKmphdmFzY3JpcHQ6bG9jYXRpb24uaHJlZj0nYWRtaW5DYXN0LmFzcHgnO2QCAg9kFgJmDw9kFgIfAwUsamF2YXNjcmlwdDpsb2 NhdGlvbi5ocmVmPSdhZG1pbk1vdmllcy5hc3B4JztkZLsX5VNSVYSp9PBlZ7M6tTrALUQV" /> </div> <script type="text/javascript"> //<![CDATA[ var theForm = document.forms['aspnetForm']; if (!theForm) { theForm = document.aspnetForm; } function __doPostBack(eventTarget, eventArgument) { if (!theForm.onsubmit || (theForm.onsubmit() != false)) { theForm.__EVENTTARGET.value = eventTarget; theForm.__EVENTARGUMENT.value = eventArgument; theForm.submit(); } } //]]> </script> ------------------------------------------------------------ However, if I hit that same page by means of the PHP fopen my view source looks like this instead: ------------------------------------------------------------ <form name="aspnetForm" method="post" action="default.aspx" id="aspnetForm"> <input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUJMjUzNTk5OTE4D2QWAmYPZBYCAgMPZBYEAgMPZBYCAgIPZBYCZg9 kFgJmD2QWBGYPDxYCHgRUZXh0BQ1Ob3QgTG9nZ2VkIEluZGQCAg8PFgIfAAUGTG9nIEluZGQCBQ9kFgYCAg9kFgJmD2QWAgIBD2QWAmYPZBYIZg9kFgJmDw8 WBB4IQ3NzQ2xhc3MFFWxlZnROYXZTZWxlY3Rpb25DbGFzcx4EXyFTQgICFgIeB29uY2xpY2sFKGphdmFzY3JpcHQ6bG9jYXRpb24uaHJlZj0nZGVmYXVsdC5hc3B4 JztkAgEPZBYCZg8PZBYCHwMFKWphdmFzY3JpcHQ6bG9jYXRpb24uaHJlZj0nZnVsbGxpc3QuYXNweCc7ZAICD2QWAmYPD2QWAh8DBSdqYXZhc2NyaXB0OmxvY 2F0aW9uLmhyZWY9J3NlYXJjaC5hc3B4JztkAgMPZBYCZg8PZBYCHwMFKmphdmFzY3JpcHQ6bG9jYXRpb24uaHJlZj0nZmF2b3JpdGVzLmFzcHgnO2QCBg8PFgIeB1 Zpc2libGVoZGQCCA8PFgIfBGhkFgJmD2QWAgIBD2QWAmYPZBYGZg9kFgJmDw9kFgIfAwUsamF2YXNjcmlwdDpsb2NhdGlvbi5ocmVmPSdhZG1pbkdlbnJlcy5hc3B4 JztkAgEPZBYCZg8PZBYCHwMFKmphdmFzY3JpcHQ6bG9jYXRpb24uaHJlZj0nYWRtaW5DYXN0LmFzcHgnO2QCAg9kFgJmDw9kFgIfAwUsamF2YXNjcmlwdDpsb2 NhdGlvbi5ocmVmPSdhZG1pbk1vdmllcy5hc3B4JztkZLsX5VNSVYSp9PBlZ7M6tTrALUQV" /> ------------------------------------------------------------ Some of the hidden EVENTTARGET fields and all of the ASP.net generated javascript are missing, which of course doesn't allow the page to function properly. --Clay