Hey guys,
I too am trying to add php into an ezpages file. I have put the following code into my /catalog/includes/languages/english/html_includes/MYTEMPLATE/define_page_2.php and when I look at it in a browser, the page is blank.
Code:
<?php require_once('../../../../../Connections/glacier.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
mysql_select_db($database_glacier, $glacier);
$query_artist_dbase = "SELECT artist_name, artist_description FROM artist_description";
$artist_dbase = mysql_query($query_artist_dbase, $glacier) or die(mysql_error());
$row_artist_dbase = mysql_fetch_assoc($artist_dbase);
$totalRows_artist_dbase = mysql_num_rows($artist_dbase);
?><p><strong>Page 2 Sample Text ...</strong></p>
<p>This section of text is from the Define Pages Editor located under Tools in the Admin.</p>
<p>To remove this section of the text, delete it from the Define Pages Editor.</p>
<p> </p>
<p>
<?php
mysql_free_result($artist_dbase);
?>
</p>
<table width="200" border="1">
<tr>
<td>artist</td>
<td>description</td>
</tr>
<tr>
<td><?php echo $row_artist_dbase['artist_name']; ?></td>
<td><?php echo $row_artist_dbase['artist_description']; ?></td>
</tr>
</table>
<p> </p>
I'm pretty sure the code works because I do the same for a file in /catalog and it displays fine.
Any suggestions? Could this be an issue with permissions?
Thanks,
D
Bookmarks