Jump to content

narjis

Members
  • Posts

    107
  • Joined

  • Last visited

Everything posted by narjis

  1. I got and assignment to convert html with<divs> and <ul><li>,css, js and all to be converted to php. I know simple programs but how do I convert this type of index.html to dynamic php. I saved it as index.php but want to manage heders and footers. Can anybody help me.
  2. Only the following errers Warning: move_uploaded_file(upload/w5.jpg) [function.move-uploaded-file]: failed to open stream: No such file or directory in C:\xxxx\xxxx\samples\Upload_file.php on line 37 and Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move 'C:\xampp\anonymous\php69.tmp' to 'upload/w6.jpg' in C:\xampp\xxx\samples\Upload_file.php on line 26 each time it gives a random nam.tmp
  3. whn I run with print_r command thn it shows the following path but I cannot view th php2C.tmp file in the folder. Also move_uploaded_file() command also gives the same warning as unable to open file stream no such file exists. Please help Array ( [file] => Array ( [name] => w6.jpg [type] => image/jpeg [tmp_name] => C:\xxx\anonymous\php2C.tmp [error] => 0 => 8268 ) )
  4. <body> <form action="upload_file.php" method="post" enctype="multipart/form-data"> <label for="file">Filename:</label> <input type="file" name="file" id="file" /> <br /> <input type="submit" name="submit" value="Submit" /> </form> </body> if ((($_FILES["file"]["type"] == "image/gif") || ($_FILES["file"]["type"] == "image/jpeg") || ($_FILES["file"]["type"] == "image/pjpeg")) && ($_FILES["file"]["size"] < 20000)) { if ($_FILES["file"]["error"] > 0) { echo "Return Code: " . $_FILES["file"]["error"] . "<br />"; } else { echo "Upload: " . $_FILES["file"]["name"] . "<br />"; echo "Type: " . $_FILES["file"]["type"] . "<br />"; echo "Size: " . ($_FILES["file"]["size"] / 1024) . " Kb<br />"; echo "Temp file: " . $_FILES["file"]["tmp_name"] . "<br />"; if (file_exists("upload/" . $_FILES["file"]["name"])) { echo $_FILES["file"]["name"] . " already exists. "; } else { if(is_uploaded_file($_FILES["file"]["name"])) { move_uploaded_file($_FILES["file"]["tmp_name"], "upload/" . $_FILES["file"]["name"]); echo "Stored in: " . "upload/" . $_FILES["file"]["name"]; } } } } else { echo "Invalid file"; }
  5. I am using xammp with FileZilla running on it. I've changed my php.ini settings to "C:/xxx/tmp" directory but am unable to upload a file. Th cod is running but it dos not seem to upload the temporary fil. Plase somebody help me. ALso my form in upload.html has <form action="upload_file.php" method="post" enctype="multipart/form-data">
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.