Forum

Forum (https://www.coolstreaming.us/forum/)
-   Hardware & Software (https://www.coolstreaming.us/forum/a/)
-   -   Aiuto per form invia-mail in PHP (https://www.coolstreaming.us/forum/a/42392-a.html)

ABNormal 11-10-2007 05:09 PM

Aiuto per form invia-mail in PHP
 
qualcuno mi può scrivere un form da inserire in una pagina web (stile ContactUs) che preveda 3 campi:
txt1) testo input: 40 caratteri
txt2) testo input: 8 caratteri o meglio "__:__:__" (per inserire ora:min:sec)
txt3) testo in una selezione select

e che spedisca (senza aprire una lettera di posta, in Hidden) la mail:
alla mail MIA-MAIL
da: MAILER-AUTOMATICO
soggetto:NUOVO
messaggio: txt0 blah_blah txt1 bla_bla txt2 blà_blà txt3 bl_bl
ovvero i tre campi inseriti più uno esterno (txt0) richiamato come variabile esterna dal PHP... stile mail.php?ext0=xxx , in un rigo pre-formattato

o, in alternativa
txt0
txt1
txt2
txt3
ovvero i tre campi uno sotto l'altro (gradirei di meno cmq)

essendo in una fase di atropia mentale, chi volesse aiutarmi mi può scrivere tutto il form, visto che ho provato a lavorare su uno che ho scaricato, ma non riesco a fare nulla di buono, per favore?

grazie
ABN

Ogher 11-11-2007 03:34 PM

intanto fa il modulo in html come lo vorresti, postalo qui e ci aggiungo quel che serve

ABNormal 11-12-2007 12:22 PM

Il form è qualcosa del tipo:
HTML Code:
<FORM action="[I]...MAILTO?...[/I]" method="post"> <P> Title: <INPUT type="text" name="titolo"> Time (h.mm.ss): <INPUT type="text" name="durata"> Language: <SELECT name="lingua"> <OPTION selected value="ENG">English</OPTION> <OPTION selected value="ITA">Italian</OPTION> <OPTION selected value="GER">German</OPTION> <OPTION selected value="FRA">French</OPTION> <OPTION selected value="---">Others</OPTION> </SELECT> Genre: <SELECT name="genere"> <OPTION selected value="MOVIE">MOVIE</OPTION> <OPTION selected value="MUSIC">MUSIC - Video</OPTION> <OPTION selected value="DOC">DOCUMENTARY</OPTION> <OPTION selected value="XXX">****</OPTION> <OPTION selected value="---">Others</OPTION> </SELECT> <INPUT type="submit" value="Invia"> <INPUT type="reset"> </P> </FORM>

magari formattando in dimensioni h5 il tutto, e dando delle lunghezze alle finestre tipo 100 caratteri al Title e solo 10 al time...

(l'esempio è visibile QUI )

e dovrebbe prevedere l'invio di una mail:
to: Mio indirizzo
subject: Nuovo Link
Body:
HTML Code:
LINK (che è la variabile del Php e quindi non viene inserita dall'utente ma presa dal contesto) TITOLO DURATA LINGUAGGIO GENERE


o
HTML Code:
LINK * TITOLO * DURATA * LINGUAGGIO * GENERE


grazie sempre
ABN

Ogher 11-13-2007 04:35 PM

index.php
PHP Code:
<?php echo "<H5><FORM action=\"process.php?ext0=" .  $_REQUEST['ext0'] . "\" method=\"post\">"?>
    <P>
    Title: <INPUT type="text" name="titolo" size="40">
    Time (h.mm.ss): <INPUT type="text" name="durata" size="10">
    Language:    <SELECT  name="lingua">
      <OPTION selected value="ENG">English</OPTION>

      <OPTION selected value="ITA">Italian</OPTION>
      <OPTION selected value="GER">German</OPTION>
      <OPTION selected value="FRA">French</OPTION>
      <OPTION selected value="---">Others</OPTION>
   </SELECT>
    Genre:    <SELECT  name="genere">

      <OPTION selected value="MOVIE">MOVIE</OPTION>
      <OPTION selected value="MUSIC">MUSIC - Video</OPTION>
      <OPTION selected value="DOC">DOCUMENTARY</OPTION>
      <OPTION selected value="XXX">****</OPTION>
      <OPTION selected value="---">Others</OPTION>
   </SELECT>

    <INPUT type="submit" value="Invia"> <INPUT type="reset">
    </P>
 </FORM></H5>


process.php
PHP Code:
<?php
if(strlen($_REQUEST['ext0']) != && strlen($_REQUEST['titolo']) != 0  && strlen($_REQUEST['durata']) != 0)
{
  
$oggetto "Ext0: " $_REQUEST['ext0'] . "\nTitolo: " $_REQUEST['titolo'] . "\nDurata: " $_REQUEST['durata'] . "\nLingua: " $_REQUEST['lingua'] . "\nGenere: " $_REQUEST['genere'];
     
  if(
mail("mettila@tuamail.com""NUOVO"$oggetto"From: MAILER-AUTOMATICO"))
    echo 
"Invio ok";
  else
    echo 
"Invio fallito";
}
else
echo 
"Invio fallito, bisogna completare tutti i campi del form.";
?>


le mail che ti manda il server spesso vengon considerate spam, guarda lì se non funziona

ABNormal 11-13-2007 08:26 PM

grazie mille... ma:
1) mi da l'errore di mancato inserimento di qualche dato (sia su netsons che su aruba)
2) c'è anche la variabile "url" che il form dovrebbe prelevare dal link della pagina che sta girando .... tv.php?url=**** ? non mi sembra di vederlo

Ogher 11-13-2007 10:01 PM

Quote:
Originally Posted by ABNormal
grazie mille... ma:
1) mi da l'errore di mancato inserimento di qualche dato (sia su netsons che su aruba)
2) c'è anche la variabile "url" che il form dovrebbe prelevare dal link della pagina che sta girando .... tv.php?url=**** ? non mi sembra di vederlo

devi specificare il parametro ext0 (è l'url di cui parli nella seconda domanda?) in pratica devi andare su index.php?ext0=quelchetiserve e da lì compilare il form

ABNormal 11-14-2007 12:16 AM

ovviamente hai ragione. grazie mille
meno male che ci sei tu. io con il php facciamo passi praticamente grazie a te.

il progetto http://hiddenstage6**** può partire ora!
anzi parte ufficialmente e lo propongo in area stooge.

sempre debitore
ABN


All times are GMT +2. The time now is 02:20 PM.

Powered by: vBulletin Version 3.0.7
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.