Jump to content


WellingtonSG

Member Since 19/08/2008
Offline Last Active 17/12/2009, 15:16
-----

Topics I've Started

Problema Com Code

15/11/2008, 00:05

Olá pessoal

Instalei o WP certinho, mas na hora de postar um código PHP não tem o botão de CODE.

Como faço pra inserir códigos no WP.


Obrigado

Erro Com Session

26/09/2008, 10:12

Bom dia pessoal

Estou usando session para uma área restrita e deu esse erro:

Parse error: syntax error, unexpected '=' in C:\wamp\www\senha\config.php on line 5

Aqui o código:

<?php
include "config.php";
$login = $_POST['login'];
$senha = $_POST['senha'];
$conexao = mysql_query("SELECT * FROM usuarios where login = '$login' AND senha = '$senha'"); 
if(mysql_num_rows($conexao) == 1){
	$_SESSION['login_session'] = $login;
	$_SESSION['senha_session'] = $senha;
		 include "pagina_principal.php";

}else{
	include "index.php";
}
?>

Obrigado pela ajuda

Erro Ao Editar Usuarios

18/09/2008, 01:56

Buenas pessoal, estou fazendo um sistema de cadastro de usuarios, ele cadastro certinho, mas na hora de editar não aparece os valores gravados no banco de dados:

exemplo: editar.php?id=3 seria pra editar o número 3, mas o form fica em branco, aqui o código:

<?php
require_once "config.php";

$conexao = mysql_connect ($servidor, $usuario, $senha)or die ("Impossivel de Conectar Servidor Mysql");
mysql_select_db ($nomebase , $conexao) or die ("Impossivel de abrir banco Mysql");

$id_usuarios = $_GET['id'];

$SQL = mysql_query("SELECT id,nome,email,senha,mensagem FROM usuarios order by id DESC") or die(mysql_error()); 

while ($linha = mysql_fetch_assoc($SQL)) {		

{
	$id = $row['id'];
	$nome   = $row['nome'];
	$email	= $row['email'];
	$senha	 = $row['senha'];
	$mensagem	  = $row['mensagem'];
	}

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Editar Usuarios</title>
<style type="text/css">
<!--
.style1 {
	font-size: 10px;
	font-weight: bold;
	font-family: Verdana, Arial, Helvetica, sans-serif;
}
-->
</style>
</head>

<body>
<form action="edit_done.php" method="post" name="form1">

<table width="257" align="center" cellpadding="0" cellspacing="0">
  <tr>
	<td><span class="style1">Nome:</span></td>
	<td><div align="center">
	  <input name="nome" type="text" id="nome" value="<?=$nome?>" />
	</div></td>
  </tr>
  <tr>
	<td><span class="style1">Email:</span></td>
	<td><div align="center">
	  <input name="email" type="text" id="email" value="<?=$email?>" />
	</div></td>
  </tr>
  <tr>
	<td><span class="style1">Telefone:</span></td>
	<td><div align="center">
	  <input name="telefone" type="text" id="telefone" value="<?=$telefone?>" />
	</div></td>
  </tr>
  <tr>
	<td><span class="style1">Senha</span>:</td>
	<td><div align="center">
	  <input name="senha" type="password" id="senha" value="<?=$senha?>" />
	</div></td>
  </tr>
  <tr>
	<td><span class="style1">Mensagem:</span>:</td>
	<td>
	  
	  <div align="center">
		  <textarea name="mensagem" cols="15" rows="5" id="mensagem"><?=$mensagem?>
		  </textarea>
	  </div></td>
  </tr>
  <tr></tr>
</table>
<table width="476" align="center" cellpadding="0" cellspacing="0">
  <tr>
	<td width="369">
	  
	  <div align="right">
		<input type="submit" name="Submit3" value="Editar" />	  
		<input type="reset" name="Submit22" value="Limpar" />	
	  </div></td>
  </tr>
</table>
</form>
</body>
</html>
<? } ?>

Obrigado a todos

Erro Ao Gravar Dados No Formulario

04/09/2008, 18:01

Olá pessoal

Estou tentando gravar dados no banco de dados, mas o formulario não grava e da o erro,

Parse error: syntax error, unexpected ';' in /home/infohelp/public_html/comandos/principal.php on line 15

Aqui meu código:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>
<link href="css/css2.css" rel="stylesheet" type="text/css" />
<?
include "config.php";

$nome = $_POST["nome"];
$email = $_POST["email"];
$cidade = $_POST["cidade"];
$mensagem = $_POST["mensagem"];
if($_GET['btn'] == "gravar";){
$cadastrar = mysql_query("INSERT INTO comandos_sql (nome, email, cidade, mensagem) 
VALUES
('$nome','$email','$cidade','$mensagem',)",$db)or die(mysql_error());;

if ($cadastar ==1){
  print"
  <meta HTTP EQUIVE=REFESH CONTENT='0; URL=principal.php'>
  <script type=\"text/javascript\">
  alert(\"Cadastro Feito com Sucesso.\");
  </script>
  ";
  }

?>
<form id="form1" name="form1" method="post" action="?btn=gravar">
  <table width="321" cellpadding="3" cellspacing="3">
	<tr>
	  <td width="69">Nome:</td>
	  <td width="229"><input name="nome" type="text" id="nome" /></td>
	</tr>
	<tr>
	  <td>Email:</td>
	  <td><input name="email" type="text" id="email" /></td>
	</tr>
	<tr>
	  <td>Cidade:</td>
	  <td><input name="cidade" type="text" id="cidade" /></td>
	</tr>
	<tr>
	  <td valign="top">Mensagem:</td>
	  <td><p>
		<textarea name="mensagem" cols="35" rows="5" id="mensagem"></textarea>
	  </p>
	  <p>
		<input name="Submit" type="submit" id="Submit" value="gravar" />
		<input type="reset" name="Submit2" value="Deletar!" />
	  </p></td>
	</tr>
  </table>
</form>
</div>
</body>
</html>

Analise E Desenvolvimento De Sistemas

02/09/2008, 13:42

Olá pessoal

Estou pensando em fazer o curso de Analise e Desenvolvimento de Sistemas

Mas minhas dúvidas são:

Em qual área posso atuar?

Vale a pena sendo que é um curso tecnologo?

Preciso saber programar?

E dicas serão bem vindas.

Grande abraço

IPB Skin By Virteq