Jump to content

lavarock09

Members
  • Posts

    5
  • Joined

  • Last visited

Posts posted by lavarock09

  1. if(isset($_POST['save']));{	$title = $_POST['title'];	$content = $_POST['content'];	$picture = $_POST['picture'];		$query = "INSERT INTO homepage (title, content, picture)".    "VALUES ('$title', '$content', '$picture')";	$result = mysql_query($query) or die('Error ,query failed');		echo "Article '$title' Added";	echo "<br /><a href='index.php'>Back to Homepage</a>";}

    I changed VALUE to VALUESThat should work

  2. this is a simple login scriptlogin.htm

    <form action="login.php" method="post">Password: <input type="text" name="password"></form>

    login.php

    <?php$conn = mysql_connect(localhost,db userame,db password);mysql_select_db(db name) or die("Unable to select database");$password = $_POST['password'];$password2 = md5($password);/*To Be really safe you could do this */$password3 = md5($password2);/* Assuming that you have the encrypted password in the db do this */$getdbpassword = mysql_query("SELECT * FROM password");while ($row = @mysql_fetch_assoc($getdbpassword)){$pass = $row['password'];}if($pass == $password3){echo 'Successfully Logged In';}else{echo 'Login Failure. Please try again.';}/* If you don't have the encrypted password in your database, run this and put what gets outputted into a table called password in a field called password in your DB */echo $password3;

    Hope this makes sense

×
×
  • Create New...