Code ausspucken nach upload (DLCenter)

Status
Nicht offen für weitere Antworten.

TZ-Style

Gesperrt
Hallo leute habe ein Problem

Ich möchte ein Downloadcenter/uploadcenter wie Yousendit oder so machen

so weit bin ich nun

Download Center

aber wie kann ich nun es machen das nach dem upload die url von dem hochgeladenen file kommt

Bitte helft mir sehr wichtig !
 
Du weisst sicher wie man eine Ausgabe mit PHP macht, oder?
Dann nimmst Du die URL Deiner Website und haengst das Verzeichnis und den Dateinamen dran und gibst das ganze aus.
 
Weil mir ein kollege das gecoedet hat und ich nur design gemacht habe!
Aber nun ist er 2 wochen italien klassenfahrt und ich brauche das dl center schon früher.
Und ich kenne mich bisschen mit html aus aber php no plan
 
Ausgaben mit PHP kannst Du z.B. mit print, printf, oder echo machen.
Beispiel:
PHP:
printf("Hallo<br>");
print("Hallo<br>");
echo "Hallo<br>";
 
Aber wo soll ich das hier einfügen Und wie ?

PHP:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  <html>
  <head>
  <title>Sec Download Center</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  <link href="stylesheet.css" rel="stylesheet" type="text/css">
  <style type="text/css">
  <!--
  body {
  	background-color: #EEEEEE;
  }
  a:link {
  	text-decoration: none;
  	color: #4162A3;
  }
  a:visited {
  	text-decoration: none;
  	color: #4162A3;
  }
  a:hover {
  	text-decoration: underline;
  	color: #4162A3;
  }
  a:active {
  	text-decoration: none;
  	color: #4162A3;
  }
  .Stil1 {color: #DBE2E7}
  .Stil2 {color: #4162A3}
  -->
  </style></head>
  
  <body>
  <table width="100%" cellspacing="2" cellpadding="2" height="100%">
    <tr>
  	<td>
  	  <div align="center">
  		<p>&nbsp;</p>
  		<p>&nbsp;		</p>
 		<table width="550" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#336699">
  		  <tr> 
 		 <td background="top.gif" height="60"><img src="head.gif" width="256" height="45"></td>
  		  </tr>
  		  <tr> 
 		 <td background="bg.gif"><table width="100%" cellpadding="5" cellspacing="5">
  				<tr> 
 				 <td background="bg.gif">
 				 <form name="formen" action="uploader.php" method="post" enctype="multipart/form-data">
 					 <div align="center">					 
 					 <p><br>
 						 <span class="Stil1"><a href="http://hpbimg.darth-alex.com/SeC/857/uploaded_pics/" target="_top">:: Tracks</a> <a href="http://hpbimg.darth-alex.com/SeC/857/uploaded_files/" target="_top">:: Albums </a><a href="http://hpbimg.darth-alex.com/SeC/857/uploaded_docs/" target="_top">:: Sonstiges </a></span><span class="Stil2">::</span><br>
 					 </p>
 					 <p> Um euern Download link zu erhalten m&uuml;sst ihr auf das Angebene Verzeichnis klicken </p>
 					 </div>
 					 <table width="100%" cellspacing="2" cellpadding="2">
 					 <tr> 
 						 <td width="180" background="bg.gif">Datei: </td>
 						 <td background="bg.gif"> 
 						 <input type="file" name="bilde_fil">
  </td>
 					 </tr>
 					 <tr> 
 						 <td width="180" background="bg.gif">Verzeichnis:</td>
 						 <td background="bg.gif"> 
 						 <select name="folder">
 							 <option>Ordner W&auml;hlen</option>
 							 <option value="uploaded_pics/" selected>Tracks</option>
 							 <option value="uploaded_files/">Albums </option>
 							 <option value="uploaded_docs/">Sonstiges</option>
 						 </select>
 						 </td>
 					 </tr>
 					 <tr> 
 						 <td width="180" background="bg.gif">Name von dem File:</td>
 						 <td background="bg.gif"> 
 						 <input type="text" name="nyttnavn">
 						 </td>
 					 </tr>
 					 <tr> 
 						 <td width="180" background="bg.gif">Dateiendung:</td>
 						 <td background="bg.gif"> 
 						 <select name="ending">
 							 <option>.mp3</option>
 							 <option>.jpg</option>
 							 <option>.gif</option>
 							 <option>.exe</option>
 							 <option>.zip</option>
 							 <option>.rar</option>
 							 <option>.zip</option>
 							 <option>.mpg</option>
 						 </select>
 						 </td>
 					 </tr>
 					 </table>
 					 <br>
 					 <input name="submit" type="submit" class="bodycell" value="Hochladen">
 					 <input type="hidden" name="MAX_FILE_SIZE" value="10000000000">
 					 <?php if ($folder == "Choose folder")
  		{
  		
 		echo "<b>Error: </b> You must Choose a folder to upload your file.";
  		}?>
 					 <?php
  #Config
  $path=$folder; //The file-path(remember the last '/')
  
  #Do not edit  below :)
  if ($bilde_fil && $nyttnavn){
     $ok = 1;
  
     if (is_file($path.$nyttnavn.$ending)){
  	  print "<b>Error</b>, the name allready exists. Choose another name.<br>";
  	  $ok = 0;
     }
     if (preg_match("/^[\/\\\.]/", $nyttnavn)){
  	  print "<b>Error</b>, Filname can't start with: '.', '/' or '\'";
  	  $ok = 0;
     }
 if (!($ending == ".jpg" || $ending == ".gif" || $ending == ".zip" || $ending == ".exe" || $ending == ".rar" || $ending == ".mpg" || $ending == ".zip" || $ending == ".mp3")){
  	  print "<b>Error</b>, do not mix with the filename ($ending) Thanks!";
  	  $ok = 0;
     }
     print "";
  }
  
  if ($ok){
     $res = copy($bilde_fil, $path."/".$nyttnavn.$ending);
 print ($res)?"<b>Finish</b>, uploadet ".$nyttnavn.$ending."":"<b>Error</b>, could not upload the file.<br>";
     print "";
  }
  ?>
 					 <font color="#FFFFFF">959390752072342378218374</font><br>
 					</form>
  		 
  		 </td>
  				</tr>
  			  </table> </td>
  		  </tr>
  		  <tr> 
  			<td height="37"> 
 			 <table width="100%" cellspacing="0" cellpadding="0">
  				<tr> 
 				 <td height="37" background="bottom.gif"> 
 				 <div align="center">All Rights Reserved. <a href="http://www.TZ-Style.cx.la"> 
 					 Tommy-Z´s</a> Sec Download Center V.2.0<br>
 					 Copyright TZ-Designs &copy;2005</div>
  				  </td>
  				</tr>
  			  </table>
  			</td>
  		  </tr>
  		</table>
  		<p class="headcell">&nbsp;</p>
  	  </div>
  	</td>
    </tr>
  </table>
  </body>
  </html>
 
So spontan sehe ich da was von wegen if ($ok) und darin ist sogar ein leeres print
Dort kannst Du dann den <a href>-String eintragen.
 
du siehst da überhaupt etwas oh man ..ich seh da nur komische zeichen *g*

Kannst du mir bitte genau (am besten mit nem schild wie in las vegas) zeigen wo und wie?

Aber was nütz denn so eine hyperlink? Ich will ja das nach jedem upload

die url von dem hochgeladenen file erscheint und nicht von allen!
 
Warum ist das ueberhaupt so dringend?
Das steht im Code:
PHP:
  if ($ok){
     $res = copy($bilde_fil, $path."/".$nyttnavn.$ending);
print ($res)?"<b>Finish</b>, uploadet ".$nyttnavn.$ending."":"<b>Error</b>, could not upload the file.<br>";
     print "";
  }

Und das kannste mal probieren, also fuer das oben angegeben einfuegen.
PHP:
  if ($ok){
     $res = copy($bilde_fil, $path."/".$nyttnavn.$ending);
print ($res)?"<b>Finish</b>, uploadet ".$nyttnavn.$ending."":"<b>Error</b>, could not upload the file.<br>";
     print("<a href='http://www.wasweissich.de/".$path."/".$nyttnavn.$ending."'>http://www.wasweissich.de/".$path."/".$nyttnavn.$ending."</a>");
  }

Kleiner Tipp, lern mal PHP. ;)
http://www.wasweissich.de musst Du natuerlich noch durch Deinen URL ersetzen.
 
Status
Nicht offen für weitere Antworten.
Zurück