bosmedia Posted March 13, 2012 Share Posted March 13, 2012 I'm trying to build something similar to the "Try on your site" on http://www.mywebpresenters.com/ I want to let users enter in their URL, then I need to save the HTML of that URL/Page to a MySQL database using PHP. I then need to insert a div containing more code and then serve up the whole lot to the user again. I have done this using an IFrame but I'd like to do it better. Can anyone shed light on this? Also, This will be used on a WordPress site if that adds in anyway. Thanks in advance, Barry Quote Link to comment Share on other sites More sharing options...
Muddy_Funster Posted March 13, 2012 Share Posted March 13, 2012 I gotta ask....why do you need a database for that? surely you can echo a file_get_contents within your div tags? Quote Link to comment Share on other sites More sharing options...
bosmedia Posted March 13, 2012 Author Share Posted March 13, 2012 Thanks for your reply, Could I use: <?php $homepage = file_get_contents('http://www.example.com/'); echo $homepage; ?> to grab the HTML and then some way insert another div just after the opening body tag? I'm a bit new to this so any help is much appreciated! Barry Quote Link to comment Share on other sites More sharing options...
Muddy_Funster Posted March 13, 2012 Share Posted March 13, 2012 in theory yes, once you have loaded the file_get_contents() into a variable it's effectivly just another sring as far as PHP is concerned (all be it a fairly large one in most cases), so all string functions will work on it. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.