The forums have permanently moved to forum.kirupa.com. This forum will be kept around in read-only mode for archival purposes. To learn how to continue using your existing account on the new forums, check out this thread.

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