Jump to content

File upload problem


tomkure

Recommended Posts

Hi everybody,

 

I have recently change to a new server, and have some problem with a script for uploading files on my new server.

Script is an old which I have updated with new php command, <? not accepted in new server.

 

Scripts shall upload picture to folder in server and write information to database

 

From form script I am saving my upload

 

<input type="hidden" name="Mode" value="EditMapProperty" />
<input type="hidden" name="Old_Map" value="<?php echo $Property->Get_Map();?>" />

 

In my php script I do

 

elseif($Mode=="EditMapProperty"):

  $Map_name = $HTTP_POST_FILES['Map']['name'];

  $Property=new Property($PropertyID);

  $ReferenceNo=$Property->Get_ReferenceNo();

  if($Map!=""): $DeleteMap=$Dir_MapProperty_Admin."".$Property->Get_Map();  @unlink($DeleteMap); endif;

  if($Map_name==""):

    $Map=$Old_Map;

  else:

    copy($HTTP_POST_FILES['Map']['tmp_name'],

    $Dir_MapProperty_Admin."".$ReferenceNo."-".$Map_name);

    $Map=$ReferenceNo."-".$Map_name;

  endif;

 

  $Property->EditMap($Map);  //Update database information

         

  echo "<meta http-equiv=\"refresh\" content=\"0;URL=$Redirect2?p=property_details&PropertyID=$PropertyID\">"; 

 

Can any help if there are any PHP problem in this coding.

 

Kind Regards

Tom

Link to comment
Share on other sites

The forum's menu button you used to highlight your php code is for making links to the php manual section for php keywords. Just use the forum's


bbcode tags for php code.

 

$HTTP_POST_FILES was depreciated a really long time ago, turned off by default in php5.0, finally throws a depreciated error in php5.3, and is completely removed in php5.4. Use $_FILES instead of $HTTP_POST_FILES

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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