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
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
currently you have this
try something likeCode:$Table .="<td>include'Action/form.php'</td>";
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
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!
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:
Then in form.php:Code:$Table.="<td>"; include("Action/form.php"); $Table.="</td>";
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 itCode:$Table.="What have you!";![]()
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!
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.
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:
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.Code:$Table="<td>"; $Table.="Test"; $Table.="</td>"; print $Table; //$Table contains <td>Test</td>
TOS breakers will be suspended regardless of race, creed, national origin, hair color, or favorite food. Thanks for your understanding!
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 :
Anybody interested can hav a look at the actual page after logging intoCode:$Table .= "<td>"; $Table .= include('Action/form.php'); $Table .= "</td>";
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
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!