Results 1 to 3 of 3
  1. #1
    Join Date
    May 2008
    Posts
    31
    Plugin Contributions
    0

    Default 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

  2. #2
    Join Date
    May 2008
    Posts
    31
    Plugin Contributions
    0

    Default Re: PHP scripts in ezpages or define pages possible?

    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>&nbsp;</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>&nbsp;</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

  3. #3
    Join Date
    Apr 2004
    Location
    UK
    Posts
    5,821
    Plugin Contributions
    2

    Default Re: 403 access forbidden on new php page in subdirectory

    Quote Originally Posted by dgsignal View Post
    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/showth...hlight=ezpages
    which explains how to enable php in ezpages?

 

 

Similar Threads

  1. v150 Install went fine-first access worked, now error 403 forbidden
    By breauxlg in forum Installing on a Linux/Unix Server
    Replies: 1
    Last Post: 1 Jun 2012, 02:03 PM
  2. 403 forbidden access cant install at all :(
    By golith in forum General Questions
    Replies: 1
    Last Post: 4 Jul 2010, 07:33 AM
  3. Access Forbidden when customizing new page
    By dgsignal in forum General Questions
    Replies: 1
    Last Post: 1 Jun 2008, 04:18 PM
  4. 403 Forbidden on admin site in new install
    By shadoh in forum Installing on a Linux/Unix Server
    Replies: 10
    Last Post: 1 Jan 2008, 04:31 PM
  5. 403 forbidden error when trying to access admin
    By jsiperko in forum Basic Configuration
    Replies: 1
    Last Post: 13 Jun 2006, 02:56 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR