Results 1 to 3 of 3

Thread: warning in include

  1. #1
    Join Date
    Jul 2009
    Location
    Binus University
    Posts
    472
    Thanks
    78
    Thanked 21 Times in 21 Posts

    Default warning in include

    i'm kind of new in PHP, but i'm quite good in JS so this is my problem:

    Warning: include(about.php) [function.include]: failed to open stream: No such file or directory in C:\xampp\htdocs\imax\indexTree.php on line 238

    Warning: include() [function.include]: Failed opening 'about.php' for inclusion (include_path='.;C:\xampp\php\pear\') in C:\xampp\htdocs\imax\indexTree.php on line 238

    i'm trying to combine my JS with php, it works in basic html, but when i make it into PHP that error show, is there any rule that i should know, before combining JS with PHP?

    all master thx for your attention, hehe.
    _____________________

    David Demetrius // davejob
    _____________________

  2. #2
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    PHP cannot be combined with JS [directly]. PHP is processed as code into text output, so it can generate pure text which can be html or include Javascript, CSS, etc. Then the output is sent to the browser and it can operate there as HTML, Javascript, CSS, etc.
    But again the two never will interact directly.

    Likewise Javascript cannot "do" PHP, aside from using Ajax which just simulates a behind the scenes page load.


    That aside, if you are using Javascript to generate info like the path to include the file, then later trying to use that in PHP, you should validate any input that is not secure on the server. This includes anything from Javascript because the user can modify it (intentionally or otherwise).


    The error above means that the path you used for the include is wrong, simple as that. Make sure the file exists then figure out why the path is wrong if it does. Should be simple to fix, but if it involves layers of using Javascript, it may be hard to fix it but at least you know what the problem is.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  3. The Following User Says Thank You to djr33 For This Useful Post:

    davelf (03-04-2010)

  4. #3
    Join Date
    Jul 2009
    Location
    Binus University
    Posts
    472
    Thanks
    78
    Thanked 21 Times in 21 Posts

    Default

    hmm, i see.. That's the explanation why it's error in PHP.

    i use this code from dynamicdrive:

    http://www.dynamicdrive.com/dynamici...tentglider.htm

    it's work perfectly in HTML, here is the result
    http://www.imaxxo.com/imaxxo02/indexTree.html

    But all of the content should be put in one page html right? It's true there's no problem if i do that. I just try something new, so i put the glider content into another page PHP, and i call it using

    Code:
    <?php include("");?>
    but it doesn't work like i hope, haha. I think i need to learn more about PHP...

    Another question:

    how the contentGlider work actually?
    1. load all of the content when we open the page, or it load only when we call it?

    2. which one more efficient put all the content of glider into one page or put it in another page and call it using include(php)?

    thx a lot for your explanation djr33...
    _____________________

    David Demetrius // davejob
    _____________________

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
  •