Jump to content

Inserting a page into a mysql database


bigjoe11a

Recommended Posts

What I'm trying to do is insert a HTML page into a mysql database and with no luck. Can some one show me how to do this.

 

insert  into 'templates'('name','template') values ('header','
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<script language="javascript" src="click.js"></script>
<link href="styles.css" rel="stylesheet" type="text/css">

<title>{SITE_TITLE}</title>

</head>
<body>

<table width="99%" align="center" height="82" border="0" cellpadding="0" cellspacing="0" class="header">
<tr>
  <td align="center"><h1>{SITE_NAME}</h1></td>
</tr>
</table>
');

 

Link to comment
https://forums.phpfreaks.com/topic/229879-inserting-a-page-into-a-mysql-database/
Share on other sites

Ignoring the fact that this isn't a good idea in the first place, the issue is likely quoting.  You need mysql_real_escape_string().

 

Explain. Why won't it be a good idea. Since there are CMS in PHP that use this option. and can you give me a sample of how to use mysql_real_escape_string().

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.