PHP Error with xampp?

Problems with the Windows version of XAMPP, questions, comments, and anything related.

PHP Error with xampp?

Postby roper1979 » 21. April 2009 20:46

First, I'll apologise if this is a stupid question - I've tried searching for an answer on here but I can't find one.

I'm using an NC10 with XP32SP2 to learn my way around php.
Xammp 1.7.1, and I'm running apache as a service as I want to be able to test my code before uploading it.

phpinfo() works fine, and xampp control panel shows everything is running fine (as services).

But when I try to preview my work via my browser (both with IE7 and firefox) the html shows fine, but the PHP code is printed on screen in a garbled fashion.
I've tried using http://127.0.0.1, http://localhost, turning off firewall, checking my hosts file info, and every combination thereof.
I get no joy.

the php script is: (taken straight from a tutorial book - fed from an html page using POST)
Code: Select all
<html>
   <head>
      <title>Aliens Abducted Me - Report an abduction</title>
   </head>
   <body>
      <h2>Aliens Abducted Me - Report an abduction</h2>
      <?php
         $when_it_happened = $_POST['whenithappened'];
         $how_long = $_POST['howlong'];
         $alien_description = $_POST['description'];
         $fang_spotted = $_POST['fangspotted'];
         $email = $_POST['email'];
         echo 'Thanks for submitting the form.<br />';
         echo 'You were abducted ' . $when_it_happened;
         echo 'and you were gone for ' . $how_long.'<br/>';
         echo 'Describe them: ' . $alien_description.'<br />';
         echo 'Was Fang there?' . $fang_spotted.'<br />';
         echo 'Your email address is ' . $email;
      ?>
   </body>
</html>

but what I get when I run the script is...
Code: Select all
Aliens Abducted Me - Report an abduction
'; echo 'You were abducted ' . $when_it_happened; echo 'and you were gone for ' . $how_long.'
'; echo 'Describe them: ' . $alien_description.'
'; echo 'Was Fang there?' . $fang_spotted.'
'; echo 'Your email address is ' . $email; ?>

The fact that part of the response is missing made me think that I'd made a syntax error, but I've rechecked and rechecked and can't see one - the only conclusion I can come to is that - for some reason - the PHP isn't being dealt with properly?
HELP!!!
roper1979
 
Posts: 5
Joined: 21. April 2009 20:27

Re: PHP Error with xampp?

Postby Wiedmann » 21. April 2009 20:56

the php script is:

What's the file extension from that script?
Wiedmann
AF Moderator
 
Posts: 17106
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Re: PHP Error with xampp?

Postby roper1979 » 23. April 2009 23:47

Problem solved... it may or may not have involved incorrect UTF8 codes... :oops:
roper1979
 
Posts: 5
Joined: 21. April 2009 20:27


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 63 guests