in questa pag http://germylove.altervista.org/uplo...anuploader.php
ma mi dà un errore. Quale potrebbe essere il motivo?
grazie!
in questa pag http://germylove.altervista.org/uplo...anuploader.php
ma mi dà un errore. Quale potrebbe essere il motivo?
grazie!
il msg ti dice che nell file php c'è una chiamata ad una funzione indefinita.
prova a commentare la riga 24.
Non lo capisco bene, non conosco benissimo php. Cmq, io avevo già uno script come ho detto http://germylove.altervista.org/up/form.htm , ma non mi arrivano le immagini nella posta, nè le trovo nella directory. Non so quale sia il problema!Originalmente inviato da MedMax
sorry
il codice del file upload.php è questo:Originalmente inviato da MedMax
<?
/* Easy Uploader */
// set variables (SET THESE TO SUIT YOUR CIRCUMSTANCES):
// Upload directory (MUST HAVE TRAILING SLASH):
$uploaddir="/germylove.altervista.org/up/";
// Your email
$youremail="gerry13@libero.it";
// Thank you page:
$thankspage="http://germylove.altervista.org/up/thanks.htm";
// Set Upload thanks message for USER
$uptymessage="$Grazie per aver spedito la foto! Arrivederci!! $file_name\n\nWe will get back to you ASAP.";
// Set Upload thanks message for OWNER
$ownermessage="$realname [ $email ] has uploaded a file named $file_name\n\nCheck the upload directory.";
// Email message on or off ? 1 = on, 0 = off
$emailmessages = "1";
// start code (DO NOT CHANGE ANYTHING BELOW THIS LINE):
// Check for valid email address
$x = ereg("^[0-9a-z]([-_.]?[0-9a-z])*@[0-9a-z]([-.]?[0-9a-z])*\\.[a-z]{2,3}$",$email);
if($x==0)
// if no valid email address entered, display no email message
{
echo "<div align=center>You <b>must</b> specify a valid email address for yourself. <a href=javascript:history.back(-1)>Return to the form</a>.</div>";
}
else {
// Check to see if valid file
if ($file == "none") {
// if no valid email address entered, display no file message
echo "<div align=center>You <b>must</b> specify a file to upload. <a href=javascript:history.back(-1)>Return to the form</a>.</div>";
}
else {
//directory to upload to
copy($file, $uploaddir.$file_name);
unlink($file);
//return thank you page
Header("Location: $thankspage");
}
}
if ($emailmessages == "1") {
//mail you to let you know a new uploaded file
mail("$youremail", "Uploaded file", "$ownermessage");
//mail user to thank them
mail("$email", "Uploaded file", "$uptymessage");
exit;
}
?>
vedi un po', dov'è il problema?
thanks!
questo non sembra presentare quel problema: sei sicuro che è quello giusto?
L'errore parla di un maianuploader.php
Ah!scusa non avevo capito quello è il codice del form-upload che funziona, ma non mi arrivano le immagini. ne ho diversi ma con nessuno riesco ad ottenere ciò che desidero.Originalmente inviato da sugandbibi
Il codici di maianupload è questo:
[code:1:f955389534]<?php
include_once("inc/configure.php");
include_once("inc/headfoot.php");
displayHeader();
if ($_POST['uploader'])
{
if ($name == "") //check to see if the name field is empty, if it is display error page
{
echo "<br><p align=\"center\"><font color=\"#ff0000\"><b>ERROR!!< ;/b></font><br><br>Please include your name! Thank you!</p>";
echo "<p align=\"center\"><a href=\"javascript:history.go(-1)\" title=\"Return to Upload Form\">Return to Upload Form</a></p>";
displayFooter();
exit; //end of name field check
}
if ($subject == "") //check to see if the subject field is empty, if it is display error page
{
echo "<br><p align=\"center\"><font color=\"#ff0000\"><b>ERROR!!< ;/b></font><br><br>Please include a subject heading! Thank you!</p>";
echo "<p align=\"center\"><a href=\"javascript:history.go(-1)\" title=\"Return to Upload Form\">Return to Upload Form</a></p>";
displayFooter();
exit; //end of subject field check
}
if ($file == "") //check to see if the file field is empty, if it is display error page
{
echo "<br><p align=\"center\"><font color=\"#ff0000\"><b>ERROR!!< ;/b></font><br><br>An error occured with the file you have chose to submit.<br><br>There could be a couple of reasons for this.<br><br>1. You didn`t specify a file to upload<br>2. The file is larger than the specified size.</p>";
echo "<p align=\"center\">Please check your details and try again.<br><br>Thank You!</p>";
echo "<p align=\"center\"><a href=\"javascript:history.go(-1)\" title=\"Return to Upload Form\">Return to Upload Form</a></p>";
displayFooter();
exit; //end of file field check
}
if (eregi("^([a-z]|[0-9]|\.|-|_)+@([a-z]|[0-9]|\.|-|_)+\.([a-z]|[0-9]){2,3}$", $emailfield, $arr_vars) &&
!eregi("(@.*@)|(\.\.)| 0;@\.)|(\.@)|(^\.)", $emailfield, $arr_vars)) //e-mail address check
{
if ($file_size < $MAX_FILE_SIZE)
{
if(!is_file($site_path.$file_name)) ;
{
$result = copy ($file, $site_path.$file_name);
mail("$your_email", "$email_subject", "$email_message", "From: $site_name <$your_email>\r\nReply-To: $site_name <$your_email>");
unlink($file);
}
else
{
echo "<br><p align=\"center\">Sorry, the file you are trying to upload already exists in the database. <br>Please rename your file and try again</p>";
displayFooter();
exit;
}
if ($result)
{
if ($receivecopy)
{
mail("$emailfield", "$user_subject", "$auto_message", "From: $site_name <$your_email>\r\nReply-To: $site_name <$your_email>");
}
uploadConfirm();
exit;
}
}
}
else
{
uploadFail();
exit;
}
}
function uploadConfirm () { //if upload is successful display thank you page
global $name, $file_name, $url_path;
echo "<p align=\"center\"><b>Thank you $name!</b><br><br>Your file has sucessfully been received!<br>If you checked the box a confirmation e-mail has been sent.</p>";
echo "<p align=\"center\">Here is a link to your file:<br><a href=\"$url_path/$file_name\" target=\"_new\">$url_path/$file_name</a><br><br>Thank You!</p>";
displayFooter();
exit; //end of upload confirm function
}
function uploadFail () { //if upload is unsuccessful display error page
echo "<p align=\"center\"><font color=\"ff0000\"><b>ERROR!</b></font><br><br>An error has occured while uploading your file.<br>There could be one of two possible reasons for this.<br><br>1. Your e-mail address was not valid<br>2. The file you submitted is bigger than the specified size.</p>";
echo "<p align=\"center\">Please check your details and try again.<br><br>Thank You!</p>";
echo "<p align=\"center\"><a href=\"javascript:history.go(-1)\" title=\"Return to Upload Form\">Return to Upload Form</a></p>";
displayFooter();
exit; //end of uploadfail function
}
?>
<p align="center"><? echo $uploadtitle; ?></p>
<p align="center"><? echo $maxfilemessage; ?></p>
<form method="POST" enctype="multipart/form-data" action="<? PHP_SELF; ?>">
<div align="center"><center>
<table border="0" width="600">
<tr>
<td align="right">Name of the Cat: </td>
<td><input type="text" size="20" name="name"></td>
</tr>
<tr>
<td align="right">E-Mail Address: </td>
<td><input type="text" size="20" name="emailfield"></td>
</tr>
<tr>
<td align="right">File to Upload: </td>
<td><input type="hidden" name="MAX_FILE_SIZE" value="<? echo $max_file ?>">
<input type="file" size="20" name="file">
</td>
</tr>
</table>
</center></div>
<p align="center"><input class="checktype" type="checkbox" name="receivecopy"> Receive Copy?</p>
<p align="center"><input type="submit" name="uploader" value="Upload File!"></p>
</form>
<?
displayFooter();
?>[/code:1:f955389534]
scusami, no nsei riuscito a capire cosa non vada? Non riuscirò mai a fare 'sto benedetto uppload?LAscio perdere?Originalmente inviato da sugandbibi
bye! :?