Where to put PHP included files?

I'm trying to transfer website from my PC to MAC,
hoping that I can finish it without changing any code.
But many of my php files have "require()" function,
and I can't find the php included files' folder.
Please help~~

I have a webpage on http://mysite.com/myproject
All my project files are in /Library/WebServer/Documents/myproject
(index.html, test.php, etc.)

Similar Messages

  • Problems using a php include file with an Add-on Domain.

    Hello,
    I am having an issue getting a php include file to work with a new add-on domain I am working on getting up and running.
    This include file is one that supplies the rest of the php code to a contact form page.  It works as it should for my original domain, same file no difference.  I made sure that the files hosted on the remote server had all read, write, execute permissions turned on.
    I have tried putting the include file in several different locations as a test, such as:
    I don't remember the exact name of the include file at the moment, as I'm at work so I will designate it below as 'includefile.php'.
    file path for add-on domain - ../public_html/lorentzpainting/includes/includefile.php
    alternatives I tried moving the file to - ../public_html/lorentzpainting/includefile.php
    When none of those options worked, I tried just pointing the path towards other places on the server that have the include file such as:
    ../public_html/includes/includefile.php
    ../public_html/includefile.php
    What can I do here?  Should I just give up on using the include and put all the code back in the page?  Doesn't seem like it should be this complicated, it works perfectly fine for my other site.. and still does.
    Thanks ahead of time to those who may assist me.

    here is the contents of the include file:
    <?php
    if (isset($_SERVER['SCRIPT_NAME']) && strpos($_SERVER['SCRIPT_NAME'],
    '.inc.php')) exit;
    // remove escape characters from POST array
    if (PHP_VERSION < 6 && get_magic_quotes_gpc()) {
      function stripslashes_deep($value) {
        $value = is_array($value) ? array_map('stripslashes_deep', $value) : stripslashes($value);
        return $value;
      $_POST = array_map('stripslashes_deep', $_POST);
      // assume that there is nothing suspect
        $suspect = false;
        // create a pattern to locate suspect phrases
        $pattern = '/Content-Type:|Bcc:|Cc:/i';
          // function to check for suspect phrases
      function isSuspect($val, $pattern, &$suspect) {
        // if the variable is an array, loop through each element
        // and pass it recursively back to the same function
        if (is_array($val)) {
          foreach ($val as $item) {
            isSuspect($item, $pattern, $suspect);
        else {
          // if one of the suspect phrases is found, set Boolean to true
          if (preg_match($pattern, $val)) {
            $suspect = true;
    //check the $_POST array and any subarrays for suspect content
    isSuspect($_POST, $pattern, $suspect);
        if (!empty($_POST['url'])) {
            $suspect = true;
        if ($suspect) {
            $mailSent = false;
            unset($missing);
        } else {
        //process the $_POST variables
        foreach ($_POST as $key => $value) {
            // assign to temporary variable and strip whitespace if not an array
            $temp = is_array($value) ? $value : trim($value);
            // if empty and required, add to $missing array
            if (empty($temp) && in_array($key, $required)) {
                array_push($missing, $key);
            } elseif (in_array($key, $expected)) {
                // otherwise, assign to a variable of the same name as $key
                ${$key} = $temp;
        //validate the email address
        if (!empty($email)) {
            // regex to identify illegal characters in email address
    $checkEmail = '/^[^@]+@[^\s\r\n\'";,@%]+$/';
    //reject the email address if it doesn't match
    if (!preg_match($checkEmail, $email)) {
        $suspect = true;
        $mailSent = false;
        unset($missing);
    //go ahead only if all required fields OK
        if (!$suspect && empty($missing)) {
    //initialize the $message variable
            $message = '';
    // loop through the $expected array
            foreach($expected as $item) {
    // assign the value of the current item to $val
                if (isset(${$item}) && !empty(${$item})) {
                    $val = ${$item};
                } else {
    // if it has no value, assign 'Not selected'
                    $val = 'Not selected';
    // if an array, expand as comma-sparated string
                if (is_array($val)) {
                    $val = implode(',', $val);
    // add label and value to the message body
      $message .= ucfirst($item).": $val\r\n\r\n";
    //limit line length to 70 characters
        $message = wordwrap($message, 70);
    //create Reply-To header
        if (!empty($email)) {
            $headers .= "\r\nReply-To: $email";
    // send it
        $mailSent = mail($to, $subject, $message, $headers);
        if ($mailSent) {
    // $missing is no longer needed if the email is sent, so unset it
            unset($missing); echo('Thank you for contacting Common Wealth Web Solutions');
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>Untitled Document</title>
    </head>
    <body>
    </body>
    </html>

  • PHP Include File works but doesn't line up with the Rest of Page

    Hi,
    I am having a serious problem. I have removed my header image and have decided to replace it with a php include file so if any changes needs to be made, it can all be done in the php file in case such as links.
    When I include the php file, it includes the file but for some reason the banner goes in one direction and the body goes in the other. Help me as I am not sure what I am doing wrong.
    Example Page (with the include file): http://www.specialist-events.com/events2.php
    This is how a page looks without the PHP Include File: http://www.specialist-events.com/events1.php
    Please can someone tell me what I am doing wrong.
    Thanks
    Junior

    Hi Nancy,
    Just to confirm what you are telling me I should do.
    Change the code in the web page to:
    <div id="header">
    <!--#include virtual="Includes/HeadMenu.ssi" -->
    <!--end header --> </div>
    so inside the layer 1 of the page, put the following code should be
    <div id="layer1">
    <!--#include virtual="includes/banner.php" -->
    <!--end header --> </div>
    and in the php file. Not sure how this will work as you are mapping areas of the image for links.
    But I assume inside the map area, you would have something like <<a class="intro" href="http://www.specialist-events.com/index.html">home</a>
    <div id="menu">
    <a href="#content">skip menu &gt;</a>
    <a class="intro" href="index.shtml">home</a>
    <a class="gallery" href="gallery.shtml">gallery</a>
    <a class="tools" href="tools.shtml">tools</a>
    <a class="portfolio" href="portfolio.shtml">portfolio</a>
    <a class="fees" href="Fees.shtml">fees</a>
    <a class="links" href="links.php">links</a>
    <a class="contact" href="contact.shtml">contact</a>
    </div> <!--end menu -->
    Am I correct

  • PHP include file not displaying in preview window

    Hi all,
    Hopefully I can explain this clearly. I have a website that
    uses a sidebar that's common to all pages. In order to include this
    "sidebar", I use:
    <?php require_once "sidebar.php ?>
    Now, originally on the page the whole sidebar html/php code
    was in the page, but I cut it all and replaced it to include the
    "sidebar.php" page. This way, when I change anything in the
    sidebar, it cascades to all of the pages.
    When I replace the original sidebar code that's in each page
    with the "php require_once", close the file, and open it back up
    again, the sidebar shows up as a small yellow "php" icon. It
    doesn't let me "preview" it live anymore.
    Is there any way to view what the php include file
    has?

    PREFERENCES | Invisible Elements > Server-side includes
    (enable)
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    ==================
    "vooboo13" <[email protected]> wrote in
    message
    news:fi1m9b$261$[email protected]..
    > Hi all,
    >
    > Hopefully I can explain this clearly. I have a website
    that uses a sidebar
    > that's common to all pages. In order to include this
    "sidebar", I use:
    >
    > <?php require_once "sidebar.php ?>
    >
    > Now, originally on the page the whole sidebar html/php
    code was in the
    > page,
    > but I cut it all and replaced it to include the
    "sidebar.php" page. This
    > way,
    > when I change anything in the sidebar, it cascades to
    all of the pages.
    >
    > When I replace the original sidebar code that's in each
    page with the "php
    > require_once", close the file, and open it back up
    again, the sidebar
    > shows up
    > as a small yellow "php" icon. It doesn't let me
    "preview" it live anymore.
    >
    > Is there any way to view what the php include file has?
    >

  • How  to show  php 'include' file in Design View?

    Is it possible (in design view MX04) to show a php include
    file?
    It shows if it's <?php include('myPage.inc'); ?>
    but if its got the .php ext, <?php include('myPage.php');
    ?>
    its doesnt show.
    Any way of making it show?
    Cheers.
    Os.

    > Is it possible (in design view MX04) to show a php
    include file?
    Yes.
    Does the include file *also* contain PHP code?
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "Osgood" <[email protected]> wrote in
    message
    news:e791va$css$[email protected]..
    > Is it possible (in design view MX04) to show a php
    include file?
    >
    > It shows if it's <?php include('myPage.inc'); ?>
    >
    > but if its got the .php ext, <?php
    include('myPage.php'); ?>
    >
    > its doesnt show.
    >
    > Any way of making it show?
    >
    >
    > Cheers.
    >
    > Os.
    >

  • Where to put ~ITSMOBILEDEVICEINCLUDE html-file?

    Hi,
    we are building an ITS Service based on ABAP-Dynrpos (similar to LM01).
    We are using the Motorola (Symbol) MC3100 Handheld Scanner and want it to perform an "Auto-Enter" after scanning a barcode.
    I found this:
    http://service.sap.com/sap/support/notes/1311169
    Mobile Devices and Browser - Wiki - SCN Wiki
    My understanding is, that we need to define a ~ITSMOBILEDEVICEINCLUDE in the service (in SICF).
    But where to put this device specific HTML-file on the server? Or am I misunderstanding something here...?
    Thank You for your input!
    Jan

    Never mind, I found out myself. You can create this file directly in SE80.
    Navigate to Your ITS service in SE80 and then right click on the "HTML Templates" node of your ITS-Service, then choose "create" from the context menu...
    Samples of device include files can be found in SE80 for ITS-Service ITSMOBILE01:
    Regards
    Jan

  • Where to put shared JSP files in Tomcat?

    I'm building two different web applications. Both applications are deployed within Tomcat. Now these applications share some JSP files. I can not figure out where to put JSP files that are shared (with the include directive) among several applications. Can anyone help me?
    Thanx debeumers

    Well, now I'm not so sure anymore. But I have some
    checkboxes I want to share among different
    applications. So why can you share classes and jar
    files and can not share JSP's?Sounds like more trouble than it's worth. Disk space is cheap. I'd deploy them with each app.
    The only thing that would make me hesitate is the DRY principle. In that case, I might have "common" JSPs in my version control. I'd have the Ant script from each Web app check out the same "common" JSPs and build them into WARs. That would keep those JSPs common and not violate DRY. JMO - MOD

  • Layout problem in mainContent section - PHP include file

    Hi folks - I have a problem with the layout of a page.
    I've included a PHP statement in the mainContent div that shows up way down at the end of the page here:
    http://zazzlefan.com/index2.php
    How can I get that content to fit just below "Featured Sellers - Al Rio Art"?
    My CSS file is a slightly tweaked dreamweaver template
    http://zazzlefan.com/twoColFixLtHdr.css
    and there's a "zstore.css" file that controls the PHP include here:
    http://zazzlefan.com/css/zstore.css
    Can anyone help? Thanks in advance if you can.
    Terry

    .centerGrids {
    margin-left:auto;
    margin-right:auto;
    overflow:hidden;
    Does that do it for you?
    Martin

  • Where to put the properties file

    I am a new user of NetBeans6.0, I am making a simple application for user registration. I have coded everything but when I run project I get error caused by the dao.properties file load problem.
    I have put the dao.properties file inside the classes directory(where all java class files are build after running the project) of my web application directory( I didn't create this directory though, it is automatically created by IDE), I think there is a problem with its path.
    where should I put the dao.properties file so that when I run the project the Tomcat automatically find it and also, what the settings I should do?
    actually, I have referred to BalusC'd  DAO tutorial: the data layer but that comes in use when we are working off the IDEs, In my case since I am using Netbeans so it may be different from that one.
    if someone already done that then please let me know

    ok, but will it work if I upload the project in a remote host?
    lets talk besides IDE, as in your DAO tutorial you have instructed to put the properties file somewhere in root of the classpaths. ok, it will work on a local computer cause there is classpath setting but since remote host doesn't know about that property file and we cant set classpath at remote host(I am not sure though if we can) then how will it work at remote host.
    how the server at remote host comes to know about that property file?
    In my case since I have made the project using IDE and everything regarding classpaths have been set automatically(IDE done itself), but at remote host these sort of settings are not done then how the project will run?
    if I have described my problem incorrectly then please consider it as it is supposed to be.

  • Where to put LUT(.cube) files on SD card to be loaded with F55?

    I have downloaded several LUTs(.cube) and wish to put them onto my SD card so I can load them using my F55.. I want to use them as monitor LUTs. Can anybody tell me where in the SD cards file structure I have to put them? I've searched all over the web and haven't found any information about this.

    artcastel wrote:
    I have downloaded several LUTs(.cube) and wish to put them onto my SD card so I can load them using my F55.. I want to use them as monitor LUTs. Can anybody tell me where in the SD cards file structure I have to put them? I've searched all over the web and haven't found any information about this.It doesn't work like that, that's why there's no info. You can't load 3D LUTs into the camera. There are pre-contructed 3D LUTs already in the camera's 3.0 firmware referred to by Sony as "Looks", but as of FW 3.0, you can't load your own. If in the future they do allow this, it looks as though 3D LUTs from Resolve would first have to be loaded into Raw Viewer and converted into something more camera friendly, and then Raw Viewer wrotes it to an SD card in the correct file/folder structure. You CAN do 1D LUTs today though, using Raw Viewer.

  • Where to put AntiXssLibrary.dll file after installation of BPC Server

    Hi Experts,
         In the installation of BPC, that is after the installation of BPC Servers there comes another step "Installing the Anti-Cross Site Scripting Library"....The document tells us to download "AntiXssLibraryV1.5Installer.msi" and run the setup. Once it gets done the final step says "Copy AntiXssLibrary.dll to %BPC_PROGRAM%\Websrvr\Web\bin on both the BPC Application server and the BPC Web server." I can't understand where i should paste the file on Application Server and I could paste it in "C:\BPC\WebSvr\Web\Bin" what is the other location I should put the file.
    I am installing BPC on single server...Please help me out...
    Thanks
    Sudhakar Kuricheti

    Hello,
    Please use the follow link
    http://www.microsoft.com/downloads/details.aspx?FamilyId=EFB9C819-53FF-4F82-BFAF-E11625130C25&displaylang=en
    to download an installation kit for Microsoft Anti-Cross Site Scripting Library.
    In this way you will not have any more the problem where to put a dll and what you have to do with it.
    This program should be used into application server it is not necessary to put it into db server.
    If you have problem regarding unzip of dimensions then you have to check if you have into client side into C:\Program Files\BPC the dll xceedzip.dll and you have to check if this was correct register. (using regsvr32).
    I hope this help to understand what is that dll and what you have to do to complete the installation of SAP BPC server.
    Regards
    Sorin Radulescu

  • Where to put the .txt file in order to read it

    think ur prog can read the data.. but it said
    java:9: unreported exception java.io.FileNotFoundException; must be caught or declared to be thrown
    FileInputStream sStream = new FileInputStream("data.txt");
    so where to paste the .txt file if i want to read it
    same folder with my .java file?

    u must put the .txt file in order to read it as an
    argument to java command at runtime this code may help
    u out
    import java.io.*;
    class Demofin     
    {public static void main(String[] args) throws
    IOException
         int i;
         FileInputStream fin;
              try
                   fin=new FileInputStream(args[0]);
              catch (FileNotFoundException e)
              {System.out.println(" file not found");
              return;
              catch (ArrayIndexOutOfBoundsException e)
                   System.out.println("usage demofin filename.txt");
                   return;
              do
              {i=fin.read();
              if(i!=-1)System.out.print((char) i);
              while (i!=-1);
                   fin.close();
    }Use tags..

  • Anyconnect 4 as 802.1x supplicant replacement for Windows - where to put config xml file?

    I want to try out Anyconnect NAM as a 802.1x supplicant replacement in Windows 8.1
    And I have made myself a fine little config xml file that I want to test.
    But where do I put that config file?
    Should I rename it to something special, or should Anyconnect NAM have some extra startup parameters?
    Thank you.

    The file must be called "configuration.xml" and if you already installed NAM, then put the file in \Users\All Users\Cisco\Cisco AnyConnect Secure Mobility Client\Network Access Manager\newConfigfiles\ and restart the anyconnect service
    If instead you are creating an install package for deploying, you can put the configuration in a directory named Profiles/NAM/  together with the msi package, the installation will import the config itself.when you run the msi file.

  • Php include file getting called multiple times

    I have created a form in file career.php. To carry out the validation user_registration.php is called at the beginning of the file.
    user_registration.php in turn calls library.php. Issue is that library.php is getting called multiple times.
    I have attached phperror.log which confirms the same.
    career.php
    <?php
    session_start();
    require_once('phpScript/user_registration.php');
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    user_registration.php
    <?php // This file is used for validating user form data. It calls process_upload.php to validate file uploaded by user
    $errors = array();  
    $messages = array();
    $testing = TRUE;
    error_log("Enter- user_registration.php. Testing mode $testing", 0);
    try {
              error_log("user_registration.php: Entered try catch block",0);
    require_once('library.php');
              error_log("Successfully called library.php",0);
              $public_key = '6LeDsNUSAAAAAIoaYuNhGm2zx_qgBECiybUWUkt6';
              $private_key = '6LeDsNUSAAAAACuvmJrec-_5seLdmhqUMngt8AiU';
              $recaptcha = new Zend_Service_ReCaptcha($public_key, $private_key);
              if(isset($_POST['submit'])) {          // Only execute if form is submitted by user
                error_log("user_registration.php. Submit button pressed by user", 0);
                require_once('Zend/Mail.php');
                $mail = new Zend_Mail('UTF-8');
                if (isset($_POST['name'])) {
                        $val = new Zend_Validate_Regex('/^\p{L}+[-\'\p{L} ]+$/u');
                        if (!$val->isValid($_POST['name'])) {
                          $errors['name'] = "Please enter your name, no numbers permitted";
    error_log("Exit- user_registration.php.", 0);
    library.php
    <?php
    error_log("Enter- library.php. Testing mode $testing", 0);
    if ($testing)  // If true then go to testing mode
              $library = '/Applications/MAMP/htdocs/mgtools-india/ZendFramework/library';
              set_include_path(get_include_path() . PATH_SEPARATOR . $library);
    require_once('Zend/Loader/Autoloader.php');
    try {
    Zend_Loader_Autoloader::getInstance();
    error_log("Exit- library.php. Testing mode $testing", 0);
    phperror.log
    Marker - 12-Oct-2012 10:27:26 AM
    [12-Oct-2012 04:57:33 UTC] Enter- user_registration.php. Testing mode 1
    [12-Oct-2012 04:57:33 UTC] user_registration.php: Entered try catch block
    [12-Oct-2012 04:57:33 UTC] Enter- library.php. Testing mode 1
    [12-Oct-2012 04:57:33 UTC] Exit- library.php. Testing mode 1
    [12-Oct-2012 04:57:33 UTC] Successfully called library.php
    [12-Oct-2012 04:57:36 UTC] Enter- user_registration.php. Testing mode 1
    [12-Oct-2012 04:57:36 UTC] Entered try catch block
    [12-Oct-2012 04:57:36 UTC] Enter- library.php. Testing mode 1
    [12-Oct-2012 04:57:36 UTC] Exit- library.php. Testing mode 1
    [12-Oct-2012 04:57:36 UTC] Successfully called library.php
    [12-Oct-2012 04:58:38 UTC] Enter- user_registration.php. Testing mode 1
    [12-Oct-2012 04:58:38 UTC] Entered try catch block
    [12-Oct-2012 04:58:38 UTC] Enter- library.php. Testing mode 1
    [12-Oct-2012 04:58:38 UTC] Exit- library.php. Testing mode 1
    [12-Oct-2012 04:58:38 UTC] Successfully called library.php
    [12-Oct-2012 04:58:38 UTC] user_registration.php. Submit button pressed by user
    [12-Oct-2012 04:58:39 UTC] user_registration.php, Processing enquiry form
    [12-Oct-2012 04:58:39 UTC] Enter- process_upload.php. Testing mode 1
    [12-Oct-2012 04:59:01 UTC] Exit- user_registration.php.
    I am not able to understand why user_registration.php and library.php are executing again and again.
    I ran this test on local testing server MAMP.
    The results are the same on remote server also.
    Please guide.

    I'm not sure what's happening there. The important question is whether the code is executed successfully.
    Since you're using the Zend Framework, it might be better to ask in a dedicated ZF forum.

  • Where to put the dll file

    hi everyone
    i have a dll file and i want to use it through a java file
    so i wrote a native method and load the directory when the dll is found
    but
    how to set up the library path in my in my environment

    i found the answer i don't have to set up any
    environment variable just put the dll file near the
    java file

Maybe you are looking for

  • How to define a new format of report in TestStand?

    Hi, The report autogeneration by TestStand is not suitable to print to my situation. So I want to define a new format of HTML report by myself. But I do not know how to get a new blank one. Thank for help.

  • Positioning JButton in a JFrame

    Hello, I am having a problem positioning a JButton in a JFrame. All I want to do is to have a JFrame that contains a JButton at location 100,100. I dont know why I've been having trouble with this. I just want something simple, so if anyone can write

  • Can i use iPhone 4s with tata indicom in India

    can i use iPhone 4s with tata indicom in India

  • Error message Sense Code = OX73,OX03

    Trying to burn data cd. Get Error message "Disk failed to burn, Sense Key= medium Sense code=OX73,OX03 Application is Toast 6 tried 4 different brand's all failed to burn. What Next? I haven't had trouble burning simple data disc before. Thanks for a

  • BlackBerry Torch stopped accessing email account

    I set up a new email account a few weeks ago through GoDaddy webmail on my own domain, and initially connected my BB to it without a problem.  Yesterday, I realized that none of the emails from this account had been coming to my BB for a couple of da