Hi, i have a login section made through layers and tables within dreamweaver. At the same place i have a login button (i have coded it and it works all right) but at the moment i have an issue, because when i sign in the login section which says enter username and password can still be seen. Is there any way of hiding this section of the website when i have successfully logged in. I have linked the login button to my login.php code page. What changes do i make to my login.php so that when i click on the login button on my dreamweaver page the login section on my webpage disappears.

Thankyou

Is this not simply a variation on your other question here?

I do not know, but if it is im sorry. But actually i want to know how to hide or show layers e.g. <div id=layer onclick="MM_hideshowlayer('layer1','','hide')"> </div>, i tried something like this but it hides the entire thing while i want it to hide when i click on my button. I don't know if your getting what i really mean. Thank you

in your form tag, you should be using something like this:

<form method="post" action="login.php">
Username: <input type="text" name="username" /><br />
Password: <input type="password" name="password" /><br />
<input type="submit" onclick="this.form.submit" />

Then in your login.php file you want something like this:

<?php
$username = $_post["username"];
$password = $_post["password"];

$sql = "SELECT * FROM users WHERE userName = '$username'";
$result=mysql_fetch_array($sql);
if (!$result)
{
     die "Could not Query Database";
     mysql_error();
}
if ($username == $result[1] && $password == $result[2])
{
     session_start();

Then you would have the rest of your code after that. This is a really basic login, but it should be a basis that you can use for your page.

I'm not all that great with forms, but this should get you going.

Thank you for the help i'll try it out.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.