Torna indietro   Serverplan Forum > Risorse per Webmaster > PHP

Rispondi
 
LinkBack Strumenti discussione Modalità visualizzazione
  #1 (permalink)  
Vecchio 01-08-2006, 01.04.02
Junior Member
 
Data registrazione: 07-07-2006
Residenza: wisconsin
Messaggi: 8
glosstar is on a distinguished road
Predefinito AIUTO PER UN EMAIL FORM

Premetto che sono a digiuno di PHP quindi sto utilizzando un vecchio form per richiesta informazioni che un amico mi ha preparato. Il form dovrebbe inviare una email utilizzando submit.php e visualizzare al contempo la pagina thanks.htm.

L'email arriva regolarmente, ma una volta cliccato il tasto "submit" non appare la pagina "thanks.htm" ma il seguente errore:
Citazione:
"Warning: include(http://www.bbrepairs.com/thanks.html) [function.include]: failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found in /home/bbrepair/public_html/submit.php on line 30

Warning: include() [function.include]: Failed opening 'http://www.bbrepairs.com/thanks.html' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/bbrepair/public_html/submit.php on line 30"
Il form e' il seguente:

Citazione:
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="51%">
<form method "post" action="submit.php" name="InfoReq" onsubmit="MM_validateForm('fname','','R');MM_valid ateForm('fname','','R','lname','','R');MM_validate Form('areaCode','','RisNum');MM_validateForm('phon eNumb1','','RisNum');MM_validateForm('phoneNumb2', '','RisNum');MM_validateForm('from','','RisEmail') ;return document.MM_returnValue">
<input type="hidden" name="recipient" value="info@bbrepairs.com" />
<input type="hidden" name="redirect" value="http://www.bbrepairs.com/thanks.html" />
<input type="hidden" name="subject" value="Information Request" />
<input type="hidden" name="print_config" value="subject,from" />
<input type="hidden" name="env_report" value="REMOTE_HOST,HTTP_USER_AGENT,REMOTE_USER,REM OTE_ADDR" />
<input type="hidden" name="bgcolor" value="#ffffff" />
<input type="hidden" name="required" value="fname,lname,from,areaCode,phoneNumb1,phoneN umb2" />
<input type="hidden" name="sort" value="order:fname,lname,from,addr,city,state,zip, areaCode,phoneNumb1,phoneNumb2,request" />
<table border="0" cellspacing="0" cellpadding="3" width="100%">
<tr>
<td>First Name*</td>
</tr>
<tr>
<td><input name="fname" type="text" class="formClass" size="28" maxlength="28" /></td>
</tr>
<tr>
<td>Last Name*</td>
</tr>
<tr>
<td><input name="lname" type="text" class="formClass" size="28" maxlength="28" /></td>
</tr>
<tr>
<td>Address</td>
</tr>
<tr>
<td><input name="addr" type="text" class="formClass" size="28" maxlength="28" /></td>
</tr>
<tr class="bgFrm">
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="48%">City

<input name="city" type="text" class="formClass" size="16" maxlength="16" /></td>
<td width="7%">State

<input name="state" type="text" class="formClass" size="2" maxlength="2" /></td>
<td width="45%">ZIP

<input name="zip" type="text" class="formClass" size="5" maxlength="5" /></td>
</tr>
</table>
<tr>
<td>Phone*
</td>
</tr>
<tr>
<td><input name="areaCode" type="text" class="formClass" id="areaCode" size="3" maxlength="3" />
<input name="phoneNumb1" type="text" class="formClass" id="phoneNumb1" size="3" maxlength="3" />
<input name="phoneNumb2" type="text" class="formClass" id="phoneNumb2" size="4" maxlength="4" /></td>
</tr>
<tr>
<td>e-mail*</td>
</tr>
<tr>
<td><input name="from" type="text" class="formClass" size="28" maxlength="28" /></td>
</tr>
<tr>
<td>Request</td>
</tr>
<tr>
<td><textarea name="request" cols="25" rows="4" wrap="VIRTUAL" class="formClass"></textarea> </td>
</tr>
<tr>
<td><input name="submit" type="submit" value="Submit" />
<input name="reset" type="reset" value="Reset" /></td>
</tr>
<tr>
<td></td>
</tr>
</table>
</form>
</table>

Il form e' gestito da un file submit.php il cui contenuto e' il seguente:

<?php
ini_set("display_errors", "On");

$postSize = sizeof($_POST);
$postInfo = $_POST;
$subject = $_POST['subject'];
$redirect = $_POST['redirect'];

$recipients = "info@bbrepairs.com";
$from = "From: " . $_POST['from'];
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/plain; charset=iso-8859-1\r\n";
$headers .= $from;

$body = "";

for ($i = 0; $i < $postSize; $i++){
if ((key($postInfo) != "submit") && (key($postInfo) != "redirect") && (key($postInfo) != "recipients")) {
$body .= key($postInfo) . ": " . $_POST[key($postInfo)] . "\r\r";
}
next($postInfo);
}

$body = stripslashes($body);
$body = str_replace("\r", "\r\n", $body);
$body .= "\r\n";

mail($recipients, $subject, $body, $headers);
echo "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>";
include($redirect);
?>
ESISTE QUALCUNO CHE POSSA AIUTARMI?

GRAZIE GIANNI LOSI[/quote]
Rispondi citando
  #2 (permalink)  
Vecchio 02-08-2006, 13.33.55
Junior Member
 
Data registrazione: 07-07-2006
Messaggi: 9
eymerich is on a distinguished road
Invia un messaggio via ICQ a eymerich Invia un messaggio via MSN a eymerich
Predefinito

Ad occhio sembra che il file thanks.html non esista in quel percorso che viene usato per chiamarlo.
Rispondi citando
  #3 (permalink)  
Vecchio 02-08-2006, 14.55.38
Junior Member
 
Data registrazione: 07-07-2006
Residenza: wisconsin
Messaggi: 8
glosstar is on a distinguished road
Predefinito

Citazione:
Originalmente inviato da eymerich
Ad occhio sembra che il file thanks.html non esista in quel percorso che viene usato per chiamarlo.
Il redirect alla pagina thanks.html viene richiesto nella 5a riga del form (<input type="hidden" name="redirect" value="http://www.bbrepairs.com/thanks.html" />).

Per quanto riguarda il file stesso (thanks.html), l'ho inserito nella stessa directory di submit.php (public_html).

Devo inserirlo altrove? Dove sto sbagliando?

Grazie comunque per la risposta.

Gianni
Rispondi citando
  #4 (permalink)  
Vecchio 02-08-2006, 19.02.09
Junior Member
 
Data registrazione: 07-07-2006
Messaggi: 9
eymerich is on a distinguished road
Invia un messaggio via ICQ a eymerich Invia un messaggio via MSN a eymerich
Predefinito

Se io provo a navigare con il mio browser qui: http://www.bbrepairs.com/thanks.html mi ritorna lo stesso errore che ritorna al PHP, che ? 404 not found, quindi credo proprio che la pagina non sia in quel posto, magari il nome ? sbagliato.. htm invece di html, sono sviste delle piu comuni.
Rispondi citando
  #5 (permalink)  
Vecchio 02-08-2006, 19.24.37
Junior Member
 
Data registrazione: 23-05-2006
Messaggi: 10
Esus is on a distinguished road
Predefinito

Citazione:
Originalmente inviato da eymerich
Se io provo a navigare con il mio browser qui: http://www.bbrepairs.com/thanks.html mi ritorna lo stesso errore che ritorna al PHP, che ? 404 not found, quindi credo proprio che la pagina non sia in quel posto, magari il nome ? sbagliato.. htm invece di html, sono sviste delle piu comuni.
mi sa che il file lo hai chiamato http://www.bbrepairs.com/thanks.htm e non html :-)
Rispondi citando
  #6 (permalink)  
Vecchio 03-08-2006, 05.28.51
Junior Member
 
Data registrazione: 07-07-2006
Residenza: wisconsin
Messaggi: 8
glosstar is on a distinguished road
Predefinito

mi sa che il file lo hai chiamato http://www.bbrepairs.com/thanks.htm e non html :-)[/quote]

Dopo aver ravanato il file, correggendo anche la svista da te segnalata, finalmente ora sembra funzionare tutto quanto. eymerich e' proprio il caso di dirtelo, Thanks!

gianni
Rispondi citando
Rispondi

Strumenti discussione
Modalità visualizzazione

Regole di scrittura
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is Attivato
Le faccine sono Attivato
Il codice [IMG] è Attivato
Il codice HTML è Disattivato
Trackbacks are Attivato
Pingbacks are Attivato
Refbacks are Attivato


Discussioni simili
Discussione Autore discussione Forum Risposte Ultimo messaggio
aiuto qpoint Pannello di controllo Cpanel - Linux 4 08-06-2007 15.03.12
Recupero db (aiuto!!...) octeld Pannello di controllo Cpanel - Linux 4 14-04-2006 12.16.36
aiuto php mysql d3vilkiss PHP 0 21-02-2006 11.06.57
Aiuto - RICEZIONE Email tony.stm Pannello di controllo Cpanel - Linux 4 22-12-2005 13.24.48
Aiuto database extreme.com ASP 4 29-08-2005 17.11.26


Tutti gli orari sono GMT +1. Adesso sono le 22.57.42.


Powered by vBulletin versione 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0
Traduzione italiana : www.vbulletin.it