I'm using a php script where you can upload files. I'm trying to create two uploads, so I copied uploader.php and renamed it uploader1.php, then on the web page I changed the link to this: <a href="/uploader1.php">
When I click the link the next page I see looks like the original, as expected, but in the browser it shows uploader.php instead of what I expected to see which is uploader1.php. Can you tell me why? Thanks.
Here's the uploader1.php file code.
Code:
<?php
include_once ('classes/config.php');
include_once ('classes/sessions.php');
include 'uploader_conlib.php';
$config['notification_error'] = $lang_error;
$page_title = $lang_upload_video;
if ($_SESSION['user_id'] == "") {
header('Location: login.php');
die();
}
$load_javascript = 1;
$ahah = 1;
$thickbox = 1;
//echo $debugmodex;
//get channel data, create "select" form fields to load into form
$sql = "SELECT channel_id, channel_name FROM channels";
$result1 = @mysql_query($sql);
$count_cats = @mysql_num_rows($result1);
$fields_all = "";
$sub_fields_all = "";
$show_fields = "";
$fields_all .= '<option value="99999">Select One</option>';
while ($result = @mysql_fetch_array($result1)) {
$fields_all .= '<option value="'.$result['channel_id'].'">'.$result['channel_name'].'</option>';
}
$sub_cat_choice = (int) mysql_real_escape_string( $_GET['sub_cat'] ); // this is the parent channel number
if ( $sub_cat_choice ) {
if ( $sub_cat_choice == '99999' ) {
$sub_fields_all .= '<select class="image_form" style="width:160px;" size="1" name="sub_cat">';
$sub_fields_all .= '<option value="99999">'.$lang_no_sub_categories.'</option>';
$sub_fields_all .= '</select> ('.$lang_select.')';
echo $sub_fields_all;
die();
} else {
$sql2 = "SELECT * from sub_channels WHERE parent_channel_id = $sub_cat_choice";
$query = @mysql_query($sql2);
$sub_fields_all .= '<select class="image_form" style="width:160px;" size="1" name="sub_cat">';
while ($result2 = @mysql_fetch_array($query)) {
$count_subs = @mysql_num_rows($query);
$sub_fields_all .= '<option value="'.$result2['sub_channel_id'].'">'.$result2['sub_channel_name'].'</option>';
}
if ( $count_subs == "" ) {
$sub_fields_all .= '<option value="99999">'.$lang_no_sub_categories.'</option>';
}
$sub_fields_all .= '</select> ('.$lang_select.')';
echo $sub_fields_all;
die();
}
}
// grab values from form if any
$form_submitted = $_POST['form_submitted'];
$title = $_POST['title'];
$description = $_POST['description'];
if (strlen($description) > 30)
{
print "Please limit your character length";
}
else
{
// execute script here if everythings a ok
}
$tags = $_POST['tags'];
$location_recorded = $_POST['location_recorded'];
$allow_comments = $_POST['allow_comments'];
$allow_embedding = $_POST['allow_embedding'];
$public_private = $_POST['public_private'];
$channel = $_POST['channel'];
$sub_cat = $_POST['sub_cat'];
$procede = true;
$row = mysql_query("SELECT channel_name FROM channels WHERE channel_id = '$channel'");
while( $result = mysql_fetch_assoc($row) ) {
$channel_name = $result['channel_name'];
}
// validate form
if ($form_submitted == "yes") {
foreach ($_POST as $key => $value) {
if ($key == "title" || $key == "description" || $key == "tags") {
if (!isset($value) || ($value == "")) {
$display_key = @str_replace('_', " ", $key);
$error_message = $config['notification_error'];
$blk_notification = 1;
$error_message = $error_message . " - " . $display_key . " - $lang_required ";
$procede = false;
}
}
}
if ( $channel == '99999' ) {
$error_message = $config['notification_error'];
$blk_notification = 1;
$error_message = $error_message . " - $lang_select_channel";
$procede = false;
}
}
// display page with form error
if ($procede == false && $form_submitted == "yes") {
$template = "themes/$user_theme/templates/main_1.htm";
$inner_template1 = "themes/$user_theme/templates/inner_upload_video_form1.htm"; // middle of page
$TBS = new clsTinyButStrong;
$TBS->NoErr = true; // no more error message displayed.
$TBS->LoadTemplate("$template");
$TBS->Render = TBS_OUTPUT;
$TBS->Show();
@mysql_close();
die();
}
// disply clean page
if (!isset($form_submitted) || ($form_submitted == "")) {
$template = "themes/$user_theme/templates/main_1.htm";
$inner_template1 = "themes/$user_theme/templates/inner_upload_video1_form.htm"; // middle of page
$TBS = new clsTinyButStrong;
$TBS->NoErr = true; // no more error message displayed.
$TBS->LoadTemplate("$template");
$TBS->Render = TBS_OUTPUT;
$TBS->Show();
@mysql_close();
die();
}
if ($procede == true && $form_submitted == "yes") {
//=================================START OF UPLOAD=================================
$THIS_VERSION = "2.0";
if (isset($_GET['cmd']) && $_GET['cmd'] == 'about') {
kak("<u><b>UBER UPLOADER FILE UPLOAD</b></u><br>UBER UPLOADER VERSION = <b>" .
$UBER_VERSION . "</b><br>UU_FILE_UPLOAD = <b>" . $THIS_VERSION . "<b><br>\n");
}
$tmp_sid = md5(uniqid(mt_rand(), true));
///////////////////////////////////////////////////////////////////////
// This is where you might set your config file eg. //
// if($_SESSION['user'] == "tom"){ $config_file = 'uu_tom_config'; } //
///////////////////////////////////////////////////////////////////////
$config_file = $default_config_file;
$path_to_upload_script .= '?tmp_sid=' . $tmp_sid;
$path_to_ini_status_script .= '?tmp_sid=' . $tmp_sid;
if ($MULTI_CONFIGS_ENABLED) {
$path_to_upload_script .= "&config_file=$config_file";
$path_to_ini_status_script .= "&config_file=$config_file";
}
//allow form to be refilled on error
foreach($_POST as $key=>$value) {
$$key = $value;
}
$template = "themes/$user_theme/templates/main_1.htm";
$inner_template1 = "themes/$user_theme/templates/inner_upload_video1.htm";//middle of page
$TBS = new clsTinyButStrong;
$TBS->NoErr = true;// no more error message displayed.
$TBS->LoadTemplate("$template");
$TBS->Render = TBS_OUTPUT;
$TBS->Show();
@mysql_close();
die();
//===============================================================END OF UPLOADER================================================================
|