Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6224933
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T08:45:13+00:00 2026-05-24T08:45:13+00:00

I have this setting. root dir| index.php config.php file.php | | |scripts|a.js | |account

  • 0

I have this setting.

 root dir| 
       index.php
       config.php
       file.php  |
                 |
                 |scripts|a.js
                 |
                 |account
                         |index.php
                         |         |
                         |member   |index.php
  • Now, I’ve included index.php of member dir into index.php of account dir. Also , the account index.php includes the config.php which contains,

    define( 'PATH', (__DIR__) );
    

Now , for all includes in account index.php I use,

require_once( PATH . '\file.php' ); 

and is working properly. But when I try to add the path for script src such as,

<script type="text/javascript" src="<?php '.PATH.'scripts/livevalidation.js ?>"></script>

I get an error, so how can i include the a.js in scripts folder into index.php of account using the globally defined path.

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T08:45:14+00:00Added an answer on May 24, 2026 at 8:45 am

    The PHP “__DIR__” and “__FILE__” are absolute to the server. You shouldn’t need to use either for your script.

    <script src="/scripts/livevalidation.js"></script>
    

    Also, your PHP looks like it has some syntax errors, this would be correct (although still wouldn’t work:

    <script src="<?php echo PATH.'/scripts/livevalidation.js'; ?>"></script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this weird problem with setting up cookies with PHP. Everything worked fine
It is typical to have something like this in your cshrc file for setting
Does setting this value have the same effect as setting the debug=true in the
I have following this blog in setting Xvfb in my ubuntu environment: http://corpocrat.com/2008/08/19/how-to-install-xvfb-x11-server-in-linux-server/ So
In my qt app I have this object, filled before setting up my QTreeWidget's
Ok I'm at my work this friday setting up a table that will have
I have DataTemplate containing a TextBox . I'm setting this template to a listbox
Is there a good tutorial or does anyone have experience with setting this up
I have xml like this: <configurationData> <path name='b'> <path name='a'> <setting name='s1'> ![CDATA[XXXX]] </setting>
I have RGB for setting colour of my label it is like this R-:0

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.