views:

97

answers:

5

Hi,

I have an index.html in my wampserver www directory. On this html, there is a link for a user to upload file. When I hit the link, I select files to upload but instead of the uploadmanager.php which i have tested in my eclipse debugg environment to work, it displays the some part of the code on the web page without doing anything thing. This is not what I expect. Can someone please tell me what is wrong? Thank you.

A: 

Are you posting to the uploadmanager.php page? Are you getting an error or just seeing the code? Can you post the code from the index.html page that handled the form and the part of the php code you're seeing for us to look at?

XOPJ
Could you please show the files
gajendra.bang
Sure I was posting to the uploadmanager. I was not having any error but just seeing the code. I was able to sort it out at the end not sure what I really did but restarted my wampserver. Thanks for getting back.
ibiangalex
+2  A: 

sound like you are using php-short-open-tags (<? instead of <?php) without enabling this in your php.ini. change your php.ini or use the standart open-tags to solve this.

oezi
no am not using the short tags but i would check my php.ini to be sure. thanks
ibiangalex
The short_open_tags are set to off which means by default the long ones are already enable and am using same in my codes.
ibiangalex
+1  A: 

Are you sure you enabled PHP in WAMP?

Rocket
Sorry Rocket for late reply I was able to sort it out.
ibiangalex
A: 

Can you please post the code of your: uploadmanager.php?

Enrico Pallazzo
A: 

Every now and then I have Apache serving the .php as downloadable files instead processing them on the server, but only with random requests.

Some reasons, why this might happen, are

  • PHP misconfiguration
  • PHP-files in a directory without execute rights
  • wrong content type sent
  • timeout from script execution

In my situation the last bullet is the most dangerous, but luckily it seems to show up only immediately after modifying some of the .php files. I haven't tracked the problem any deeper yet, but it seems to relate some filesystem level operations (as the disk I/O is a bottleneck) and presents itself only in testing env.

Jawa