ah si...ho capito...
grazie ragazzi...
EDIT: io sto facendo un form...
questo è il form della pagina htm:
Codice HTML:
<FORM ACTION="contact.php" METHOD="POST">
<p align="center"><font face="Bookman Old Style" size="2">Name (of the band leader/referring person):</font></p>
<p align="center">
<!--webbot bot="Validation" b-value-required="TRUE" i-maximum-length="30" --><INPUT TYPE="text" NAME="name" SIZE="20" MAXLENGTH="30"></p>
<p align="center"><font face="Bookman Old Style" size="2">Surname (of the band leader/referring person):</font></p>
<p align="center">
<!--webbot bot="Validation" b-value-required="TRUE" i-maximum-length="30" --><INPUT TYPE="text" NAME="surname" SIZE="20" MAXLENGTH="30"></p>
<p align="center"><font face="Bookman Old Style" size="2">Name of the artist/band:</font></p>
<p align="center">
<!--webbot bot="Validation" b-value-required="TRUE" i-maximum-length="30" --><INPUT NAME="bandname" ROWS="10" COLS="60" MAXLENGTH="30" size="20"></p>
<p align="center"><font face="Bookman Old Style" size="2">Email of the artist/band:</font></p>
<p align="center">
<!--webbot bot="Validation" b-value-required="TRUE" i-maximum-length="50" --><INPUT NAME="email" ROWS="10" COLS="60" MAXLENGTH="50" size="20"></p>
<p align="center"><font face="Bookman Old Style" size="2">Show/Hide the e-mail of the band:
</font>
</p>
<p align="center"><select size="1" name="showhide"><option selected>Show</option><option>Hide</option></select></p>
<p align="center"><font face="Bookman Old Style" size="2">Country</font></p>
<p align="center">
<INPUT NAME="country" ROWS="10" COLS="60" MAXLENGTH="50" size="20"></p>
<p align="center"><font face="Bookman Old Style" size="2">City:</font></p>
<p align="center">
<!--webbot bot="Validation" b-value-required="TRUE" i-maximum-length="50" --><INPUT NAME="city" ROWS="10" COLS="60" MAXLENGTH="50" size="20"></p>
<p align="center"><font face="Bookman Old Style" size="2">Official website/web space (if available):</font></p>
<p align="center">
<!--webbot bot="Validation" b-value-required="TRUE" i-maximum-length="50" --><INPUT NAME="website" ROWS="10" COLS="60" MAXLENGTH="50" size="20"></p>
<p align="center"><font face="Bookman Old Style" size="2">Any other information:
</font></p><p align="center">
<!--webbot bot="Validation" b-value-required="TRUE" --><textarea rows="7" name="other" cols="29"></textarea>
</p><p align="center"><font face="Bookman Old Style" size="2">Little biography (english language only):</font></p><p align="center">
<!--webbot bot="Validation" b-value-required="TRUE" --><textarea rows="7" name="biography" cols="29"></textarea></p>
<p align="center"> </p>
<p align="center">
<INPUT TYPE="submit" VALUE="Submit">
<INPUT TYPE="reset" VALUE="Reset">
</p>
</FORM>
il tasto submit dovrebbe essere collegato alla pagina contact.php:
Codice PHP:
<?php
// get posted data into local variables
$EmailFrom = "music@europeanhiphop.com";
$EmailTo = "music@europeanhiphop.com";
$Subject = "New Artist";
$name = Trim(stripslashes($_POST['name']));
$surname = Trim(stripslashes($_POST['surname']));
$bandname = Trim(stripslashes($_POST['bandname']));
$email = Trim(stripslashes($_POST['email']));
$showhide = Trim(stripslashes($_POST['showhide']));
$country = Trim(stripslashes($_POST['country']));
$city = Trim(stripslashes($_POST['city']));
$website = Trim(stripslashes($_POST['website']));
$other = Trim(stripslashes($_POST['other']));
$biography = Trim(stripslashes($_POST['biography']));
// validation
$validationOK=true;
if (!$validationOK) {
print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">";
exit;
}
// prepare email body text
$Body = "";
$Body .= "name: ";
$Body .= $name;
$Body .= "\n";
$Body .= "surname: ";
$Body .= $surname;
$Body .= "\n";
$Body .= "bandname: ";
$Body .= $bandname;
$Body .= "\n";
$Body .= "email: ";
$Body .= $email;
$Body .= "\n";
$Body .= "showhide: ";
$Body .= $showhide;
$Body .= "\n";
$Body .= "country: ";
$Body .= $country;
$Body .= "\n";
$Body .= "city: ";
$Body .= $city;
$Body .= "\n";
$Body .= "website: ";
$Body .= $website;
$Body .= "\n";
$Body .= "other: ";
$Body .= $other;
$Body .= "\n";
$Body .= "biography: ";
$Body .= $biography;
$Body .= "\n";
// send email
$success = mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>");
// redirect to success page
if ($success){
print "<meta http-equiv=\"refresh\" content=\"0;URL=ok.htm\">";
}
else{
print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">";
}
?>
come mai non va e si collega sempre ad error?
ra124.altervista.org/join_us.htm
ra124.altervista.org/contact.php
FunCool: Non fare UP, usa il tasto Edita. Quando scrivi del codice sul forum usa i tag appositi.