Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

Marcelop37

Como faço para alterar envio de Formulário de asp para PHP

Recommended Posts

Segue abaixo o código atual que valida os campos do formulário, e tudo mais. Entretanto, não tem como funcionar no servidor Linux. Preciso de ajuda para alterar e não manjo PHP. Alguém pode me ajudar:

 

<html>

<head>

<meta http-equiv="index.htmlContent-Type" content="text/html; charset=iso-8859-1">

<title> </title>

<link rel="stylesheet" href="css/style01.css" type="text/css">

<link rel="stylesheet" href="css/internas.css" type="text/css">

<script src="js/script01.js"></script>

<script src="js/formata_campo.js"></script>

<script src="js/validacao.js"></script>

<script language="javascript">

function Validar()

{

if(document.form1.Razao_Empresa.value == '')

{

alert("Informe a Razão Social da Empresa");

document.form1.Razao_Empresa.focus();

return false;

}

if(document.form1.Nome.value == '')

{

alert("Informe o nome");

document.form1.Nome.focus();

return false;

}

/*if(document.form1.Nome_Socio.value =='')

{

alert("Informe o Nome do sócio");

document.form1.Nome_Socio.focus();

return false;

}

if(document.form1.DT_Nascimento.value =='')

{

alert("Informe a Data de Nascimento");

document.form1.DT_Nascimento.focus();

return false;

}

if(document.form1.DT_Nascimento.value.length < 10)

{

alert("Data de Nascimento incorreta");

document.form1.DT_Nascimento.focus();

return false;

}

if(document.form1.Nacionalidade.value =='')

{

alert("Informe a Nacionalidade do sócio");

document.form1.Nacionalidade.focus();

return false;

}

if(document.form1.CPF.value =='')

{

alert("Informe o CPF do sócio");

document.form1.CPF.focus();

return false;

}

if(document.form1.RG.value =='')

{

alert("Informe o RG do sócio");

document.form1.RG.focus();

return false;

}

if(document.form1.Orgao_Emissor.value =='')

{

alert("Informe o órgão emissor");

document.form1.Orgao_Emissor.focus();

return false;

}

if(document.form1.Titulo_Eleitor.value =='')

{

alert("Informe o Título de Eleitor do sócio");

document.form1.Titulo_Eleitor.focus();

return false;

}

if(document.form1.PIS.value =='')

{

alert("Informe o número do PIS");

document.form1.PIS.focus();

return false;

}

if(document.form1.Profissao.value =='')

{

alert("Informe a Profissão do sócio");

document.form1.Profissao.focus();

return false;

}

if(document.form1.Registro.value =='')

{

alert("Informe o número de Registro do sócio");

document.form1.Registro.focus();

return false;

}

if(document.form1.Endereco_Res.value == '')

{

alert("Informe o endereço do sócio");

document.form1.Endereco_Res.focus();

return false;

}

if(document.form1.Bairro_Res.value == '')

{

alert("Informe o bairro");

document.form1.Bairro_Res.focus();

return false;

}

if(document.form1.CEP_Res.value.length < 8)

{

alert("Informe o CEP");

document.form1.CEP_Res.focus();

return false;

}

if(document.form1.Cidade_Res.value == '')

{

alert("Informe a cidade");

document.form1.Cidade_Res.focus();

return false;

}

if(document.form1.Estado_Res.value == '')

{

alert("Selecione um estado");

document.form1.Estado_Res.focus();

return false;

}

if(document.form1.Tel_Res.value.length < 13)

{

alert("Informe o telefone residencial do sócio");

document.form1.Tel_Res.focus();

return false;

}

if(document.form1.Tel_Com.value.length < 13)

{

alert("Informe o telefone comercial do sócio");

document.form1.Tel_Com.focus();

return false;

}

if(document.form1.Email.value=='')

{

alert("Informe um endereço de email")

document.form1.Email.focus();

return false;

}

if( document.form1.Email.value != '' && document.form1.Email.value.indexOf(".")==-1 || document.form1.Email.value.indexOf("@")==-1)

{

alert("Endereço de email inválido");

document.form1.Email.focus();

return false;

}

if(document.form1.Perc_Capital.value =='')

{

alert("Informe o Percentual de Capital");

document.form1.Perc_Capital.focus();

return false;

}*/

return true;

}

 

</script>

</head>

 

<boindex.htmldy onLoad="reScale()" style="background-color:#21255D" >

<div id="boxgeral01_personal"></div>

<div id="Layer2"></div>

<div id="boxgeral02_personal"></div>

<div id="boxtitulo_personal"><img src="img/titulo_personalizados.gif" width="687" height="115" galleryimg="no"></div>

<div class="type05" id="box01_social">

<form name="form1" method="post" action="EnviaCSocialNew.asp" onSubmit="return Validar(); isValidData(document.form1.DT_Nascimento);">

<table width="686" border="1" cellpadding="0" cellspacing="0" bordercolor="#CCCCCC">

<tr>

<td width="684" height="25" bgcolor="#eeeeee" class="type06" style="padding-left:7px;">Dados da Empresa</td>

</tr>

<tr>

<td valign="top"><table width="200" height="5" border="0" cellpadding="0" cellspacing="0">

<tr>

<td><img src="img/px2.gif" width="1" height="1"></td>

</tr>

</table>

<table width="650" border="0" align="center" cellpadding="0" cellspacing="0">

<tr>

<td height="20" valign="bottom" class="type03">Razão Social da atual Empresa: </td>

</tr>

<tr>

<td><input name="Razao_Empresa" type="text" class="campo01" id="Razao_Empresa" size="90" maxlength="90"></td>

</tr>

</table>

<table width="650" border="0" align="center" cellpadding="0" cellspacing="0">

<tr>

<td height="20" colspan="2" valign="bottom" class="type03">Nome do Sócio que sai : </td>

</tr>

<tr>

<td width="72"><select name="Chamar" class="campo01" id="Chamar">

<option value="Sr.">Sr.</option>

<option value="Sra.">Sra.</option>

<option value="Srta.">Srta.</option>

</select> </td>

<td width="588"><input name="Nome" type="text" class="campo01" id="Nome" size="76" maxlength="76"></td>

</tr>

</table>

<table width="200" height="5" border="0" cellpadding="0" cellspacing="0">

<tr>

<td height="10"><img src="img/px2.gif" width="1" height="1"></td>

</tr>

</table></td>

</tr>

<tr>

<td valign="top"> </td>

</tr>

</table>

<table width="200" height="13" border="0" cellpadding="0" cellspacing="0">

<tr>

<td height="15"><img src="img/px2.gif" width="1" height="1"></td>

</tr>

</table>

<table width="686" border="1" cellpadding="0" cellspacing="0" bordercolor="#CCCCCC">

<tr>

<td width="684" height="25" bgcolor="#eeeeee" class="type06" style="padding-left:7px;">Dados da Nova Empresa <span class="type03">(preencher apenas os dados que serão alterados)</span></td>

</tr>

<tr>

<td valign="top"><table width="200" height="5" border="0" cellpadding="0" cellspacing="0">

<tr>

<td><img src="img/px2.gif" width="1" height="1"></td>

</tr>

</table>

<table width="650" border="0" align="center" cellpadding="0" cellspacing="0">

<tr>

<td height="20" valign="bottom" class="type03">Denominação Social (indique três opções):</td>

</tr>

<tr>

<td><textarea name="Denominacao_Social" cols="93" rows="3" class="campo01" id="Denominacao_Social"></textarea></td>

</tr>

</table>

<table width="650" border="0" align="center" cellpadding="0" cellspacing="0">

<tr>

<td height="20" valign="bottom" class="type03">Atividade/Objetivo da Empresa: </td>

</tr>

<tr>

<td><input name="Atividade_Empresa" type="text" class="campo01" id="Atividade_Empresa" size="90" maxlength="90"></td>

</tr>

</table>

<table width="650" border="0" align="center" cellpadding="0" cellspacing="0">

<tr>

<td height="20" valign="bottom" class="type03">Endereço: </td>

</tr>

<tr>

<td><input name="Endereco" type="text" class="campo01" id="Endereco" size="90" maxlength="90"></td>

</tr>

</table>

<table width="650" border="0" align="center" cellpadding="0" cellspacing="0">

<tr>

<td width="350" height="20" valign="bottom" class="type03">Bairro: </td>

<td width="300" valign="bottom" class="type03">CEP:</td>

</tr>

<tr>

<td><input name="Bairro" type="text" class="campo01" id="Bairro" size="60" maxlength="60"></td>

<td><input name="CEP" type="text" class="campo01" id="CEP" size="20" maxlength="9" onKeyPress="return txtBoxFormat(document.form1,'CEP','99999-999',event);"></td>

</tr>

</table>

<table width="650" border="0" align="center" cellpadding="0" cellspacing="0">

<tr>

<td width="350" height="20" valign="bottom" class="type03">Cidade: </td>

<td width="300" valign="bottom" class="type03">Estado:</td>

</tr>

<tr>

<td><input name="Cidade" type="text" class="campo01" id="Cidade" size="60" maxlength="60"></td>

<td><select name="Estado" class="campo01" id="Estado">

<option value="">UF</option>

<option value="AC">AC</option>

<option value="AL">AL</option>

<option value="AM">AM</option>

<option value="AP">AP</option>

<option value="BA">BA</option>

<option value="CE">CE</option>

<option value="DF">DF</option>

<option value="ES">ES</option>

<option value="GO">GO</option>

<option value="MA">MA</option>

<option value="MG">MG</option>

<option value="MS">MS</option>

<option value="MT">MT</option>

<option value="PA">PA</option>

<option value="PB">PB</option>

<option value="PE">PE</option>

<option value="PI">PI</option>

<option value="PR">PR</option>

<option value="RJ">RJ</option>

<option value="RN">RN</option>

<option value="RO">RO</option>

<option value="RR">RR</option>

<option value="RS">RS</option>

<option value="SC">SC</option>

<option value="SE">SE</option>

<option value="SP">SP</option>

<option value="TO">TO</option>

</select> </td>

</tr>

</table>

<table width="650" border="0" align="center" cellpadding="0" cellspacing="0">

<tr>

<td height="20" valign="bottom" class="type03">Observações:</td>

</tr>

<tr>

<td><textarea name="Observacoes" cols="93" rows="3" class="campo01" id="Observacoes"></textarea></td>

</tr>

</table>

<table width="200" height="5" border="0" cellpadding="0" cellspacing="0">

<tr>

<td height="10"><img src="img/px2.gif" width="1" height="1"></td>

</tr>

</table></td>

</tr>

</table>

<table width="200" height="13" border="0" cellpadding="0" cellspacing="0">

<tr>

<td height="15"><img src="img/px2.gif" width="1" height="1"></td>

</tr>

</table>

<table width="686" border="1" cellpadding="0" cellspacing="0" bordercolor="#CCCCCC">

<tr>

<td width="684" height="25" bgcolor="#eeeeee" class="type06" style="padding-left:7px;">Dados do Novo Sócio <span class="type03"></span></td>

</tr>

<tr>

<td valign="top"><table width="200" height="5" border="0" cellpadding="0" cellspacing="0">

<tr>

<td><img src="img/px2.gif" width="1" height="1"></td>

</tr>

</table>

<table width="650" border="0" align="center" cellpadding="0" cellspacing="0">

<tr>

<td height="20" valign="bottom" class="type03">Nome : </td>

<td height="20" valign="bottom" class="type03"> </td>

<td height="20" valign="bottom" class="type03">Data de Nascimento: </td>

</tr>

<tr>

<td width="67"><select name="Chamar_Socio" class="campo01" id="Chamar_Socio">

<option>Sr.</option>

<option>Sra.</option>

<option>Srta.</option>

</select> </td>

<td width="425"><input name="Nome_Socio" type="text" class="campo01" id="Nome_Socio" size="76" maxlength="76"></td>

<td width="158"><input name="DT_Nascimento" type="text" class="campo01" id="DT_Nascimento" size="10" maxlength="10" onKeyPress="return txtBoxFormat(document.form1,'DT_Nascimento','99/99/9999',event);"></td>

</tr>

</table>

<table width="650" border="0" align="center" cellpadding="0" cellspacing="0">

<tr>

<td width="174" height="20" valign="bottom" class="type03">Nacionalidade: </td>

<td width="145" valign="bottom" class="type03">Estado Civil: </td>

<td width="331" valign="bottom" class="type03"> Regime de Comunhão de Bens: </td>

</tr>

<tr>

<td><input name="Nacionalidade" type="text" class="campo01" id="Nacionalidade" size="26" maxlength="26"></td>

<td><select name="Estado_Civil" class="campo01" id="Estado_Civil">

<option value="Solteiro (a)">Solteiro (a)</option>

<option value="Casado (a)">Casado (a)</option>

<option value="Viuvo (a)">Viúvo (a)</option>

<option value="Divorciado (a)">Divorciado (a)</option>

</select> </td>

<td><select name="Regime_Bens" class="campo01" id="Regime_Bens">

<option value="Parcial">Parcial</option>

<option value="Universal">Universal</option>

</select> </td>

</tr>

</table>

<table width="650" border="0" align="center" cellpadding="0" cellspacing="0">

<tr>

<td width="175" height="20" valign="bottom" class="type03">CPF:</td>

<td width="145" valign="bottom" class="type03">RG::</td>

<td width="330" valign="bottom" class="type03">Órgão Emissor: </td>

</tr>

<tr>

<td><input name="CPF" type="text" class="campo01" id="CPF" size="17" maxlength="14" onBlur="return validaCPF(document.form1.CPF);" onKeyPress="return txtBoxFormat(document.form1,'CPF','999.999.999-99', event);"></td>

<td><input name="RG" type="text" class="campo01" id="RG" size="17" maxlength="16"></td>

<td><input name="Orgao_Emissor" type="text" class="campo01" id="Orgao_Emissor" size="25" maxlength="25"></td>

</tr>

</table>

<table width="650" border="0" align="center" cellpadding="0" cellspacing="0">

<tr>

<td width="175" height="20" valign="bottom" class="type03">Título de Eleitor:</td>

<td width="475" valign="bottom" class="type03">PIS Nº: </td>

</tr>

<tr>

<td><input name="Titulo_Eleitor" type="text" class="campo01" id="Titulo_Eleitor" size="17" maxlength="16"></td>

<td><input name="PIS" type="text" class="campo01" id="PIS" size="17" maxlength="16"></td>

</tr>

<tr>

<td> </td>

<td> </td>

</tr>

</table>

<table width="650" border="0" align="center" cellpadding="0" cellspacing="0">

<tr>

<td width="493" height="20" valign="bottom" class="type03">Profissão:</td>

<td width="157" valign="bottom" class="type03">Registro Nº: </td>

</tr>

<tr>

<td><input name="Profissao" type="text" class="campo01" id="Profissao" size="89" maxlength="89"></td>

<td><input name="Registro" type="text" class="campo01" id="Registro" size="17" maxlength="17"></td>

</tr>

</table>

<table width="650" border="0" align="center" cellpadding="0" cellspacing="0">

<tr>

<td height="20" valign="bottom" class="type03">Endereço Residencial: </td>

</tr>

<tr>

<td><input name="Endereco_Res" type="text" class="campo01" id="Endereco_Res" size="89" maxlength="89"></td>

</tr>

</table>

<table width="650" border="0" align="center" cellpadding="0" cellspacing="0">

<tr>

<td width="350" height="20" valign="bottom" class="type03">Bairro: </td>

<td width="300" valign="bottom" class="type03">CEP:</td>

</tr>

<tr>

<td><input name="Bairro_Res" type="text" class="campo01" id="Bairro_Res" size="60" maxlength="60"></td>

<td><input name="CEP_Res" type="text" class="campo01" id="CEP_Res" size="20" onKeyPress="return txtBoxFormat(document.form1,'CEP_Res','99999-999',event);" maxlength="9"></td>

</tr>

</table>

<table width="650" border="0" align="center" cellpadding="0" cellspacing="0">

<tr>

<td width="350" height="20" valign="bottom" class="type03">Cidade: </td>

<td width="300" valign="bottom" class="type03">Estado:</td>

</tr>

<tr>

<td><input name="Cidade_Res" type="text" class="campo01" id="Cidade_Res" size="60" maxlength="60"></td>

<td><select name="Estado_Res" class="campo01" id="Estado_Res">

<option value="">UF</option>

<option value="AC">AC</option>

<option value="AL">AL</option>

<option value="AM">AM</option>

<option value="AP">AP</option>

<option value="BA">BA</option>

<option value="CE">CE</option>

<option value="DF">DF</option>

<option value="ES">ES</option>

<option value="GO">GO</option>

<option value="MA">MA</option>

<option value="MG">MG</option>

<option value="MS">MS</option>

<option value="MT">MT</option>

<option value="PA">PA</option>

<option value="PB">PB</option>

<option value="PE">PE</option>

<option value="PI">PI</option>

<option value="PR">PR</option>

<option value="RJ">RJ</option>

<option value="RN">RN</option>

<option value="RO">RO</option>

<option value="RR">RR</option>

<option value="RS">RS</option>

<option value="SC">SC</option>

<option value="SE">SE</option>

<option value="SP">SP</option>

<option value="TO">TO</option>

</select> </td>

</tr>

</table>

<table width="650" border="0" align="center" cellpadding="0" cellspacing="0">

<tr>

<td width="154" height="20" valign="bottom" class="type03">Tel. Residencial : </td>

<td width="496" valign="bottom" class="type03">Tel. Comercial :</td>

</tr>

<tr>

<td><input name="Tel_Res" type="text" class="campo01" id="Tel_Res" size="20" maxlength="14" onKeyPress="return txtBoxFormat(document.form1,'Tel_Res','(99) 9999-9999',event);"></td>

<td><input name="Tel_Com" type="text" class="campo01" id="Tel_Com" size="20" maxlength="14" onKeyPress="return txtBoxFormat(document.form1,'Tel_Com','(99) 9999-9999',event);"></td>

</tr>

</table>

<table width="650" border="0" align="center" cellpadding="0" cellspacing="0">

<tr>

<td height="20" valign="bottom" class="type03">E-mail:</td>

</tr>

<tr>

<td><input name="Email" type="text" class="campo01" id="Email" size="89" maxlength="89"></td>

</tr>

</table>

<table width="650" border="0" align="center" cellpadding="0" cellspacing="0">

<tr>

<td height="20" valign="bottom" class="type03">Percentual de Capital: </td>

</tr>

<tr>

<td><input name="Perc_Capital" type="text" class="campo01" id="Perc_Capital" size="10" maxlength="5" onKeyPress="return txtBoxFormat(document.form1,'Perc_Capital','99999',event);"></td>

</tr>

</table>

<table width="200" height="5" border="0" cellpadding="0" cellspacing="0">

<tr>

<td height="10"><img src="img/px2.gif" width="1" height="1"></td>

</tr>

</table></td>

</tr>

</table>

<table width="200" height="39" border="0" align="center" cellpadding="0" cellspacing="0">

<tr>

<td height="15" align="center"><input name="limpar" type="reset" class="botao01" id="limpar" value="Limpar" onMouseOver="document.getElementById('limpar').className='botao02'" onMouseOut="document.getElementById('limpar').className='botao01'"></td>

<td align="center"><input name="enviar" type="submit" class="botao01" id="enviar" onMouseOver="document.getElementById('enviar').className='botao02'" onMouseOut="document.getElementById('enviar').className='botao01'" value="Enviar"></td>

</tr>

</table>

</form>

</div>

<div id="boxgeral03_social"></div>

<div id="boxgeral02_social"></div>

<div id="boxmenu_personal">

<table width="400" height="74" cellpadding="0" cellspacing="0">

<tr>

<td width="13"><img src="img/setinha_personalizados.gif" width="6" height="8"></td>

<td width="75"><a href="PersonMedico.html" target="content" class="link07">Médico</a></td>

<td width="13"><img src="img/setinha_personalizados.gif" width="6" height="8"></td>

<td width="106"><a href="indicacao.html" target="_parent" class="link07">Indique uma Empresa </a></td>

<td width="13"><img src="img/setinha_personalizados.gif" width="6" height="8"></td>

<td width="178"><a href="AberturaEmpresa.html" target="content" class="link07">Ficha Cadastral de Abertura de Empresa </a></td>

</tr>

<tr>

<td><img src="img/setinha_personalizados.gif" width="6" height="8"></td>

<td><a href="PersonDentista.html" target="content" class="link07">Dentista</a></td>

<td><img src="img/setinha_personalizados.gif" width="6" height="8"></td>

<td><a href="PersonInformatica.html" target="content" class="link07">Consultor de informática </a></td>

<td><img src="img/setinha_personalizados.gif" width="6" height="8"></td>

<td><a href="ContratoSocial.html" target="content" class="link07">Ficha Cadastral de Alteração do Contrato Social </a></td>

</tr>

</table>

</div>

<div class="type06" id="box02_social"><img src="img/setinha_personalizados.gif" width="6" height="8"> FICHA CADASTRAL DE ALTERAÇÃO DO CONTRATO SOCIAL </div>

</body>

</html>

Compartilhar este post


Link para o post
Compartilhar em outros sites

1º você muda o action do form

 

// de ASP
action="EnviaCSocialNew.asp"

//para PHP
action="EnviaCSocialNew.php"

Quando você envia um formulário para o PHP, ele eh recebido pela variável $_POST (se o method for POST, caso o método seja GET use a variável $_GET)

A variável $_POST é um array e suas chaves são os nomes (atributo name) dos campos

se você tem um <input type="text" name="email"> você terá a variavel $_POST['email']

 

Qualquer dúvida sobre php pesquise em www.php.net

 

E confere a dica do Marlon Souza

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.