← PHP

Formulário de PHP não funciona!

Lida 8789 vezes

Offline

PolasK 
Membro
Mensagens 673 Gostos 0
Troféus totais: 28
Trófeus: (Ver todos)
Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Level 5 Level 4 Level 3 Level 2 Level 1

Bem pessoal é assim mudei de hosting e no alojamento antigo dava todos os formularios de pedidos e tudo, agora neste novo hosting nao funciona em alguns não valida os campos, outros funciona mas envia email em branco e outro funciona para um email e para o meu não funciona

AJUDA
Offline

goodsound 
Membro
Mensagens 2485 Gostos 0
Troféus totais: 31
Trófeus: (Ver todos)
Super Combination Combination Topic Starter 50 Poll Votes 10 Poll Votes Poll Voter Poll Starter Level 5 Level 4 Level 3

isso poderá ser da fomra como programaste o form que usas...de qualquer forma não deixa de ser estrenho
;)
Offline

mix_93 
Membro
Mensagens 1630 Gostos 0
Troféus totais: 29
Trófeus: (Ver todos)
Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Level 5 Level 4 Level 3 Level 2 Level 1

Utilizas backoffice para algum deles?
Offline

PolasK 
Membro
Mensagens 673 Gostos 0
Troféus totais: 28
Trófeus: (Ver todos)
Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Level 5 Level 4 Level 3 Level 2 Level 1

Utilizas backoffice para algum deles?
Não apenas a form e a forma de enviar para o email mas nao resulta
Offline

goodsound 
Membro
Mensagens 2485 Gostos 0
Troféus totais: 31
Trófeus: (Ver todos)
Super Combination Combination Topic Starter 50 Poll Votes 10 Poll Votes Poll Voter Poll Starter Level 5 Level 4 Level 3

Utilizas backoffice para algum deles?
Não apenas a form e a forma de enviar para o email mas nao resulta
tudo em php...talvez será do código...âs vezes algum erro modifica tudo
Offline

mix_93 
Membro
Mensagens 1630 Gostos 0
Troféus totais: 29
Trófeus: (Ver todos)
Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Level 5 Level 4 Level 3 Level 2 Level 1

Utilizas backoffice para algum deles?
Não apenas a form e a forma de enviar para o email mas nao resulta
tudo em php...talvez será do código...âs vezes algum erro modifica tudo
Posta aqui, já agora qual é a versão do php que o servidor tem instalado?
Offline

PolasK 
Membro
Mensagens 673 Gostos 0
Troféus totais: 28
Trófeus: (Ver todos)
Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Level 5 Level 4 Level 3 Level 2 Level 1

Por exemplo um dos formularios foi este que faz de guestbook e armazena as mensagens em TXT

Form:

Código: [Seleccione]
<html>
<head>
<title>Livro de Visitas</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body bgcolor="#FFFFFF" text="#000000" link="#000099" vlink="#000066" alink="#000099" leftmargin="10" topmargin="20" marginwidth="0" marginheight="0">

<form name="guest" method="post" action="post_message.php">
  &nbsp;<font face="tahoma" style="font-size: 9px">Nome:</font><br>
  <input style="font-family: tahoma; font-size: 9px" type="text" name="name" size="40">
  <br>
    &nbsp;<font face="tahoma" style="font-size: 9px">Localidade:</font><br>
  <input style="font-family: tahoma; font-size: 9px" type="text" name="home" size="40">
  <br>
    &nbsp;<font face="tahoma" style="font-size: 9px">URL da p&aacute;gina:</font><br>
  <input style="font-family: tahoma; font-size: 9px"  type="text" name="url" size="40" value="http://">
  <br>
    <font face="tahoma" style="font-size: 9px">&nbsp;E-mail:</font><br>
  <input style="font-family: tahoma; font-size: 9px" type="text" name="email" size="40" value="@">
  <br><font face="tahoma" style="font-size: 9px">&nbsp;Mensagem:</font><br>
  <textarea style="font-family: tahoma; font-size: 9px" name="message" cols="45" rows="7"></textarea>
  <br>
  <br>
  <input type="submit" name="submit" value="Enviar" style="width: 65px; font-family: tahoma; font-size: 9px">
  <input type="reset" name="reset" value="Limpar Campos" style="width: 69; font-family: tahoma; font-size: 9px; height:21">
  <br>
</form>

<br><br>

<? include "guest.txt"; ?>

</body>
</html>

Envia:

Código: [Seleccione]
<?

{

$fr = fopen("guest.txt", "a+");
$texto = "Por: <a href=\"mailto:$email\">$name</a><br>Localidade: <a href=\"$url\" target=\"_blank\">$home</a><br>Mensagem: $message<br><br>";

}

     fputs($fr, $texto); //envia a noticia
     fclose($fr); // fecha o arquivo


?>


<html><head><title>Sucesso</title></head>
<body bgcolor="#FFFFFF" text="#000000" link="#000099" vlink="#000066" alink="#000099" leftmargin="10" topmargin="20" marginwidth="0" marginheight="0"><div align="center"> <h2>SUCESSO!!!</h2><br><br>
Mensagem Postada com Sucesso<br><br> <a href="main.php"><u>Voltar</u></a></div></body></html><noframes>

No entanto postas uma mensagem no guestbook e ele envia mas fica em branco nao le os campos que tu escreves confima aqui neste site www.djolivs.net que esta alojado tambem no memo hosting da ScallFM

Versao de PHP: 5.2.5
Offline

goodsound 
Membro
Mensagens 2485 Gostos 0
Troféus totais: 31
Trófeus: (Ver todos)
Super Combination Combination Topic Starter 50 Poll Votes 10 Poll Votes Poll Voter Poll Starter Level 5 Level 4 Level 3

não é <include "guest.txt">;
mas sim
código:
<?php
include "guest.txt";
?>
modifica isso e vê se dá
;)
Offline

PolasK 
Membro
Mensagens 673 Gostos 0
Troféus totais: 28
Trófeus: (Ver todos)
Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Level 5 Level 4 Level 3 Level 2 Level 1

não é <include "guest.txt">;
mas sim
código:
<?php
include "guest.txt";
?>
modifica isso e vê se dá
;)

testado e nao deu...
Offline

goodsound 
Membro
Mensagens 2485 Gostos 0
Troféus totais: 31
Trófeus: (Ver todos)
Super Combination Combination Topic Starter 50 Poll Votes 10 Poll Votes Poll Voter Poll Starter Level 5 Level 4 Level 3

não é <include "guest.txt">;
mas sim
código:
<?php
include "guest.txt";
?>
modifica isso e vê se dá
;)

testado e nao deu...
ok...conselho, faz de novo o guestbook bem como os outros formulários e testa
ps: guestbook é preferível em mysql
ps2:2 minutes and e help you
;)
Offline

anjo2 
Membro
Mensagens 3020 Gostos 0
Troféus totais: 31
Trófeus: (Ver todos)
Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Poll Starter Level 5 Level 4 Level 3 Level 2

não te falta aí código? é que se fazes um post, tens de receber com $nome = $_POST['nome'];
Offline

PTByter 
Membro
Mensagens 218 Gostos 0
Troféus totais: 25
Trófeus: (Ver todos)
Super Combination Combination Topic Starter Poll Voter Level 5 Level 4 Level 3 Level 2 Level 1 100 Posts

Ja agora, em TXT? Não sera mais facil usares MySql?
Offline

PolasK 
Membro
Mensagens 673 Gostos 0
Troféus totais: 28
Trófeus: (Ver todos)
Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Level 5 Level 4 Level 3 Level 2 Level 1

não te falta aí código? é que se fazes um post, tens de receber com $nome = $_POST['nome'];

Vou corrigir nao reparei...

Ja agora, em TXT? Não sera mais facil usares MySql?

Fiz em txt para não ter muito trabalho mas o que mete mais especie e que sempre funcionou e agora todos os formularios deixaram de funcionar e estranho
Offline

goodsound 
Membro
Mensagens 2485 Gostos 0
Troféus totais: 31
Trófeus: (Ver todos)
Super Combination Combination Topic Starter 50 Poll Votes 10 Poll Votes Poll Voter Poll Starter Level 5 Level 4 Level 3

estoua a fazer um guestbook em mysql vamos ver no que dá
;)
Offline

nram 
Membro
Mensagens 777 Gostos 0
Feedback +1

Troféus totais: 28
Trófeus: (Ver todos)
Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Level 5 Level 4 Level 3 Level 2 Level 1

1º Não recebe dados enviados pela form,
2º Verifica as permissões do ficheiro *.TXT .