+ Reply to Thread
Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: include page problem

  1. #1
    Anirban1987's Avatar
    Anirban1987 is offline x10Hosting Member Anirban1987 is an unknown quantity at this point
    Join Date
    Sep 2008
    Location
    Kolkata , India
    Posts
    55

    include page problem

    When I am including a page on line 64 the page is not getting included. Instead the text [include'Action/form.php'] is coming up. Can anyone debug the code please.

    The code : http://www.paste-it.com/view/86066443

  2. #2
    Chris S's Avatar
    Chris S is offline Retired Chris S is an unknown quantity at this point
    Join Date
    Mar 2005
    Posts
    1,036

    Re: include page problem

    currently you have this

    Code:
    $Table .="<td>include'Action/form.php'</td>";
    try something like

    Code:
    $Table .="<td>".require_once('Action/form.php')."</td>";

    I would love to change the world, but they won't give me the source code

  3. #3
    Anirban1987's Avatar
    Anirban1987 is offline x10Hosting Member Anirban1987 is an unknown quantity at this point
    Join Date
    Sep 2008
    Location
    Kolkata , India
    Posts
    55

    Re: include page problem

    Quote Originally Posted by Chris S View Post
    currently you have this

    Code:
    $Table .="<td>include'Action/form.php'</td>";
    try something like

    Code:
    $Table .="<td>".require_once('Action/form.php')."</td>";
    Sorry its not working. Showing

    Warning: require_once(Action/form.php</td>) [function.require-once]: failed to open stream: No such file or directory in /home/anirban/public_html/subdomains/Intranet/tdcms/cms.php on line 64

    Fatal error: require_once() [function.require]: Failed opening required 'Action/form.php</td>' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/anirban/public_html/subdomains/Intranet/tdcms/cms.php on line 64

  4. #4
    Livewire's Avatar
    Livewire is offline Abuse Compliance Officer Livewire is a glorious beacon of lightLivewire is a glorious beacon of light
    Join Date
    Jun 2005
    Location
    Behind a keyboard.
    Posts
    8,998

    Re: include page problem

    Quote Originally Posted by Anirban1987 View Post
    Sorry its not working. Showing

    Warning: require_once(Action/form.php</td>) [function.require-once]: failed to open stream: No such file or directory in /home/anirban/public_html/subdomains/Intranet/tdcms/cms.php on line 64

    Fatal error: require_once() [function.require]: Failed opening required 'Action/form.php</td>' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/anirban/public_html/subdomains/Intranet/tdcms/cms.php on line 64
    Filename there says it's trying to open 'Action/form.php</td>' - sounds like you missed a quote in the php statement somewhere.

    Can you paste your new line that you're using there, cause
    $Table .="<td>".require_once('Action/form.php')."</td>"; is valid and shouldn't be causing errors.


    TOS breakers will be suspended regardless of race, creed, national origin, hair color, or favorite food. Thanks for your understanding!

  5. #5
    Anirban1987's Avatar
    Anirban1987 is offline x10Hosting Member Anirban1987 is an unknown quantity at this point
    Join Date
    Sep 2008
    Location
    Kolkata , India
    Posts
    55

    Wink Re: include page problem

    Quote Originally Posted by Livewire View Post
    Filename there says it's trying to open 'Action/form.php</td>' - sounds like you missed a quote in the php statement somewhere.

    Can you paste your new line that you're using there, cause
    $Table .="<td>".require_once('Action/form.php')."</td>"; is valid and shouldn't be causing errors.
    I have pasted it ditto... as it is and checked it several times

  6. #6
    Livewire's Avatar
    Livewire is offline Abuse Compliance Officer Livewire is a glorious beacon of lightLivewire is a glorious beacon of light
    Join Date
    Jun 2005
    Location
    Behind a keyboard.
    Posts
    8,998

    Re: include page problem

    Huh, shur enough, something isn't quite right here...hang tight, running it locally now and seeing if I can't figure out why in the name of zeus this thing isn't working quite right XD


    Shoulda tried it first before I said it was right I guess.



    Edit: Seems include/require don't work that way, the only way to make it work is something similar to this:

    Code:
    $Table.="<td>";
    include("Action/form.php");
    $Table.="</td>";
    Then in form.php:

    Code:
    $Table.="What have you!";
    Boils down to continuing to $Table.= whatever data you're adding via Action/form.php. Since Action/form.php is being included -after- $Table has been initially set it can keep using the existing variable, including adding new stuff to the end of it
    Last edited by Livewire; 03-10-2009 at 02:22 AM.


    TOS breakers will be suspended regardless of race, creed, national origin, hair color, or favorite food. Thanks for your understanding!

  7. #7
    Hired_Goon is offline x10Hosting Member Hired_Goon is an unknown quantity at this point
    Join Date
    Sep 2007
    Posts
    19

    Re: include page problem

    I think " vs ' may be the cause.
    Try $Table .="<td>'.require_once('Action/form.php').'</td>";

    But, If Action is a directory containing form.php in your current directory then it should be
    $Table .="<td>'.require_once('/Action/form.php').'</td>";



    Edit
    Also, Why the period after $Table and the second statement
    #
    $Table.= "<td>$value</td>";
    #
    }
    #
    elseif($field=='Action Taken')
    #
    {
    #
    $Table .="<td>include'Action/form.php'</td>";

    contains $table<space>.=
    Last edited by Hired_Goon; 03-10-2009 at 02:42 AM.

  8. #8
    Livewire's Avatar
    Livewire is offline Abuse Compliance Officer Livewire is a glorious beacon of lightLivewire is a glorious beacon of light
    Join Date
    Jun 2005
    Location
    Behind a keyboard.
    Posts
    8,998

    Re: include page problem

    Quote Originally Posted by Hired_Goon View Post
    I think " vs ' may be the cause.
    Try $Table .="<td>'.require_once('Action/form.php').'</td>";

    But, If Action is a directory containing form.php in your current directory then it should be
    $Table .="<td>'.require_once('/Action/form.php').'</td>";



    Edit
    Also, Why the period after $Table and the second statement
    #
    $Table.= "<td>$value</td>";
    #
    }
    #
    elseif($field=='Action Taken')
    #
    {
    #
    $Table .="<td>include'Action/form.php'</td>";

    contains $table<space>.=
    1) Your new include code returns '.require_once('Action/form.php').'

    I tried the include a ton of ways, none of them worked the intended way.

    2) The .= means take $variable and append the stuff after .= onto it.

    So:

    Code:
    $Table="<td>";
    $Table.="Test";
    $Table.="</td>";
    print $Table; //$Table contains <td>Test</td>
    Not sure I fully understood the question for #2 though, I just know there's no way to get include to do what Anirban wanted in 1 easy shot...There is if he puts everything in the included document into a function, but that might be more of a hassle than it's worth.


    TOS breakers will be suspended regardless of race, creed, national origin, hair color, or favorite food. Thanks for your understanding!

  9. #9
    Anirban1987's Avatar
    Anirban1987 is offline x10Hosting Member Anirban1987 is an unknown quantity at this point
    Join Date
    Sep 2008
    Location
    Kolkata , India
    Posts
    55

    Re: include page problem

    Quote Originally Posted by Livewire View Post
    Huh, shur enough, something isn't quite right here...hang tight, running it locally now and seeing if I can't figure out why in the name of zeus this thing isn't working quite right XD


    Shoulda tried it first before I said it was right I guess.



    Edit: Seems include/require don't work that way, the only way to make it work is something similar to this:

    Code:
    $Table.="<td>";
    include("Action/form.php");
    $Table.="</td>";
    Then in form.php:

    Code:
    $Table.="What have you!";
    Boils down to continuing to $Table.= whatever data you're adding via Action/form.php. Since Action/form.php is being included -after- $Table has been initially set it can keep using the existing variable, including adding new stuff to the end of it
    I have done it like that. Now the form is coming but not in the intended way it should come. The form should come in each cell under Action Taken column. But it is coming on the top of the page.

    The actual code that I hav pasted :
    Code:
    $Table .= "<td>";
    $Table .= include('Action/form.php');
    $Table .= "</td>";
    Anybody interested can hav a look at the actual page after logging into
    http://intranet.techdarpan.com/
    Username and password : guest
    And then go to the Content Management Panel
    Last edited by Anirban1987; 03-10-2009 at 03:23 AM. Reason: Posted the code

  10. #10
    Livewire's Avatar
    Livewire is offline Abuse Compliance Officer Livewire is a glorious beacon of lightLivewire is a glorious beacon of light
    Join Date
    Jun 2005
    Location
    Behind a keyboard.
    Posts
    8,998

    Re: include page problem

    So when you're adding those buttons from Action/form.php, Action/form.php is actually doing $Table.="CodeForButtons"; ?

    Cause if it's not, theres the problem - you can't do an echo if you're including it like that.


    Part of what I don't get though is why you're stuffing everything into the $Table variable anyways though - why not just echo/print it all straight to screen as you go through the records?

    Cause then it'd just be:

    print "<td>";
    include("Action/form.php"); //this prints/echos more code to the screen just as it's currently doing, rather than having to replace all the prints/echos with $Table.=
    print "</td>";


    This whole "store all in a variable and echo back at the very end" thing never made sense to me in any system I've seen it.


    TOS breakers will be suspended regardless of race, creed, national origin, hair color, or favorite food. Thanks for your understanding!

+ Reply to Thread
Page 1 of 2 12 LastLast

Similar Threads

  1. Zen Cart admin page problem
    By outbackp in forum Free Hosting
    Replies: 5
    Last Post: 09-02-2008, 05:49 AM
  2. Old apache welcome page problem
    By bunglebrown in forum Free Hosting
    Replies: 1
    Last Post: 08-25-2008, 04:46 PM
  3. Replies: 5
    Last Post: 04-06-2008, 12:47 PM
  4. Problem with my page
    By broadfriends in forum Free Hosting
    Replies: 1
    Last Post: 04-06-2008, 02:31 AM
  5. Do frames cause a problem?
    By Shoelace in forum Free Hosting
    Replies: 6
    Last Post: 02-14-2006, 09:52 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers