Everybody! This is important. In a few days, these forums will be moving over to using the totally sweet Discourse platform. To ensure this migration happens smoothly with no loss of content, these forums are currently in a read-only mode. I do apologize for the inconvenience.

There is never a good time to turn the forums off for an extended period of time, but I promise the new forums will be a billion times better. I'm pretty sure of it.

See you all on the other side in a few days, and if you have any (non-technical) questions, please e-mail me at kirupa@kirupa.com. For technical questions, try to find a tutorial that corresponds to what you are looking for and post in the comments section of that page.

Cheers,
Kirupa

Results 1 to 7 of 7

Thread: embedding php

  1. #1
    59
    posts
    Registered User

    embedding php

    i knw, this is the 5th thread like this from me, but im stuck

    i have managed to embed other php scripts inside my home page... index.php

    but, i needed to embed a script in a directory under the directory of index.php

    so i need to embed something that is in a folder called search and is called search.php

    so for those who dont undestand:

    index.php

    /search (a folder in the same directory)

    search.php (a file in the search folder)

    I NEED TO EMBED THAT SEARCH.PHP INTO INDEX.PHP

    everytime i do it as ive been taught, i get smaked in the face with half the page taked up by errors... i dont like errors....

  2. #2
    PHP Code:
    include('search/search.php'); 
    Is that want you mean?

  3. #3
    59
    posts
    Registered User
    i put that in, and it said there was a bunch of errors... does its in a div tag? or something?

  4. #4
    What errors did it give?

  5. #5
    59
    posts
    Registered User
    Warning: include(./include/commonfuncs.php) [function.include]: failed to open stream: No such file or directory in /home/progam6/public_html/search/search.php on line 10

    Warning: include(./include/commonfuncs.php) [function.include]: failed to open stream: No such file or directory in /home/progam6/public_html/search/search.php on line 10

    Warning: include() [function.include]: Failed opening './include/commonfuncs.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/progam6/public_html/search/search.php on line 10

    Warning: require_once(./settings/database.php) [function.require-once]: failed to open stream: No such file or directory in /home/progam6/public_html/search/search.php on line 39

    Fatal error: require_once() [function.require]: Failed opening required './settings/database.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/progam6/public_html/search/search.php on line 39

  6. #6
    All that's saying is the path to your file is wrong. Seems like you might be jumping in a bit too much without having the basics down judging by all your threads. Have you read any introduction to PHP tutorials?

  7. #7
    i know it sounds silly, but from the error messages it looks like the include path is ./ for commonfuncs.php
    If commonfuncs is not in the search folder, but in the public_html folder, the path should read ../commonfuncs.php

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Home About kirupa.com Meet the Moderators Advertise

 Link to Us

 Credits

Copyright 1999 - 2012