...

View Full Version : Display uploaded files (change link)



the magus
09-01-2009, 06:40 PM
Hello everybody

I am using a very simple PHP upload script..

and I have 2 domains... domain1.com & domain2.com

domain1.com is the main domain which is linked to the root. While domain2.com is linked to a folder ("up" for example) inside public_html

I am using my php upload script on domain2.com.

After uploading files script displays the link of the uploaded files as this:

h ttp:// www .domain1. com /up/ uploaded/ image.jpg

WHAT I WANT is to make the script display domain2.com not the main domain which is linked to the root.

i.e i want to make the link as this (h ttp:// www .domain2 .com/ uploaded/image.jpg

and here is the code:



include_once("header.php");
// load main switch if constant pass is defined
if(defined("DODOUPLOADOK")) {
switch($action) {
case "uploadmulti_upload":
case "upload":
$uploaded_files = handle_uploaded_files("userfile");
if(empty($uploaded_files)) {
print_error("عملية خاطئة", "لم تقم تقم برفع أي ملف أو ملفات");
} else {
$error = uploadfiles_error_checking($uploaded_files, $userpath, $MAX_FILE_SIZE, $dim_requirement, $require_exact_dim, $filename_limit, $require_file_type);
if($error !== true)
print_error("Error", $error);
else {
$output = upload_files($uploaded_files, $userpath);
print_error("تم تحميل الملف بنجاح", "رابط الملف الذي تم تحميلة.<br /><br />".$output, "العودة للملفات ", $_SERVER['PHP_SELF']);
display_upload_form();
}



and I think the problem is here:



$output = upload_files($uploaded_files, $userpath);
print_error("تم تحميل الملف بنجاح", "رابط الملف الذي تم تحميلة.<br /><br />".$output, "العودة للملفات ", $_SERVER['PHP_SELF']);
display_upload_form();
}



I hope I could cleared my point.


Thanks in advance



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum