$(document).ready(function(){
        var status;
        var photo_url;
        var ext;
    $("#photo_file").change(function() {
        photo_url = this.value.split("\\").pop();
        ext = photo_url.split('.').pop().toLowerCase();
        if ( (ext == "jpg" ) || ( ext == "jpeg") ||  (ext == "png") ) {
            $.get('ajax/post.php', {photo_url: photo_url});
        } else {
            alert("incorrect file type, allowed: jpg, jpeg, png.");
        }
    });
this is "post.php"
<?php
    $photo_url = $_GET['photo_url'];
    $file_path = 'uploaded_photos/' . $photo_url;
    $photo_url = 'img/' . $photo_url;
    move_uploaded_file($photo_url, $file_path);
?>
Everything works fine i get the filename of photo but i can't move it to another folder using move_uploaded_file(); function.
 
    