Download non passing variables, session problem?

For the love of the chick, I cannot make him accept any variables in my SQL-db. If I put static information, it works. I cannot pass any parameters using scriptdata, and this makes it more complicated because I use the smarty template system on top.

I tried to do it.

 {literal}
<script type="text/javascript">
jQuery(document).ready(function() {
    jQuery("#fileUpload").uploadify({

        'scriptData'     :{'alb_id': '{/literal}$alb_id{literal}','mem_id': '{/literal}$info.mem_id{literal}'},
        'uploader': '/ajax/upload/uploadify.swf',
        'cancelImg': '/ajax/upload/cancel.png',
        'script': '/ajax/upload/uploader.php',
        'folder': 'photos',
        'multi': true,
        'displayData': 'speed',
        'fileDesc'  : 'Image Files',
        'fileExt': '*.jpg;*.jpeg;',
        'simUploadLimit': 200,
        'width'          : 130,
        'queueID'        : 'fileQueue',
        'buttonImg': '/themes/mytheme/gfx/buttons/but_browse.gif'       
    });

});
</script>
{/literal}

In my template file. Part of the download is working fine. Just not mysql. I use the function built into the script to resize images for thumbnails and what not and create a directory. It all works. It just will not pass any variables in db.

include_once("../../includes/config/config.inc.php");
    //load libraries
include(DOC_ROOT."/libraries.php");


$conn = mysql_connect(SQL_HOST, SQL_USER, SQL_PASS,1);
mysql_select_db(SQL_DB,$conn);

$alb_id = $_REQUEST['alb_id'];
$mem_id = $_REQUEST['mem_id'];  


if (!empty($_FILES)) {
    $tempFile = $_FILES['Filedata']['tmp_name'];

        $extension = ".jpeg";
        $photo = build_thumbnailes($tempFile,$extension);

        $sql ="INSERT INTO `photos`(`mem_id`, `photo`, `photo_med`, `photo_small`, `approved`,`posted`, `upload_date`) 
        VALUES 
        ('$alb_id', '".$photo["ex"]."', '".$photo["med"]."','".$photo["small"]."' , '1', time(), time())";
        mysql_query($sql) or die(mysql_error());

Please help if you can. I'm going crazy with this thing. Thank.

+3
3

, , "", .

  • :

    'scriptData': {'alb_id': '{/literal}$alb_id{literal}',
                   'mem_id': '{/literal}$info.mem_id{literal}'},
    

    $alb_id $info.mem_id ( ). :

    'scriptData': {'alb_id': '{/literal}{ $alb_id }{literal}',
                   'mem_id': '{/literal}{ $info.mem_id }{literal}'},
    
  • -, , PHP. :

    if (!empty($_FILES)) {
        $tempFile = $_FILES['Filedata']['tmp_name'];
    

    :

    if (is_uploaded_file($_FILES['Filedata']['tmp_name'])) {
        $tempFile = $_FILES['Filedata']['tmp_name'];
    

, , , , . , ? , ? , , , .

MySQL? , ? .

+2

script - , upload.php. , , .

, build_tumbnailes ?

0

, , - {literal}. !

-1

Source: https://habr.com/ru/post/1760015/


All Articles