Jump to content

Search the Community

Showing results for tags 'include filename relative abs'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 1 result

  1. Hi This is aquestion about absolute and realative addressing across a web host and a local testing server. I have just upgraded to Dreamweaver CS6 and want to use the php testing server. Previously I was just uploading everything and testing on the remote host. Problem is that I use lots of includes in my pages. Content is in a directory tree. This is an example. Content/conditions/back_pain/muscles.php which looks like THIS <?php include("/home/linweb15/b/mysite.co.uk-10629534829/user/htdocs/externals/main.php" );?> Thats the whole page. I use the full path because I use the same main.php to set out the layout for all the pages and a relative link fell down and I dont want to use a differnt relative path in each php file.. Then in the included main.php I have this function. function curPageName() { return "content/".substr(substr($_SERVER["SCRIPT_NAME"],strrpos($_SERVER["SCRIPT_NAME"],"/")+1),0,-4).".htm"; } Any in the middle of the page I put I use <?php include( '/home/linweb15/b/mysite.co.uk-10629534829/user/htdocs/'.curPageName() ); ?> which drops in the text from "content/muscles.php" All works fine on the remote web host. BUT These long file paths are no use on my testing server which is at c:xampp/htdocs/mysite I think I need to use a variable set to the first part of the file path and for this to be different on the host and the testing server. eg /home/linweb15/b/mysite.co.uk-10629534829/user/htdocs/ or c:xampp/htdocs/mysite At last the question..... How is this best done? Thanks John
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.