Page 1 of 1

[solved]php plaintext output

PostPosted: 18. September 2012 04:42
by isankah
I am a new user of xampp and new in php, i was introduced php using APM setup, now want i want to use xampp and i moved all my files to xampp but when i try to open my site in the browser i have this error message
(".$query); logout(); include (MAIN_PATH."index.php"); break; case "signup": include (MAIN_PATH."index.php"); break; } }else{ switch($page){ case "Home": include (MAIN_PATH."index.php"); break; default: include (MAIN_PATH."index.php"); break; } } include (INCLUDE_PATH."footer.inc"); ?>
5e1f75ff-c7f6-4951-a455-51146a01bb24
Y2:5e1f75ff-c7f6-4951-a455-51146a01bb24) can someone help me please?

thanks

Re: php plaintext output

PostPosted: 18. September 2012 15:03
by Altrea
Hi,

That is no error message, this is outputted plain text, actually an interrupted / a part of a switch case block:
Code: Select all
[...]something missing[...]
        (".$query);
        logout();
        include (MAIN_PATH."index.php");
        break;
    case "signup":
        include (MAIN_PATH."index.php");
        break;
    }
}else{
    switch($page){
        case "Home":
            include (MAIN_PATH."index.php");
            break;
        default:
            include (MAIN_PATH."index.php");
            break;
    }
}
include (INCLUDE_PATH."footer.inc");
?>
5e1f75ff-c7f6-4951-a455-51146a01bb24
Y2:5e1f75ff-c7f6-4951-a455-51146a01bb24)


My first questions would be:
  • How do you open the file in your browser?
  • which address does your browsers address bar show at the time you get this output?

following questions:
  • is there an by mistake typed ?> in front of (".$query); in your sourcecode?
  • Which file type does the file have?
  • Are your sure this file is meant to be accessed directly, or does it need another file to include it?
  • Do you use short_open_tag <? instead of the full one <?php

best wishes,
Altrea

Re: php plaintext output

PostPosted: 19. September 2012 15:47
by isankah
hi, your hints have worked. I have got it, it is using the short tags that caused the problem.

Re: php plaintext output

PostPosted: 19. September 2012 15:51
by Altrea
Good news.
So i can mark this thread as solved 8)

I changed the headlines to something more selfspeaking. "using xampp" is far away from being selfspeaking.