Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / 403 access forbidden on new php page in subdirectory

403 access forbidden on new php page in subdirectory

Locked

Views: 4,187

Results 1 to 3 of 3
This thread is locked. New replies are disabled.
30 May 2008, 3:58 PM
#1
dgsignal avatar

dgsignal

New Zenner

Join Date:
May 2008
Posts:
31
Plugin Contributions:
0

403 access forbidden on new php page in subdirectory

I'm getting an error with a new page I have created. I am trying to create a new page that links to my EZ pages bar. From the page, I'm trying to retrieve and display data from my database.

Unfortunately, when I put in the code to change the /catalog/includes/languages/english/html_includes/CUSTOM/english/define_page_2.php file, nothing shows up when I view the page in a browser.

If I make a new page and put it here: "/catalog/new_page.php" the retrieval from the database works fine, and the page displays the data.

**If I make a new page in any of the subdirectories under catalog, I get the following error.
**

Access forbidden!
You don't have permission to access the requested object. It is either read-protected or not readable by the server.

If you think this is a server error, please contact the webmaster.

Error 403

Is this a permissions issue somewhere? Thanks for any help.

Dustin

30 May 2008, 5:28 PM
#2
dgsignal avatar

dgsignal

New Zenner

Join Date:
May 2008
Posts:
31
Plugin Contributions:
0

Re: 403 access forbidden on new php page in subdirectory

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.

<?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

30 May 2008, 5:42 PM
#3
misty avatar

misty

Inactive

Join Date:
Apr 2004
Location:
UK
Posts:
5,752
Plugin Contributions:
1

Re: 403 access forbidden on new php page in subdirectory

dgsignal:

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
Did you first visit
http://www.zen-cart.com/forum/showthread.php?t=37252&highlight=ezpages
which explains how to enable php in ezpages?