PLCITS
asked on
Save HTML in MySQL
how I can save html in mySQL? Using PHP
the HTML contain pictures and links
any Idea?
the HTML contain pictures and links
any Idea?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi Im Saving html from emails, with IMAP I got the html email and I want to save in mysql Im using righ now urlencode but i dont know if that is the correct way
this is one example of HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
</head>
<body>
<table class='mailbox-read-messag e' border='0' cellpadding='0' cellspacing='0' width='90%' style='font-family:Tahoma, Geneva, sans-serif; font-size:12px;'>
<tr>
<td>
</td>
</tr>
<tr>
<td>
<table border='0' bgcolor='#EAEAEA' width='100%'>
<tr>
<td align='left' width='10%'>
<B>From:</B>
</td>
<td align='left' width='66%'>
jorgz@plc.com </td>
<td width="24%">
<b>Sent:</b> 20/11/2017 16:42 pm </td>
</tr>
<tr>
<td>
<b>To:</b>
</td>
<td>
jose Lopez
</td>
<td>
</td>
</tr>
<tr>
<td>
<b>CC:</b>
</td>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td>
<b>Subject:</b>
</td>
<td>
Attachment </td>
<td>
</td>
</tr>
<tr>
<td colspan='3'>
<table bgcolor='#FFFFFF'>
<tr>
<td>
Copy of Audit_Arizona-Florida-Mich igan-Texas -Washingto n.xls
Joez.docx
2017_07_14_14_38_54.pdf
DHCP.jpg
RFIDTest.zip
</td>
</tr>
<tr>
<td>
</td>
</tr>
<tr>
<td>
<html xmlns:v="urn:schemas-micro soft-com:v ml" xmlns:o="urn:schemas-micro soft-com:o ffice:offi ce" xmlns:w="urn:schemas-micro soft-com:o ffice:word " xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML );}
o\:* {behavior:url(#default#VML );}
w\:* {behavior:url(#default#VML );}
.shape {behavior:url(#default#VML );}
</style><![endif]--><style ><!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","san s-serif";
mso-fareast-language:EN-US ;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline; }
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline; }
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
{mso-style-priority:99;
mso-style-link:"Balloon Text Char";
margin:0in;
margin-bottom:.0001pt;
font-size:8.0pt;
font-family:"Tahoma","sans -serif";
mso-fareast-language:EN-US ;}
span.EmailStyle17
{mso-style-type:personal-c ompose;
font-family:"Calibri","san s-serif";
color:windowtext;}
span.BalloonTextChar
{mso-style-name:"Balloon Text Char";
mso-style-priority:99;
mso-style-link:"Balloon Text";
font-family:"Tahoma","sans -serif";}
.MsoChpDefault
{mso-style-type:export-onl y;
font-family:"Calibri","san s-serif";
mso-fareast-language:EN-US ;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![e ndif]-->
</head>
<body lang="ES-MX" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><o:p>&nb sp;</o:p>< /p>
<p class="MsoNormal"><o:p>&nb sp;</o:p>< /p>
<table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr style="height:16.5pt">
<td style="padding:0in 0in 0in 0in;height:16.5pt">
<p class="MsoNormal"><b><span style="font-size:10.0pt;fo nt-family: "Aria l",&q uot;sans-s erif" ;color:#7D 7D7D;mso-f areast-lan guage:ES-M X">Joe omz</span></b><b><span style="font-size:12.0pt;fo nt-family: "Time s New Roman","serif&qu ot;;mso-fa reast-lang uage:ES-MX "><o:p></o :p></span> </b></p>
</td>
</tr>
<tr style="height:16.5pt">
<td style="padding:0in 0in 0in 0in;height:16.5pt">
<p class="MsoNormal"><span style="font-size:10.0pt;fo nt-family: "Aria l",&q uot;sans-s erif" ;color:#A5 A5A5;mso-f areast-lan guage:ES-M X">Info Systems</span><b><span style="font-size:12.0pt;fo nt-family: "Time s New Roman","serif&qu ot;;mso-fa reast-lang uage:ES-MX "><o:p></o :p></span> </b></p>
</td>
</tr>
<tr style="height:16.5pt">
<td style="padding:0in 0in 0in 0in;height:16.5pt">
<p class="MsoNormal"><span style="font-size:10.0pt;fo nt-family: "Aria l",&q uot;sans-s erif" ;mso-farea st-languag e:ES-MX">< a href="mailto:joe.omez@plc. com" title="Click to send email to joe omez"><span style="color:blue">joe.ome z@plc.com< /span></a> </span><b> <span style="font-size:12.0pt;fo nt-family: "Time s New Roman","serif&qu ot;;mso-fa reast-lang uage:ES-MX "><o:p></o :p></span> </b></p>
</td>
</tr>
<tr style="height:16.5pt">
<td style="padding:0in 0in 0in 0in;height:16.5pt">
<p class="MsoNormal"><b><span style="font-size:10.0pt;fo nt-family: "Aria l",&q uot;sans-s erif" ;color:#A5 A5A5;mso-f areast-lan guage:ES-M X">Voice</ span></b>< b><span style="font-size:12.0pt;fo nt-family: "Time s New Roman","serif&qu ot;;mso-fa reast-lang uage:ES-MX ">
</span></b><span style="font-size:10.0pt;fo nt-family: "Aria l",&q uot;sans-s erif" ;color:#A5 A5A5;mso-f areast-lan guage:ES-M X">000.000 .0000</spa n><b><span style="font-size:12.0pt;fo nt-family: "Time s New Roman","serif&qu ot;;mso-fa reast-lang uage:ES-MX ">
<span style="color:#A5A5A5">|</s pan> </span></b><b><span style="font-size:10.0pt;fo nt-family: "Aria l",&q uot;sans-s erif" ;color:#A5 A5A5;mso-f areast-lan guage:ES-M X">Fax</sp an></b><b> <span style="font-size:12.0pt;fo nt-family: "Time s New Roman","serif&qu ot;;mso-fa reast-lang uage:ES-MX ">
</span></b><span style="font-size:10.0pt;fo nt-family: "Aria l",&q uot;sans-s erif" ;color:#A5 A5A5;mso-f areast-lan guage:ES-M X">000.000 .0000</spa n><b><span style="font-size:12.0pt;fo nt-family: "Time s New Roman","serif&qu ot;;mso-fa reast-lang uage:ES-MX "><o:p></o :p></span> </b></p>
</td>
</tr>
<tr style="height:21.0pt">
<td style="padding:0in 0in 0in 0in;height:21.0pt">
<p class="MsoNormal"><span style="font-size:10.0pt;fo nt-family: "Aria l",&q uot;sans-s erif" ;color:#A5 A5A5;mso-f areast-lan guage:ES-M X">Plc</sp an><b><spa n style="font-size:12.0pt;fo nt-family: "Time s New Roman","serif&qu ot;;mso-fa reast-lang uage:ES-MX ">
<span style="color:#A5A5A5">|</s pan> </span></b><span style="font-size:10.0pt;fo nt-family: "Aria l",&q uot;sans-s erif" ;color:#A5 A5A5;mso-f areast-lan guage:ES-M X">210 ustrial Pkwy</span><b><span style="font-size:12.0pt;fo nt-family: "Time s New Roman","serif&qu ot;;mso-fa reast-lang uage:ES-MX ">
<span style="color:#A5A5A5">|</s pan> </span></b><span style="font-size:10.0pt;fo nt-family: "Aria l",&q uot;sans-s erif" ;color:#A5 A5A5;mso-f areast-lan guage:ES-M X">Santa</ span><b><s pan style="font-size:12.0pt;fo nt-family: "Time s New Roman","serif&qu ot;;color: #A5A5A5;ms o-fareast- language:E S-MX">,</s pan></b><b ><span style="font-size:12.0pt;fo nt-family: "Time s New Roman","serif&qu ot;;mso-fa reast-lang uage:ES-MX ">
</span></b><span style="font-size:10.0pt;fo nt-family: "Aria l",&q uot;sans-s erif" ;color:#A5 A5A5;mso-f areast-lan guage:ES-M X">CA</spa n><b><span style="font-size:12.0pt;fo nt-family: "Time s New Roman","serif&qu ot;;mso-fa reast-lang uage:ES-MX "><o:p></o :p></span> </b></p>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal"><span style="font-size:12.0pt;fo nt-family: "Time s New Roman","serif&qu ot;;displa y:none;mso -fareast-l anguage:ES -MX"><o:p> </o: p></span>< /p>
<table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="top" style="padding:0in 0in 0in 0in">
<p class="MsoNormal" align="center" style="text-align:center"> <a href="mailto:sales@plc.com ?Subject=H ow%20can%2 0the%20SCP %20help%20 me%20get%2 0results%2 0fast?& ;body=Hell o%20Primus labs%20Sal es%20team, %0D%0A%0D% 0AI%20woul d%20like%2 0to%20know %20how%20m y%20free%2 0SCP%20acc ount%20wor ks%20and%2 0how%20I%2 0can%20rec eive%20all %20of%20la b%20result s%20in%20o ne%20place ,%20organi zed,%20and %20connect ed%20with% 20my%20buy ers.%20Ple ase%20cont act%20me%2 0as%20soon %20as%20po ssible.%0D %0A%0D%0A% 20Thank%20 you," target="_top"><b><span style="font-size:12.0pt;fo nt-family: "Time s New Roman","serif&qu ot;;color: blue;mso-f areast-lan guage:ES-M X;text-dec oration:no ne"><img border="0" width="520" height="217" id="_x0000_i1027" src="cid:image001.png@01D3 621E.88869 A60" alt="FA"></span></b></a><b ><span style="font-size:12.0pt;fo nt-family: "Time s New Roman","serif&qu ot;;mso-fa reast-lang uage:ES-MX "><o:p></o :p></span> </b></p>
</td>
</tr>
<tr>
<td valign="top" style="padding:0in 0in 0in 0in">
<p class="MsoNormal" align="center" style="text-align:center"> <b><span style="font-size:12.0pt;fo nt-family: "Time s New Roman","serif&qu ot;;mso-fa reast-lang uage:ES-MX "><img border="0" width="520" height="157" id="_x0000_i1026" src="cid:image002.png@01D3 621E.88869 A60" alt="Thank you 30 Years"></span></b><b><span style="font-size:12.0pt;fo nt-family: "Time s New Roman","serif&qu ot;;mso-fa reast-lang uage:ES-MX "><o:p></o :p></span> </b></p>
</td>
</tr>
<tr>
<td valign="top" style="padding:0in 0in 0in 0in">
<p class="MsoNormal" align="center" style="text-align:center"> <a href="mailto:fasupport@azl .com?Subje ct=I%20wan t%20to%20l earn%20mor e%20about% 20FA%20Sup port%20Ser vices%20&a mp;body=He llo%20FA%2 0Support%2 0Team,%0D% 0A%0D%0AI% 20want%20t o%20learn% 20about%20 your%20FA% 20Support% 20Services .%20Please %20contact %20me%20as %20soon%20 as%20possi ble.%0D%0A %0D%0AThan k%20you," target="_top"><b><span style="font-size:12.0pt;fo nt-family: "Time s New Roman","serif&qu ot;;color: blue;mso-f areast-lan guage:ES-M X;text-dec oration:no ne"><img border="0" width="520" height="94" id="_x0000_i1025" src="cid:image003.png@01D3 621E.88869 A60" alt="FA Support"></span></b></a><b ><span style="font-size:12.0pt;fo nt-family: "Time s New Roman","serif&qu ot;;mso-fa reast-lang uage:ES-MX "><o:p></o :p></span> </b></p>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal"><span style="font-size:12.0pt;fo nt-family: "Time s New Roman","serif&qu ot;;displa y:none;mso -fareast-l anguage:ES -MX"><o:p> </o: p></span>< /p>
<table class="MsoNormalTable" border="0" cellpadding="0">
<tbody>
<tr>
<td style="border:none;border- top:solid #A5A5A5 1.0pt;padding:.75pt .75pt .75pt .75pt">
<p class="MsoNormal"><b><span style="font-size:10.0pt;fo nt-family: "Aria l",&q uot;sans-s erif" ;color:#BF BFBF;mso-f areast-lan guage:ES-M X">This email and any files transmitted with it may contain confidential information and is intended solely for use by the individual
to whom it is addressed. If you received this email in error, please notify the sender, do not disclose its contents to others and delete from your system.
</span></b><b><span style="font-size:12.0pt;fo nt-family: "Time s New Roman","serif&qu ot;;mso-fa reast-lang uage:ES-MX "><o:p></o :p></span> </b></p>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal"><span style="font-size:12.0pt;fo nt-family: "Time s New Roman","serif&qu ot;;displa y:none;mso -fareast-l anguage:ES -MX"><o:p> </o: p></span>< /p>
<table class="MsoNormalTable" border="0" cellpadding="0">
<tbody>
<tr>
<td style="padding:.75pt .75pt .75pt .75pt"></td>
</tr>
</tbody>
</table>
<p class="MsoNormal"><o:p>&nb sp;</o:p>< /p>
</div>
</body>
</html>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<tr>
</tr>
</table>
</body>
</html>
this is one example of HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
</head>
<body>
<table class='mailbox-read-messag
<tr>
<td>
</td>
</tr>
<tr>
<td>
<table border='0' bgcolor='#EAEAEA' width='100%'>
<tr>
<td align='left' width='10%'>
<B>From:</B>
</td>
<td align='left' width='66%'>
jorgz@plc.com </td>
<td width="24%">
<b>Sent:</b> 20/11/2017 16:42 pm </td>
</tr>
<tr>
<td>
<b>To:</b>
</td>
<td>
jose Lopez
</td>
<td>
</td>
</tr>
<tr>
<td>
<b>CC:</b>
</td>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td>
<b>Subject:</b>
</td>
<td>
Attachment </td>
<td>
</td>
</tr>
<tr>
<td colspan='3'>
<table bgcolor='#FFFFFF'>
<tr>
<td>
Copy of Audit_Arizona-Florida-Mich
Joez.docx
2017_07_14_14_38_54.pdf
DHCP.jpg
RFIDTest.zip
</td>
</tr>
<tr>
<td>
</td>
</tr>
<tr>
<td>
<html xmlns:v="urn:schemas-micro
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 14 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML
o\:* {behavior:url(#default#VML
w\:* {behavior:url(#default#VML
.shape {behavior:url(#default#VML
</style><![endif]--><style
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","san
mso-fareast-language:EN-US
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
{mso-style-priority:99;
mso-style-link:"Balloon Text Char";
margin:0in;
margin-bottom:.0001pt;
font-size:8.0pt;
font-family:"Tahoma","sans
mso-fareast-language:EN-US
span.EmailStyle17
{mso-style-type:personal-c
font-family:"Calibri","san
color:windowtext;}
span.BalloonTextChar
{mso-style-name:"Balloon Text Char";
mso-style-priority:99;
mso-style-link:"Balloon Text";
font-family:"Tahoma","sans
.MsoChpDefault
{mso-style-type:export-onl
font-family:"Calibri","san
mso-fareast-language:EN-US
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![e
</head>
<body lang="ES-MX" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><o:p>&nb
<p class="MsoNormal"><o:p>&nb
<table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr style="height:16.5pt">
<td style="padding:0in 0in 0in 0in;height:16.5pt">
<p class="MsoNormal"><b><span
</td>
</tr>
<tr style="height:16.5pt">
<td style="padding:0in 0in 0in 0in;height:16.5pt">
<p class="MsoNormal"><span style="font-size:10.0pt;fo
</td>
</tr>
<tr style="height:16.5pt">
<td style="padding:0in 0in 0in 0in;height:16.5pt">
<p class="MsoNormal"><span style="font-size:10.0pt;fo
</td>
</tr>
<tr style="height:16.5pt">
<td style="padding:0in 0in 0in 0in;height:16.5pt">
<p class="MsoNormal"><b><span
</span></b><span style="font-size:10.0pt;fo
<span style="color:#A5A5A5">|</s
</span></b><span style="font-size:10.0pt;fo
</td>
</tr>
<tr style="height:21.0pt">
<td style="padding:0in 0in 0in 0in;height:21.0pt">
<p class="MsoNormal"><span style="font-size:10.0pt;fo
<span style="color:#A5A5A5">|</s
<span style="color:#A5A5A5">|</s
</span></b><span style="font-size:10.0pt;fo
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal"><span style="font-size:12.0pt;fo
<table class="MsoNormalTable" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td valign="top" style="padding:0in 0in 0in 0in">
<p class="MsoNormal" align="center" style="text-align:center">
</td>
</tr>
<tr>
<td valign="top" style="padding:0in 0in 0in 0in">
<p class="MsoNormal" align="center" style="text-align:center">
</td>
</tr>
<tr>
<td valign="top" style="padding:0in 0in 0in 0in">
<p class="MsoNormal" align="center" style="text-align:center">
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal"><span style="font-size:12.0pt;fo
<table class="MsoNormalTable" border="0" cellpadding="0">
<tbody>
<tr>
<td style="border:none;border-
<p class="MsoNormal"><b><span
to whom it is addressed. If you received this email in error, please notify the sender, do not disclose its contents to others and delete from your system.
</span></b><b><span style="font-size:12.0pt;fo
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal"><span style="font-size:12.0pt;fo
<table class="MsoNormalTable" border="0" cellpadding="0">
<tbody>
<tr>
<td style="padding:.75pt .75pt .75pt .75pt"></td>
</tr>
</tbody>
</table>
<p class="MsoNormal"><o:p>&nb
</div>
</body>
</html>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
<tr>
</tr>
</table>
</body>
</html>
Not sure what you mean by using the URL Encode.
I've shown you the code to save your HTML into a database using PHP. How are you planning on getting the HTML from the email into your PHP script ??
I've shown you the code to save your HTML into a database using PHP. How are you planning on getting the HTML from the email into your PHP script ??