The MU forums have moved to WordPress.org

How to properly echo a function? (12 posts)

  1. verbal36
    Member
    Posted 17 years ago #

    I'm a bit of a php novice and have had a terribly hard time properly getting a specific functions called using the echo syntax. I'm sure is something really stupid that I'm missing here's a text file with the php code I'm using.

    echo.txt

  2. andrewbillits
    Member
    Posted 17 years ago #

    echo function_name();

    or

    echo function_name('var1','var2',$var3);

    Of course the function has to actually spit out something in order for it to work.

    You should also note that some functions take care of 'echo'ing the data so you can leave the "echo" off of the function call.

  3. verbal36
    Member
    Posted 17 years ago #

    Thanks for your reply Andrew.. I applied the solution you gave and now get this error: Parse error: syntax error, unexpected '<' in /home/user/blah/controller.php on line 10

    Here is the revised code I did using you're suggestion
    echo_rev1.txt

    any suggestions?

    additional info: I'm employing a moo tabs effect that I've done before on other "non wp sites" successfully. I'm calling js include files from another location and the controller.php file (the one thats giving me the problems)..is in my MU root.

  4. andrewbillits
    Member
    Posted 17 years ago #

    I would have to have the entire controller.php to be able to tell you what's causing the error on line 10.

    However, it looks like your using one of my plugins. So try taking the echo out of:
    echo list_all_wpmu_blogs

    I'm not sure about the second one though.

  5. verbal36
    Member
    Posted 17 years ago #

    I would have to have the entire controller.php to be able to tell you what's causing the error on line 10.


    The txt file I posted actually is the code in it's entirety..here's a php file though.. controller example file
    Here also is a link to what its doing on my front page (moo tabs effect on the right) My front page

    I also took off to the "echos" with similar results. I've been doing some searching around the forum for a solution but havent found one that seemed to be like this.. I also seem to not be able to find a "php for reallllll dummies" around ..lol

  6. andrea_r
    Moderator
    Posted 17 years ago #

    php.net ?

  7. verbal36
    Member
    Posted 17 years ago #

    php.net ?

    ?????

  8. andrewbillits
    Member
    Posted 17 years ago #

    The problem is that you've placed the function calls in a php file that does not include any bit of WPMU whatsoever.

    Try including wp-config.php in controller.php.

    Also, extending andrea's posts, php.net is a very good start for someone new to PHP.

  9. verbal36
    Member
    Posted 17 years ago #

    Try including wp-config.php in controller.php.

    That seemed to do the trick for me....

    I'll spend some time searching through php.net for good php tutorial sites for beginners

  10. andrewbillits
    Member
    Posted 17 years ago #

    This site has helped me in the past.

    Glad you got it working :)

    Edit:
    Nice WPMU site by the way.

  11. Bike
    Member
    Posted 17 years ago #

    @verbal
    The site looks nice, but I am not sure what monitor size you have, as for me the main content is completely 'below the fold'. I checked the forum tab, and first though it was not yet installed, then I noticed I had to scroll a full page down. You might want to differentiate between the home page and section headers. Just my €0,02

  12. verbal36
    Member
    Posted 17 years ago #

    I am not sure what monitor size you have, as for me the main content is completely 'below the fold'. I checked the forum tab, and first though it was not yet installed, then I noticed I had to scroll a full page down.

    The browser resolution I typically look at it in is 1024x768. The site looks consistent in ff and ie7 (I've spotted some issues in ie6)..at that resolution. I haven't even begun debugging as I've made the decision to finish some of the functionality aspects first..lol Putting together a good looking/well functioning mu site is a freakin' challenge man!

    BTW
    Thanks Bike/andrewbillits for the compliments on the site aesthetics.. I was waiting till I got all the browser issues worked out before I posted it in the "show your site" forum.

    Edit:
    @andrewbillits..the site you suggested is a good one.

    For those looking for a free multi version i.e renderer should take a look at this free service netrenderer

About this Topic

  • Started 17 years ago by verbal36
  • Latest reply from verbal36