Sponsored by NuSphere - PHP Software for PHP Application Developers - On Sale This Week for $100



Go Back   PHP-Editors > Programming Help > PHP Programming Help

PHP Programming Help Post any question relating to PHP Programming here and hopefully someone can help.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 2008-05-02, 09:09 PM
Junior Member
 
Join Date: Sep 2007
Posts: 5
crazydogz is on a distinguished road
Default Problem with Include function

I'm getting an error when writing this script and its probably something stupid im doing and im tired but hoping someone can help. Problem is with the include statement not executing right.

PHP Code:
<?php if ($ore == 0) echo ''; else echo ' <td bgcolor="#484848" align="center" width="120"><b> ' . include("name.php") . ' </b></td> ';?>
I have also tried it with include like this

PHP Code:
include('name.php'
and

PHP Code:
include("name.php"

Last edited by crazydogz; 2008-05-02 at 10:17 PM.
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 2008-05-03, 12:04 AM
Junior Member
 
Join Date: Apr 2008
Location: Cheltenham, UK
Posts: 11
hoopyfrood is on a distinguished road
Default Include function

Man, could be as simple as omitting the semi-colon at the end of the statement?

Good luck, let me know,
hoopyfrood
__________________
Love your documents!

DocuView - The best Web 2.0 document management system (DMS) - utilising the latest technology to help your company achieve ISO 9001 certification.
Reply With Quote
  #3 (permalink)  
Old 2008-05-06, 07:31 AM
Senior Member
 
Join Date: Dec 2004
Posts: 199
strasm is an unknown quantity at this point
Default

Why no curly braces? I think that is the problem. Try putting your code this way:

Code:
<?php 

if ($ore == 0){ 
  echo ''; 
}else{ 
  echo '<td bgcolor="#484848" align="center" width="120"><b> ' . 
    include("name.php") . 
    '</b></td>';
}
?>

Last edited by strasm; 2008-05-06 at 07:35 AM.
Reply With Quote
  #4 (permalink)  
Old 2008-05-21, 03:29 AM
Junior Member
 
Join Date: Sep 2007
Posts: 5
crazydogz is on a distinguished road
Default

Tried your code and this is the message im getting plz help.

Warning: error_log() has been disabled for security reasons in /www/110mb.com/a/r/a/m/a/k/i/_/aramaki/htdocs/variable.php on line 25
include(name.php</td>) [function.include]: failed to open stream: No such file or directory

Warning: error_log() has been disabled for security reasons in /www/110mb.com/a/r/a/m/a/k/i/_/aramaki/htdocs/variable.php on line 25
include(name.php</td>) [function.include]: failed to open stream: No such file or directory

Warning: error_log() has been disabled for security reasons in /www/110mb.com/a/r/a/m/a/k/i/_/aramaki/htdocs/variable.php on line 25
include() [function.include]: Failed opening 'name.php</td>' for inclusion (include_path='.:/usr/share/php')

so you know what name.php (snippet)

PHP Code:
$arkvalues = array($mega => 333$trit => 300$zyd => 166); 
$crimarkvalues = array($mega => 350$trit => 315$zyd => 174);
$primarkvalues = array($mega =>366 $trit => 330$zyd => 183);
 
switch(
$ore){
case 
0""; break;
case 
1: foreach( $arkvalues as $mineral => $num){
echo 
"<b>$mineral</b> : $num <br />"; }; break;
case 
2: foreach( $crimarkvalues as $mineral => $num){
echo 
"<b>$mineral</b> : $num <br />"; }; break;
case 
3: foreach( $primarkvalues as $mineral => $num){
echo 
"<b>$mineral</b> : $num <br />"; }; break;

or if you have a better idea on how to make this code work i am open to ideas and if you could show me alittle code to point me in the right direction that would be great.

Last edited by crazydogz; 2008-05-21 at 03:42 AM.
Reply With Quote
  #5 (permalink)  
Old 2008-05-23, 03:09 AM
Junior Member
 
Join Date: Sep 2007
Posts: 5
crazydogz is on a distinguished road
Default Solved it

never mind i got it working thanks for the help though.
Reply With Quote
Must read Review for Serious PHP Developers


NuSphere PhpED 5.0 : The Staff of php-editors.com recently spent a few days working with NuSphere PhpED 5.0 (a popular PHP IDE) and NuCoder 1.4 (a PHP Encoding Utility), read up on all the details.

Sponsored Links
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 04:57 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.1.0
© Copyright 2003-2008 www.php-editors.com. The ultimate PHP Editor and PHP IDE site.