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... 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 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 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() 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. 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() 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
Archived
This topic is now archived and is closed to further replies.