The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
Admincp Upload Form
Hey guys,
I created an upload form for my admincp script but I am having problems with it. When I try to var_dump($_FILES) it only returns array(1) { ["image"]=> NULL } and no file is being uploaded. $vbulletin->GPC['image']['name'] is empty as well. My destination folder is chmodded 777. Any help? Below is the code. thanks! Code:
if ($_REQUEST['do'] == 'editrelease') { $vbulletin->input->clean_array_gpc('r', array( 'releaseid' => TYPE_STR )); $release = $vbulletin->db->query_first("SELECT * FROM " . TABLE_PREFIX . "releasesystem_releaseinfo WHERE releaseid = '". $vbulletin->GPC['releaseid'] ."'"); print_cp_header("Edit Release ". $release['title']); print_table_start(); print_table_header("Edit Release ". $release['title'], 2); print_form_header('releasesystem_admin', 'editreleasedo'); print_upload_row("Image", 'image'); construct_hidden_code('releaseid', $vbulletin->GPC['releaseid']); print_submit_row("Save Release", 0, 2); print_table_footer(); } if ($_REQUEST['do'] == 'editreleasedo') { $vbulletin->input->clean_array_gpc('p', array( 'releaseid' => TYPE_STR, )); $vbulletin->input->clean_array_gpc('f', array( 'image' => TYPE_FILE, )); if ($vbulletin->GPC['image'] != "") { $uploaddir = './images/releases/'; $unique = time(); $newfilename = $unique . "-" . $_FILES['image']['name']; $largepic = $uploaddir . basename($newfilename); move_uploaded_file($_FILES['image']['tmp_name'], $largepic); //here is the db query } //redirect message } Nvm, I figured it out.This: Code:
print_form_header('releasesystem_admin', 'editreleasedo'); Code:
print_form_header('releasesystem_admin', 'editreleasedo', 1, 1); |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|