Page 1 of 1

Slightly odd include(); output...

Posted: Wed Sep 17, 2008 1:02 pm
by Weasel5-12
G'day guys...

i know this may sound newbie, buts its confusing me like crazy so i thought if i should see if i could get some1 else's opinion on my little problem...

as im including a .inc file called dataOutputTable_1.inc i store it in a variable say... $output, at which point i echo out the $output and its should.. display as it would before i threw it into the .inc file right?? WRONG. =)

at the end of the .inc file... in the output only, its showing up with the number 1...


here's my php section..

Code: Select all

$output = include("dataOutputTable_1.inc");
echo $output;
 
Simple enough right..?

now my .inc file is a fair bit bigger to throw up here... so ill throw up a sample..
inc section...

Code: Select all

<table>
    <tr>
      <td>Number of ingredients: </td>
      <td>
        <input type='text' name='numOfIngredients' value="<?php echo $ingredientNum?>" readonly='readonly' />
      </td>
    </tr>
  </table>
  Are the above details correct?
<br><input type='submit' value='Correct'></form>

It is at the end of my form tag, that im getting the output of 1.

some1 please help? hahaha
cheers guys
-Weasel

Re: Slightly odd include(); output...

Posted: Wed Sep 17, 2008 1:06 pm
by arjan.top
remove echo $output;

Re: Slightly odd include(); output...

Posted: Wed Sep 17, 2008 1:10 pm
by Weasel5-12
cheers bro ! ahahhaah

thx for answerin so quickly

Re: Slightly odd include(); output...

Posted: Wed Sep 17, 2008 4:21 pm
by ahowell
You don't even need to pass the include into a variable. Just include it...

Code: Select all

include 'dataOutputTable_1.inc';

Re: Slightly odd include(); output...

Posted: Fri Sep 19, 2008 10:58 am
by Weasel5-12
sorry mate, just curious why. =p

Is it because the function include(); is returning true or some other reason?

cheers