-2
Good morning, everyone. I’m trying to do a simple PHP video upload. My HTML code is here:
<html>
<head>
<title>Aproveite o site</title>
</head>
<body>
<form enctype="multipart/form-data" action="videosUpload.php" method="POST">
<input type="text" name="texto">
<input type="file" name="file">
<input type="submit" value="Submit">
</form>
<a href=sair.php>sair</a>
</body>
</html>
My PHP code is here:
<html>
<body>
<?php
echo $_POST['texto'];
//resto do código criado
?>
<a href="videos.php">Voltar</a>
</body>
</html>
The problem is: When I do not select a file to upload, echo shows the value of the field passed by the POST method, but if I select a video file, it shows the following error: Undefined index: text.
Some solution?
I’m using Uwamp on a Windows10 machine.
Thank you.