Jump to content

Prob in upload


dream25

Recommended Posts

Hi All... Im newbie to PHP.. actually i wrote a code for upload... when i run that code its shows...

Warning: move_uploaded_file(../xampp/htdocs/general/test.php) [function.move-uploaded-file]: failed to open stream: No such file or directory in C:\xampp\htdocs\upload.php on line 9

 

Warning: move_uploaded_file() [function.move-uploaded-file]: Unable to move 'C:\xampp\tmp\php65.tmp' to '../xampp/htdocs/general/test.php' in C:\xampp\htdocs\upload.php on line 9File uploaded.

Select File:   

that saving path has been rite... but i dont know y its shows this error.. Please Help Me.. Here i attached the coding...

<?php

 

  if ($_POST[submitB] == "Upload File")

  {

 

echo exec('whoami');

move_uploaded_file ($_FILES['uploadFile'] ['tmp_name'],

      "../xampp/htdocs/general/{$_FILES['uploadFile'] ['name']}");

     

    echo "File uploaded.";

     

 

  }?>

 

 

<html>

<body>

<form enctype="multipart/form-data" action="upload.php" method="post">

 

Select File: <input type="file" name="uploadFile">

 

<input name="SubmitB" type="submit" value="Upload File">

 

</form>

</body>

</html>

Thanks In Advance..

Link to comment
https://forums.phpfreaks.com/topic/54234-prob-in-upload/
Share on other sites

Hi.. i have one more doubt.. please clear  it.. i wrote a code for search engine.. if i run that code.. its shows.. nothing.. the code has follows..

 

<html>

<body>

Search:

<form method='post' action='search.php'>

<input type='text' name='search' size='25' maxlength='25'>

<input type='Submit' name=' Search ' value='Submit'>

</form>

</body>

</html>

 

<?php

 

$host="localhost";

$username="root";

$password="";

$db_name="database1";

$tbl_name="table1";

if(isset($_POST['submit']))

{

 

  echo "Your Name Is <br>" . $_POST['search'] ;

 

mysql_connect("$localhost", "$username", "$password")or die("Cannot connect");

mysql_select_db("$db_name")or die("Cannot select database");

 

$search=$_POST["search"];

 

$result = mysql_query("SELECT * FROM '$tbl_name' WHERE name LIKE '%$search%'");

 

while($r=@mysql_fetch_array($result))

{

 

//change the names to your columns

  $topic=$r["topic"];

  $message=$r["message"];

  $name=$r["name"];

  $date=$r["date"];

  $id=$r["id"];

 

  //display the row

  echo "<b>$id</b> | <b>$topic</b> by <b>$name</b> at <b>$date</b><br><br>$message";

}

if(!search){

echo "Please enter a search.";

}

else

{

echo "Sorry, there were no searches with the criteria of <b>$search</b>.";

}

}

?>

Thanks In Advance

Link to comment
https://forums.phpfreaks.com/topic/54234-prob-in-upload/#findComment-268166
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.