Page 1 of 1

Something is wrong with the XAMPP installation :-(

PostPosted: 11. March 2015 12:17
by charm2013
XAMPP 5.6.3
[PHP: 5.6.3]
OS: Windows 8.1
Code: Select all
<?php
   if (!empty($_SERVER['HTTPS']) && ('on' == $_SERVER['HTTPS'])) {
      $uri = 'https://';
   } else {
      $uri = 'http://';
   }
   $uri .= $_SERVER['HTTP_HOST'];
   header('Location: '.$uri.'/xampp/');
   exit;
?>
Something is wrong with the XAMPP installation :-(

Image
Please help me somethings wrong with the PHP ...
as you can see the image, when I call the index.php from htdocs on my browser, this happened..please help me.. thanks..
Image
while the HTML is working...

Re: Something is wrong with the XAMPP installation :-(

PostPosted: 11. March 2015 12:31
by Nobbie
You have to learn a lot - HTML is interpreted by the browser, but PHP is NOT(!) interpreted by the browser, but by the Server (Apache/PHP). Therefore you cannot simply double click or open a PHP file in a browser, you must submit a valid URL in the browser, in your case http://localhost/index.php

Re: Something is wrong with the XAMPP installation :-(

PostPosted: 12. March 2015 09:50
by charm2013
Nobbie wrote:You have to learn a lot - HTML is interpreted by the browser, but PHP is NOT(!) interpreted by the browser, but by the Server (Apache/PHP). Therefore you cannot simply double click or open a PHP file in a browser, you must submit a valid URL in the browser, in your case http://localhost/index.php

it's okay now.. thanks for the comment ! :)