Hope that You can help me, Thanks in advanced !!!
I hv managed to store html file with images as binary type "longblob" into database. Then , i can view the html files with images even after i have deleted the physical location of html file. For security purpose, i need to delete the physical location of html file & images. But , the problem is if the html files contain images, it will only show a broken image link with blank rectangular after i hv deleted the physical location of images files. How can I store the images that appears within HTML files into the database ?
I can't solve my problem by storing the image name/ location. Actually i'm storing the whole HTML file into database & I'm not sure how many images will be in that HTML file , & what are the images files name. I do not know in advanced the contents of the HTML file that I will store & what are the images that appear in the HTML file, It change based on user selection. Do u hv any idea to solve this problem ?
this is my code to add files into database:
$form_data = "C:\Program Files\Apache Group\Apache\htdocs\index.html";
$data = addslashes(fread(fopen($form_data, "rb"), filesize($form_data)));
$q = "INSERT INTO binary_data (bin_data) VALUES ('$data') ";
this is the code to retrive files from database:
set_magic_quotes_runtime(0);
$data = @MYSQL_RESULT($result,0,"bin_data");
$type = @MYSQL_RESULT($result,0,"filetype");
$data = stripslashes($data);
$data = stripslashes($data);
echo $data;