I cannot Upload files with PHP under XAMPP

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

I cannot Upload files with PHP under XAMPP

Postby rogerflu » 22. January 2011 01:39

Hi, All.I can't upload files using PHP under XAMMP.Take ta look:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>

<form action="up.php" method="post" enctype="multipart/form-data" name="form1" id="form1">
<input type="file" name="myfile" />
<input type="submit" name="button" id="button" value="Submit" />
</form>

</body>
</html>

Now, see up.php page:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<?php

echo $_FILES[ 'myfile' ][ 'name' ];

?>
</body>
</html>

So, when I enter it on my browser, the follow message brings:

Notice: Undefined index: myfile in /opt/lampp/htdocs/up/up.php on line 11

Anybody there could you help me?

Thanks!
rogerflu
 
Posts: 2
Joined: 22. January 2011 01:28

Re: I cannot Upload files with PHP under XAMPP

Postby rogerflu » 22. January 2011 02:42

I"ve solved the issue.The problema was on php.ini file.

thnak you!
rogerflu
 
Posts: 2
Joined: 22. January 2011 01:28


Return to XAMPP for Linux

Who is online

Users browsing this forum: No registered users and 7 guests