Did i go an goof?

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

Did i go an goof?

Postby jammy » 19. August 2014 17:43

Ello all, im in love with xampp, though its confusing me right now,

So last night i successfully installed IPB and SMF as well as Mediawiki and one cloud so i know how i want everyting to look, and this morning i did a small navigation code which showed up;

Code: Select all
<div id="nav_bar">
   <!-- span sets up the nav bar -->
   <span></span>
   <div class="side_bar_logo">
      <!-- this handles the logo -->
      <a href=""><img  src="images/pictures/logo.png" /></a>
   </div>
   <!-- this sets up the nav buttons -->
   <div class="button_holder">
      <!-- nav button -->
      <button onclick="location.href='#'" class="nav_button">Videos</button>
      <button onclick="location.href='#'" class="nav_button">Cheats</button>
      <button onclick="location.href='#'" class="nav_button">Forum</button>
      <button onclick="location.href='#'" class="nav_button">Chat</button>
      <button onclick="location.href='#'" class="nav_button">News</button>
      <button onclick="location.href='#'" class="nav_button">Shop</button>
      <button onclick="location.href='#'" class="nav_button">Login</button>      
   </div>
</div>

and it shows as; http://imgur.com/nAzeGso

and mysql and everyting is running right, it connected and everything,the file is saved as nav.php and isnt in the htdocs for xampp, but my issue lays with what im doing right now, so i have set up a template to run it, just to make sure my php was working i decided to run it to see if
Code: Select all
<?php echo $sitename ?>
would work but it seems like i did something wrong, i have it saved outside htdocs and inside it but it still displays;

Code: Select all
<?php include ('includes/variables.php') ?>
<html>
   <head>
      <title><?php echo $sitename ?></title>
   </head>
<body>



</body>   
</html>


like shown here: http://imgur.com/iympuAv
Any idea if i did something wrong, they are both indeed saved with a php extention (i included the url bar to show that) any help would be appreaciated :)
jammy
 
Posts: 2
Joined: 19. August 2014 17:30
Operating System: windows

Re: Did i go an goof?

Postby Nobbie » 19. August 2014 20:52

Your image shows your big big error immediately - you did not start your scripts via a server (localhost for example), instead you simply double clicked the script in your explorer: that does not work!

This is obvious, because your browser shows "file:/// as protocoll" and that is not working. Internet sites have to be called with "http://" (or http://) and NOT with file://. That is all.

I think, you have no basic skills about HTTP and how Apache etc. is working. First of all, you MUST NOT store your PHP files into your local folders, you have to store it to c:/xampp/htdocs (i assume, you installed Xampp correctly to c:/xampp). At next, do NOT double click PHP files in your explorer, instead enter "http://localhost/nav.php" in your browser, where nav.php has to be stored in c:/xampp/htdocs.

Finally, go for tutorials and documentation, how Apache works and how to understand HTTP and how communication between a webserver and your browser works.
Nobbie
 
Posts: 13170
Joined: 09. March 2008 13:04


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 102 guests