SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Member
    Join Date
    Mar 2010
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    newbie echo/print question

    ok, i'm not an expert in php, but i'm pretty sure that my code is ok, but it just doesn't work as it should...
    Code:
    print "<table border='1'>" ;
    print "<tr> <th>Firstname</th> <th>Lastname</th> </tr>";
    this code just writes this out:
    " ; print " Firstname Lastname ";

    i tried with echo also, but that's all i get...
    how should i write that code? or is it server's parsing fault?

  2. #2
    Non-Member
    Join Date
    Oct 2009
    Posts
    1,852
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    you fail to run it with PHP

  3. #3
    Twitter: @AnthonySterling silver trophy AnthonySterling's Avatar
    Join Date
    Apr 2008
    Location
    North-East, UK.
    Posts
    6,111
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    You need to surround your code with PHP's opening tags.
    @AnthonySterling: I'm a PHP developer, a consultant for oopnorth.com and the organiser of @phpne, a PHP User Group covering the North-East of England.

  4. #4
    SitePoint Member
    Join Date
    Mar 2010
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i did it...
    there is a code around this one.. access to mySQL database and writing out one table in html list... but no error is met until print/echo code...

  5. #5
    SitePoint Member
    Join Date
    Mar 2010
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    it looks like a server's parsing error to me, but i don't know what to do then...
    or it could be something else?

  6. #6
    Non-Member
    Join Date
    Oct 2009
    Posts
    1,852
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    again: Server can't fail parsing if it didn't even start parsing.
    web server with php support must be set up and you must call this file from the server.

  7. #7
    SitePoint Member
    Join Date
    Mar 2010
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    damn... it was the extension... it was html automatically from my text editor...
    o.O
    i just tried <? phpinfo() ?> and while saving it, i noticed that... i'm messing with this since last night...
    sry for spamming on forum..


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •