I'm in the process of converting an application from php 4 to php 5, moving it to another server, and updating the backend database from mysql to sql server.

I have already copied the website to the new server which is running php 5. When I try to open a page, it displays the html but but shows a bunch of code as well. I looked through my code and found that the code starts displaying after a symbol "->". What does this symbol mean??

a line of code containing this symbol is
return $person_query_obj->row["Name"];

Any ideas??

    It's a sort of object hierarchy symbol (not sure what the technical term for it is). Basically, the item on the left is the "parent" of the "child" item on the right. So something like $obj->var refers to the variable "var" with is an attribute of object "obj", or $obj->func() refers to the method (i.e. class function) "func" of object "obj". If you are familiar with JavaScript, it is essentially the same as the "." operator in JS, such as with document.write().

      jreed2132 wrote:

      I looked through my code and found that the code starts displaying after a symbol...

      and the reason for this is most likely because your server isn't running PHP at all - if you looked at the HTML instead of just the browser's rendering of it you'd probably see the rest of the code as well.

        Also, be careful how you declare your PHP statements. Some people like to declare their PHP code with <? instead of <?php. While the shorthand syntax often works, it doesn't always. It can be disabled during installation, and <? is also a declaration for XML, if I'm not mistaken...

          Write a Reply...