Page 1 of 2 12 LastLast
Results 1 to 10 of 18
  1. #1
    Join Date
    Aug 2011
    Posts
    12
    Plugin Contributions
    0

    application error I addded a new page to my site and can't access it I get a 500 error

    Hey guys, I've searched and I've been at this for a few hours now and I can't find my particular problem so excuse this if its a re-post.

    I'm working on my zencart site (and this is my first time) and its not live yet. I am using a "spare" domain to work on it and will later export to the actual site.

    Anyway, I needed to create a second contact us type page with different details for a user to send us a physical catalog request. Now following many instructions on this forum, I was able to create the directory tree and files needed to have zencart register my custom page under the "Define Page Status", "Define Page Editor" and so on in the admin section. After everything is said and done I cannot see the darn page on the site. Instead, I get an error 500 message. The site itself still works, no other errors besides that. I've checked permissions and everything seems OK but still I get the same error. Maybe its because I named the page "Request Catalog" (request_catalog) and its triggering some security function? IDK I'm extremely lost.

    At the moment the store resides at http://www.commlands.com

    and the trouble page is http://commlands.com/index.php?main_...equest_catalog

    Again everything seems to work properly as far as the admin section is concerned. I have the filename defined under /includes/filenames.php just like everything on this forum has instructed me to.

    This is extremely frustrating. I'm not a PHP guru I'm really just a designer lol. But my company hired me specifically to redo their site and I'm pretty much almost done except that this ONE sectino is -ing me over.

    Let me know if theres anything else I can provide for you guys to help me out: screenshots, php code etc.

    ZenCart Version: v1.3.9h
    Template from Template Monster (eek) modified by me
    hosting by media temple

  2. #2
    Join Date
    Apr 2006
    Location
    London, UK
    Posts
    10,569
    Plugin Contributions
    25

    Default Re: I addded a new page to my site and can't access it I get a 500 error

    That's a very general error. possible causes and ways to track them down are explained by this FAQ entry.
    Kuroi Web Design and Development | Twitter

    (Questions answered in the forum only - so that any forum member can benefit - not by personal message)

  3. #3
    Join Date
    Aug 2011
    Posts
    12
    Plugin Contributions
    0

    Default Re: I addded a new page to my site and can't access it I get a 500 error

    Quote Originally Posted by kuroi View Post
    That's a very general error. possible causes and ways to track them down are explained by this FAQ entry.
    Yeah that was one of the recommended/linked FAQ pages that I found on other threads. I tried messing with the permissions to see if that would help but no dice. I cant figure out which .htaccess file need to be modified to allow this page to work.


  4. #4
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default Re: I addded a new page to my site and can't access it I get a 500 error

    Maybe the word "request" is causing a problem (since it's a word that has a special purpose in PHP and might be getting trapped by mod-security because of its frequent abuse by malicious visitors). Maybe try just "catalog" instead of "request_catalog"?

    Or, ask your hosting company to look at the server's security logs and tell you what the exact reason was for it denying the page and thus triggering the 500 error.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  5. #5
    Join Date
    Aug 2011
    Posts
    12
    Plugin Contributions
    0

    Default Re: I addded a new page to my site and can't access it I get a 500 error

    Quote Originally Posted by DrByte View Post
    Maybe the word "request" is causing a problem (since it's a word that has a special purpose in PHP and might be getting trapped by mod-security because of its frequent abuse by malicious visitors). Maybe try just "catalog" instead of "request_catalog"?

    Or, ask your hosting company to look at the server's security logs and tell you what the exact reason was for it denying the page and thus triggering the 500 error.
    That's what I'm thinking as well. I decided to take a break after hours of staring at code but by you, doc, also thinking the same as I am... it validates my reasoning. I didn't want to spend the time to switch all the files naming again buy I will now.

    I was going to open a ticket with my hosting company on Monday since its the weekend they usually take a while to respond to them.

    Anyway I will rename everything and report back. Thanks

  6. #6
    Join Date
    Aug 2011
    Posts
    12
    Plugin Contributions
    0

    Default Re: I addded a new page to my site and can't access it I get a 500 error

    MAN!

    I tried changing it to cat_req but it still doesn't work. You can't tell me that the word req is also malicious right? I didn't want to name it just catalog. I'm going to have to try making a separate page and name it something stupid like purple_dinosaur and see if maybe I'm missing a step.

    I don't want to just modify Page_2 per say. I would like to be able to create my own page. I'll also open a ticket with my host.

    This sucks.... could it be that I'm doing the SQL patch incorrect? I'm following the instructions from this:

    http://www.zen-cart.com/forum/showpo...88&postcount=6

    to modify my added page.

  7. #7
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: I addded a new page to my site and can't access it I get a 500 error

    Did you use a generator for you new files for the request_catalog page?

    Or did you make them yourself?

    What files did you create?

    What files, if any, did you edit or customize?
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  8. #8
    Join Date
    Aug 2011
    Posts
    12
    Plugin Contributions
    0

    Default Re: I addded a new page to my site and can't access it I get a 500 error

    Quote Originally Posted by Ajeh View Post
    Did you use a generator for you new files for the request_catalog page?

    Or did you make them yourself?

    What files did you create?

    What files, if any, did you edit or customize?
    excuse the extremely late response:

    I did not use a generator for the new files I simply copied the ones from the existing "Contact Us" page and modified them to try to make my own form. Alas I haven't been able to test it since I can't get over the first hurdle of publishing it.

    The files I created/edited are as follows:

    /includes/filenames.php
    I edited this file to include:
    Code:
    define('FILENAME_CAT_REQ', 'cat_req');
    Code:
    define('FILENAME_DEFINE_CAT_REQ', 'define_cat_req');
    /includes/languages/english.php
    I edited the file to include:
    Code:
    define('BOX_INFORMATION_CAT_REQ', 'Request Catalog');
    /includes/modules/sideboxes/information.php
    I edited the file to include:
    Code:
    if (DEFINE_CAT_REQ_STATUS <= 1) {
    $more_information[] = '<a href="' . zen_href_link(FILENAME_CAT_REQ) . '">' . BOX_INFORMATION_CAT_REQ . '</a>';
    /includes/templates/template_default/templates/tpl_site_map_default.php
    I edited the file to include:
    Code:
    <?php } ?>
       <?php if (DEFINE_PAGE_1_STATUS <= '1') { ?>
          <li><?php echo '<a href="' . zen_href_link(FILENAME_PAGE_1) . '">' . BOX_INFORMATION_PAGE_1 . '</a>'; ?></li>
    /includes/languages/english/cat_req.php
    I created the file cat_req.php to include this (copied the contact_us.php, renamed it and edited it):
    Code:
    <?php
    //
    // +----------------------------------------------------------------------+
    // |zen-cart Open Source E-commerce                                       |
    // +----------------------------------------------------------------------+
    // | Copyright (c) 2003 The zen-cart developers                           |
    // |                                                                      |   
    // | http://www.zen-cart.com/index.php                                    |   
    // |                                                                      |   
    // | Portions Copyright (c) 2003 osCommerce                               |
    // +----------------------------------------------------------------------+
    // | This source file is subject to version 2.0 of the GPL license,       |
    // | that is bundled with this package in the file LICENSE, and is        |
    // | available through the world-wide-web at the following url:           |
    // | http://www.zen-cart.com/license/2_0.txt.                             |
    // | If you did not receive a copy of the zen-cart license and are unable |
    // | to obtain it through the world-wide-web, please send a note to       |
    // | [email protected] so we can mail you a copy immediately.          |
    // +----------------------------------------------------------------------+
    // $Id: cat_req.php 1969 2005-09-13 06:57:21Z drbyte $
    //
    define('HEADING_TITLE', 'Request a Catalog');
    define('NAVBAR_TITLE', 'Request Catalog');
    
    define('TEXT_SUCCESS', 'Your request for a catalog has been successfully sent.');
    define('EMAIL_SUBJECT', 'Message from ' . STORE_NAME);
    
    define('ENTRY_NAME', 'Full Name:');
    define('COMPANY_NAME', 'Company:');
    define('COMPANY_ADDRESS', 'Company Address:');
    define('CITY', 'City:');
    define('STATE', 'State:');
    define('ZIP_CODE', 'Zip-Code:');
    
    define('SEND_TO_TEXT','Send Email To:');
    define('ENTRY_EMAIL_NAME_CHECK_ERROR','Sorry, is your name correct? Our system requires a minimum of ' . ENTRY_FIRST_NAME_MIN_LENGTH . ' characters. Please try again.');
    //define('ENTRY_EMAIL_CONTENT_CHECK_ERROR','Did you forget your message? We would like to hear from you. You can type your comments in the text area below.');
    define('NOT_LOGGED_IN_TEXT', 'Not logged in');
    // $Id: request_catalog.php 1969 2005-09-13 06:57:21Z drbyte $
    ?>
    includes/languages/english/html_includes/define_cat_req.php
    I created the above and it only includes a small snippet of code that I will change once its published
    Code:
    <p>Ask for your 96 Page Catalog!</p>
    /includes/templates/template_default/templates/tpl_cat_req_default.php
    I created the above and it includes (what I'm hoping is a working form, I've yet to find out):
    PHP Code:
    <?php
    /**
     * tpl_request_catalog_default.php
     *
     * @package templateSystem
     * @copyright Copyright 2003-2005 Zen Cart Development Team
     * @copyright Portions Copyright 2003 osCommerce
     * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
     * @version $Id: tpl_cat_req_default.php 3464 2006-04-19 00:07:26Z ajeh $
     */
    ?>
    <div class="centerColumn" id="contactUsDefault">
        <h1 id="gvFaqDefaultHeading">
            <?php echo HEADING_TITLE?>
        </h1>
        <div class="tie text2">
            <div class="tie-indent">
                <?php echo zen_draw_form('cat_req'zen_href_link(FILENAME_CAT_REQ'action=send')); ?>
                
                <?php if (DEFINE_CAT_REQ_STATUS >= '1' and DEFINE_CAT_REQ_STATUS <= '2') { ?>
                
                <div id="contactUsNoticeContent" class="content">
                    <?php
                    
    /**
                     * require html_define for the request_catalog page
                     */
                      
    require($define_page);
                    
    ?>
                </div>
                <?php ?>
                <?php if ($messageStack->size('contact') > 0) echo $messageStack->output('contact'); ?>
                
                <fieldset id="contactUsForm">
                    <legend>
                        <?php echo HEADING_TITLE?>
                    </legend>
                    <div class="alert alignright">
                        <?php echo FORM_REQUIRED_INFORMATION?>
                    </div>
                   
                    <label class="inputLabel" for="contactname">
                        <?php echo ENTRY_NAME'<span class="alert">' ENTRY_REQUIRED_SYMBOL '</span>'?>
                    </label>
                    <?php echo zen_draw_input_field('contactname'$name' size="40" id="contactname"') ; ?>
                    <br class="clearBoth" />
                    
                    <label class="inputLabel" for="company-name">
                        <?php echo COMPANY_NAME '<span class="alert">' ENTRY_REQUIRED_SYMBOL '</span>'?>
                    </label>
                    <?php echo zen_draw_input_field('company-name', ($company-name), ' size="40" id="company-name"'); ?>
                    <br class="clearBoth" />
                    
                    <label class="inputLabel" for="company-address">
                        <?php echo COMPANY_ADDRESS '<span class="alert">' ENTRY_REQUIRED_SYMBOL '</span>'?>
                    </label>
                    <?php echo zen_draw_input_field('company-address', ($company-address), ' size="40" id="company-address"'); ?>
                    <br class="clearBoth" />
                    
                    <label class="inputLabel" for="city">
                        <?php echo CITY '<span class="alert">' ENTRY_REQUIRED_SYMBOL '</span>'?>
                    </label>
                    <?php echo zen_draw_input_field('city', ($city), ' size="40" id="city"'); ?>
                    <br class="clearBoth" />
                    
                    <label class="inputLabel" for="state">
                        <?php echo STATE '<span class="alert">' ENTRY_REQUIRED_SYMBOL '</span>'?>
                    </label>
                    <?php echo zen_draw_input_field('state', ($state), ' size="40" id="state"'); ?>
                    <br class="clearBoth" />
                    
                    <label class="inputLabel" for="zip-code">
                        <?php echo ZIP_CODE '<span class="alert">' ENTRY_REQUIRED_SYMBOL '</span>'?>
                    </label>
                    <?php echo zen_draw_input_field('zip-code', ($zip-code), ' size="40" id="zip-code"'); ?>
                    <br class="clearBoth" />
                    
                </fieldset>
                <div class="buttonRow forward">
                    <?php echo zen_image_submit(BUTTON_IMAGE_SENDBUTTON_SEND_ALT); ?>
                </div>
                <div class="buttonRow back">
                    <?php echo zen_back_link() . zen_image_button(BUTTON_IMAGE_BACKBUTTON_BACK_ALT) . '</a>'?>
                </div>
                <?php
                  
    }
                
    ?>
                </form>
                <div class="clear"></div>
            </div>
        </div>
    </div>
    /includes/templates/MY_TEMPLATE/templates/tpl_cat_req_default.php
    I did the same under my template to be safe ^^^

    /includes/modules/pages/cat_req/
    I created the above directory and added the following files...

    /includes/modules/pages/cat_req/header_php.php
    PHP Code:
    <?php
    /**
     * Contact Us Page
     *
     * @package page
     * @copyright Copyright 2003-2010 Zen Cart Development Team
     * @copyright Portions Copyright 2003 osCommerce
     * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
     * @version $Id: header_php.php 17608 2010-09-24 14:51:46Z drbyte $
     */
    require(DIR_WS_MODULES zen_get_module_directory('require_languages.php'));

    $define_page zen_get_file_directory(DIR_WS_LANGUAGES $_SESSION['language'] . '/html_includes/',
    FILENAME_DEFINE_CAT_REQ'false');

    $error false;
    if (isset(
    $_GET['action']) && ($_GET['action'] == 'send')) {
      
    $name zen_db_prepare_input($_POST['contactname']);
      
    $company-name zen_db_prepare_input($_POST['company-name']);
      
    $company-address zen_db_prepare_input($_POST['company-address']);
      
    $city zen_db_prepare_input($_POST['city']);
      
    $state zen_db_prepare_input($_POST['state']);
      
    $zip-code zen_db_prepare_input($_POST['zip-code']);
      
        
    //otherwise default to EMAIL_FROM and store name
        
    $send_to_email trim(EMAIL_FROM);
        
    $send_to_name =  trim(STORE_NAME);
        }
        
        
    // Prepare Text-only portion of message
        
    $text_message OFFICE_FROM "\t" $name "\n" .
        
    OFFICE_EMAIL "\t" $email_address "\n\n" .
        
    "Full Name:\n" strip_tags($_POST['name']) . "\n" .
        
    "Company Name:\n" strip_tags($_POST['company-name']) . "\n" .
        
    '------------------------------------------------------' "\n\n" .
        
    "Address:\n" strip_tags($_POST['company-address']) . "\n" .
        
    "City:\n" strip_tags($_POST['city']) . "\n" .
        
    "State:\n" strip_tags($_POST['state']) . "\n" .
        
    "Zip:\n" strip_tags($_POST['zip-code']) . "\n" .
        
    '------------------------------------------------------' "\n\n" .
        
    $extra_info['TEXT'];
        
    // Prepare HTML-portion of message
        //$html_msg['EMAIL_MESSAGE_HTML'] = strip_tags($_POST['enquiry']);
        
    $html_msg['CONTACT_US_OFFICE_FROM'] = OFFICE_FROM ' ' $name '<br />' OFFICE_EMAIL '(' $email_address ')';
        
    $html_msg['EXTRA_INFO'] = $extra_info['HTML'];
        
        
    // Send message
        
    zen_mail($send_to_name$send_to_email'Catalog Request'$text_message$name$email_address$html_msg,'request_catalog');
        
        
    zen_redirect(zen_href_link('request_catalog''action=success'));
      } else {
        
    $error true;
        if (empty(
    $name)) {
          
    $messageStack->add('contact'ENTRY_EMAIL_NAME_CHECK_ERROR);
        }
        if (
    $zc_validate_email == false) {
          
    $messageStack->add('contact'ENTRY_EMAIL_ADDRESS_CHECK_ERROR);
        }
        if (empty(
    $enquiry)) {
          
    $messageStack->add('contact'ENTRY_EMAIL_CONTENT_CHECK_ERROR);
        }
      }
    // end action==send

    // include template specific file name defines
    $define_page zen_get_file_directory(DIR_WS_LANGUAGES $_SESSION['language'] . '/html_includes/'FILENAME_DEFINE_CONTACT_US'false');
    $breadcrumb->add(NAVBAR_TITLE);
    ?>
    /includes/modules/pages/cat_req/on_load_main.js
    Code:
     if (document.cat_req){ if (document.cat_req.contactname) {document.cat_req.contactname.focus()} };
    /admin/includes/languages/english.php
    Added the line:
    Code:
    define('BOX_TOOLS_DEFINE_CAT_REQ','Request Catalog');
    /admin/includes/languages/english/define_pages_editor.php
    Added the line:
    Code:
    define('TEXT_INFO_CAT_REQ', 'Request Catalog');

    I uploaded all the above files after I had created/edited them. I then logged into my admin panel and installed the SQL patch:
    Code:
    INSERT INTO `configuration` ( `configuration_title`, `configuration_key`, `configuration_value`,
    `configuration_description`, `configuration_group_id`, `sort_order`, `last_modified`, `date_added`, `use_function`,
    `set_function`)
    VALUES ('Define Request Catalog', 'DEFINE_Cat_REQ_STATUS', '1', 'Enable the Defined Request Catalog Link/Text?<br />0=
    Link ON, Define Text OFF<br />1= Link ON, Define Text ON<br />2= Link OFF, Define Text ON<br />3= Link
    OFF, Define Text OFF', 25, 100, NOW(), NOW(), NULL, 'zen_cfg_select_option(array(''0'', ''1'', ''2'', ''3''),');

    =====================

    I believe that's it. I did that twice. The first time and the second time after the DrByte recommended I change the name from "request_catalog"

    Thanks in advance for the help

    -Adrian

  9. #9
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default Re: I addded a new page to my site and can't access it I get a 500 error

    Quote Originally Posted by adrian_cls View Post
    /includes/modules/sideboxes/information.php
    I edited the file to include:
    Code:
    if (DEFINE_CAT_REQ_STATUS <= 1) {
    $more_information[] = '<a href="' . zen_href_link(FILENAME_CAT_REQ) . '">' . BOX_INFORMATION_CAT_REQ . '</a>';
    You didn't include a closing } there. Was that just a copy/paste error?
    Quote Originally Posted by adrian_cls View Post
    /includes/templates/template_default/templates/tpl_site_map_default.php
    I edited the file to include:
    Code:
    <?php } ?>
       <?php if (DEFINE_PAGE_1_STATUS <= '1') { ?>
          <li><?php echo '<a href="' . zen_href_link(FILENAME_PAGE_1) . '">' . BOX_INFORMATION_PAGE_1 . '</a>'; ?></li>
    Same again. Missing a closing }


    Also ...
    - You don't really need any of the define-page stuff unless you specifically want that feature. For most it's overkill.
    - You're using field names which contain a hyphen instead of an underscore (ie: company-address). I don't think I've used hyphens in field names, so can't speak to the reliability of it.
    - your modules/pages file still has a zen_href_link pointing to request_catalog instead of cat_req
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  10. #10
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default Re: I addded a new page to my site and can't access it I get a 500 error

    Have you considered this pre-built custom form made for a similar purpose? http://www.zen-cart.com/forum/showth...482#post386482
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Replies: 4
    Last Post: 31 Jul 2013, 07:51 PM
  2. Replies: 4
    Last Post: 5 Dec 2010, 02:18 AM
  3. 500 internal server error, can't get to zc_install
    By jenbullfrog in forum Installing on a Linux/Unix Server
    Replies: 5
    Last Post: 3 Nov 2010, 08:22 PM
  4. Can't even get the installer to run - IISPassword 500 error
    By -Havoc- in forum General Questions
    Replies: 6
    Last Post: 18 Apr 2007, 07:15 AM

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