scarhand Posted August 13, 2008 Share Posted August 13, 2008 Is there a function that will allow me to do this? I want to copy the entire text contents of one of my pages and then paste them into a database. I am trying to get static page content for one of my clients sites to become editable...so I need to get his content into a database... Quote Link to comment https://forums.phpfreaks.com/topic/119565-solved-using-php-to-copy-and-paste-text-from-a-page/ Share on other sites More sharing options...
Barand Posted August 13, 2008 Share Posted August 13, 2008 use output buffering when you create page then you can write the buffer to the db before you output. www.php.net/ob_start Quote Link to comment https://forums.phpfreaks.com/topic/119565-solved-using-php-to-copy-and-paste-text-from-a-page/#findComment-615986 Share on other sites More sharing options...
ignace Posted August 13, 2008 Share Posted August 13, 2008 @barand that however will also write the html (head, title, meta, ..) to his database Quote Link to comment https://forums.phpfreaks.com/topic/119565-solved-using-php-to-copy-and-paste-text-from-a-page/#findComment-615988 Share on other sites More sharing options...
Barand Posted August 13, 2008 Share Posted August 13, 2008 depends on where you put the ob_start() Quote Link to comment https://forums.phpfreaks.com/topic/119565-solved-using-php-to-copy-and-paste-text-from-a-page/#findComment-616004 Share on other sites More sharing options...
scarhand Posted August 13, 2008 Author Share Posted August 13, 2008 I'm just trying to get the content within the <title> tags, and then the content within the <body> tags. I already made a script which loops through each html file in the main directory. (there is a massive amount of pages). I'm reading up on output buffering right now. Quote Link to comment https://forums.phpfreaks.com/topic/119565-solved-using-php-to-copy-and-paste-text-from-a-page/#findComment-616017 Share on other sites More sharing options...
scarhand Posted August 13, 2008 Author Share Posted August 13, 2008 nevermind, figured it out using file_get_contents() Quote Link to comment https://forums.phpfreaks.com/topic/119565-solved-using-php-to-copy-and-paste-text-from-a-page/#findComment-616051 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.