Page 1 of 6 123 ... LastLast
Results 1 to 10 of 59
  1. #1
    Join Date
    Dec 2008
    Location
    Pittsburgh, PA
    Posts
    237
    Plugin Contributions
    1

    Default how do I require application_top.php in folder in admin with a composer package?

    Buildling in https:127.0.0.1/mysite/admin/myAdminScript

    how do I require admin/includes/application_top.php ?

    I've tried...

    require(https:
    require(http:
    require(127.
    require(__DIR__ . DIRECTORY_SEPARATOR . '..'
    require(../includes/application_top.php;);
    require(DIR_FS_ADMIN ...1.3.7 style

    not sure... just hoping I can require admin login to access an admin folder

    question 2, gmail api uses composer to download a rather large vendor folder, compose remove myAdminScript/vendor should help me out, but currently my git repo has too many changes to tracks

    trying: https://stackoverflow.com/questions/...ubset-of-git-f

    any suggestions on that question 2 issue would be awesome, thanks!

  2. #2
    Join Date
    Oct 2008
    Location
    Croatia
    Posts
    1,541
    Plugin Contributions
    19

    Default Re: how do I require application_top.php in folder in admin on localhost?

    Quote Originally Posted by wolfderby View Post
    Buildling in https:127.0.0.1/mysite/admin/myAdminScript

    how do I require admin/includes/application_top.php ?

    I've tried...

    require(https:
    require(http:
    require(127.
    require(__DIR__ . DIRECTORY_SEPARATOR . '..'
    require(../includes/application_top.php;);
    require(DIR_FS_ADMIN ...1.3.7 style

    not sure... just hoping I can require admin login to access an admin folder
    If the file is in your admin directory, just use the same logic as all other files have in the admin folder (top level):
    Code:
    require('includes/application_top.php');
    Part 2 of the question... Nope.

  3. #3
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: how do I require application_top.php in folder in admin on localhost?

    And parentheses not needed for require/include statements.
    .

    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.

  4. #4
    Join Date
    Dec 2008
    Location
    Pittsburgh, PA
    Posts
    237
    Plugin Contributions
    1

    Default Re: how do I require application_top.php in folder in admin on localhost?

    but a simple require('includes/application_top.php'); ends up w/ a Warning: require(includes/application_top.php): failed to open stream: No such file or directory in C:\... (because it's a xampp php server run on localhost aka my computer)

    so... I need to move up a directory level in the admin, which has an obscured directory path.

  5. #5
    Join Date
    Dec 2008
    Location
    Pittsburgh, PA
    Posts
    237
    Plugin Contributions
    1

    Default Re: how do I require application_top.php in folder in admin on localhost?

    there is no...

    /mysite/admin/myAdminScript/includes/application_top.php

    ...it's in...

    /mysite/admin/includes/application_top.php

  6. #6
    Join Date
    Dec 2008
    Location
    Pittsburgh, PA
    Posts
    237
    Plugin Contributions
    1

    Default Re: how do I require application_top.php in folder in admin on localhost?

    this might have worked: require(realpath(__DIR__ . DIRECTORY_SEPARATOR . '../includes/application.php')); but now i'm getting An error occurred: { "error": "unauthorized_client", "error_description": "Unauthorized" } which I think is a credentials.json issue.

  7. #7
    Join Date
    Oct 2008
    Location
    Croatia
    Posts
    1,541
    Plugin Contributions
    19

    Default Re: how do I require application_top.php in folder in admin on localhost?

    I run everything on xampp so it's not an issue with xampp, but your script.
    Now, this seems to be an ajax something, happening from somewhere in your admin directory. This should still work just the same if both your main script file and the processing php file are in the admin root. Perhaps I missed one important part - Buildling in https:127.0.0.1/mysite/admin/myAdminScript - is myAdminScript a directory and then you have all of your php files inside that directory? Honestly, I've never done it like that because I couldn't get it to work either (probably something I don't know how to do), so I opted for the approach where the main php file and the ajax file are in admin root, and the rest of the files can be scattered around. Something like:
    - /admin/my_script.php
    - /admin/my_script_ajax.php
    - /admin/myScriptFolder/everything_else
    Either go that way, or wait for someone else to chip in and share their thoughts. Sorry.

  8. #8
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,401
    Plugin Contributions
    87

    Default Re: how do I require application_top.php in folder in admin on localhost?

    What purpose is the additional admin sub-directory (/myAdminScript)? My localhost environments normally mimic the associated live site's directory structure, where the /admin sub-directory is at the same 'level' as the storefront /includes sub-directory.

  9. #9
    Join Date
    Dec 2008
    Location
    Pittsburgh, PA
    Posts
    237
    Plugin Contributions
    1

    Default Re: how do I require application_top.php in folder in admin on localhost?

    Quote Originally Posted by balihr View Post
    I run everything on xampp so it's not an issue with xampp, but your script.
    Now, this seems to be an ajax something, happening from somewhere in your admin directory. This should still work just the same if both your main script file and the processing php file are in the admin root. Perhaps I missed one important part - Buildling in https:127.0.0.1/mysite/admin/myAdminScript - is myAdminScript a directory and then you have all of your php files inside that directory? Honestly, I've never done it like that because I couldn't get it to work either (probably something I don't know how to do), so I opted for the approach where the main php file and the ajax file are in admin root, and the rest of the files can be scattered around. Something like:
    - /admin/my_script.php
    - /admin/my_script_ajax.php
    - /admin/myScriptFolder/everything_else
    Either go that way, or wait for someone else to chip in and share their thoughts. Sorry.
    seems like it might go that way then...

  10. #10
    Join Date
    Dec 2008
    Location
    Pittsburgh, PA
    Posts
    237
    Plugin Contributions
    1

    Default Re: how do I require application_top.php in folder in admin with a composer package?

    Quote Originally Posted by lat9 View Post
    What purpose is the additional admin sub-directory (/myAdminScript)? My localhost environments normally mimic the associated live site's directory structure, where the /admin sub-directory is at the same 'level' as the storefront /includes sub-directory.
    I'm not sure? first time using google api and composer > "composer require google/apiclient:^2.0"

 

 
Page 1 of 6 123 ... LastLast

Similar Threads

  1. error admin Warning: require(includes/application_top.php
    By unusualfinds in forum Addon Shipping Modules
    Replies: 12
    Last Post: 6 Apr 2012, 07:50 PM
  2. Error MessageWarning: require(includes/application_top.php) [function.require]: faile
    By valbuhagiar in forum Installing on a Linux/Unix Server
    Replies: 2
    Last Post: 31 Oct 2011, 07:44 PM
  3. Warning:require(includes/application_top.php) error
    By Lurkzilla in forum Installing on a Linux/Unix Server
    Replies: 1
    Last Post: 25 Aug 2010, 06:00 PM
  4. admin error message require(includes/application_top.php)
    By mitdrissia in forum Installing on a Linux/Unix Server
    Replies: 3
    Last Post: 27 Nov 2009, 10:06 AM
  5. Replies: 0
    Last Post: 10 Oct 2009, 02:38 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