File location

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

File location

Postby Gernicha » 28. October 2010 11:00

Hello everyone,
I'm new to XAMPP and I would like to know where to put all my html/php files.

Is there a www directory?

Also, I would like to know how to get my html onto the localhost. E.G Click this then do that etc.

Thank you in advance,

Gernicha
Gernicha
 
Posts: 6
Joined: 28. October 2010 10:55

Re: File location

Postby Gernicha » 28. October 2010 21:37

Yes, I know.

But thanks anyway! I just want tp know the steps...

Thanks!
Gernicha
 
Posts: 6
Joined: 28. October 2010 10:55

Re: File location

Postby Gernicha » 28. October 2010 22:15

My PHP files aren't working,
When I try to use them, it either just shows the source code or tries to download it...

Your help would be greatly appreciated!

Thank you,

Gernicha
Gernicha
 
Posts: 6
Joined: 28. October 2010 10:55

Re: File location

Postby JonB » 28. October 2010 23:16

Are you staarting the pages in your browser by opening them as in http://localhost/myphppage.php ??

Does the http://localhost/xampp/index.php page work?

Are you using php's short_open_tags? <? instead of <?php

if so, you will need to fix that in your php.ini

http://php.net/manual/en/ini.core.php
User avatar
JonB
AF Moderator
 
Posts: 3210
Joined: 12. April 2010 16:41
Location: Land of the Blazing Sun
Operating System: Windows XP/7 - Fedora 15 1.7.7

Re: File location

Postby Gernicha » 28. October 2010 23:49

Well, it's not really a index page, I'm using it as a file uploader. But, when it is ment to redirect to the php file it just displays source...

Thank you for all of your help!
Gernicha
 
Posts: 6
Joined: 28. October 2010 10:55

Re: File location

Postby Gernicha » 29. October 2010 02:29

Here's the code (I didn't write it):

HTML (upload.html):

<html>
<body>
<form enctype="multipart/form-data" action="uploader.php" method="POST">
<input type="hidden" name="MAX_FILE_SIZE" value="100000" />
Choose a file to upload: <input name="uploadedfile" type="file" /><br />
<input type="submit" value="Upload File" />
</form>
</body>
</html>


PHP (uploader.php):

<?php
$target_path = "uploads/";

$target_path = $target_path . basename( $_FILES['uploadedfile']['name']);

if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) {
echo "The file ". basename( $_FILES['uploadedfile']['name']).
" has been uploaded";
} else{
echo "There was an error uploading the file, please try again!";
}
?>
Gernicha
 
Posts: 6
Joined: 28. October 2010 10:55

Re: File location

Postby Altrea » 29. October 2010 18:21

I will repeat the question:

Do you open the html/php file with the http: protocol?
more clearly: what does the browser address bar tell you, if you open and/or send the html form page?
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11935
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64

Re: File location

Postby Gernicha » 30. October 2010 07:10

Sorry, fixed the problem!!
Thank you all SOOOO much!
Gernicha
 
Posts: 6
Joined: 28. October 2010 10:55


Return to XAMPP for Windows

Who is online

Users browsing this forum: marcodelloca and 103 guests