Source code is displayed on screen and does not run

Asked

Viewed 3,320 times

6

A code of mine gave problem and kept appearing some snippets of it on a blank screen when I ran:

Demonstração

The code was right, I didn’t know what the problem was, so I went to test another code that a few days ago had worked perfectly (I didn’t modify it at all, I didn’t even open the code):

"; } ?>

What am I doing wrong?

  • Post the code with problem.

  • The first code "http://www.mediafire.com/download/rpczqpm3luxykmk/SistemaDeLogin.rar" and the second "http://www.mediafire.com/download/f92glgasmxuc8dc/TesteUpload.rar".

  • Put the code that is problematic in the question.

  • What HTTP server are you using? How did you install PHP? Tested without any . htaccess in the folder? If the PHP installation is correct, the problem is tag closure. Post the code in the question.

1 answer

12


This happens when the short_open_tag(<?) is not enabled on the server, to solve the problem change all occurrences of:

<?

for

<?php

Another way is to enable it by php.ini, after the change restarts the server.

Change the value:

short_open_tag = Off

To:

short_open_tag = On

Another cause might be the wrong file access(via browser), it doesn’t work call the url fil:///c:\projeto\arquivo.php right is something like http://localhost/projeto/arquivo.php

  • I had forgotten that I reinstalled the WAMP and forgot to enable, vlw by force bro

  • Didn’t solve in mine, the beginning of the tag is already <?php and the end ?>

  • @Caiovieira you changed the way to access the url?

  • changed and did not access the file, I left it like this: http://localhost/wamp/www/meixautonomoresultados.php

  • http before localhost

  • @Caiovieira http:/localhost/meixautonomoresults.php so you can access?

  • couldn’t...

  • @Caiovieira wamp is on? what’s the name of your project’s folder? if you just try http://localhost what happens?

Show 3 more comments

Browser other questions tagged

You are not signed in. Login or sign up in order to post.