PDA

View Full Version : how to open a new url when i click on the image in dreamweaver CS4


swetha123
11-14-2008, 11:14 AM
hi

When i click on the Sign in image then it should open this particular page called Spry_styles.page
which i am calling the page in the Header Function here it goes like this header("Location:spry_styles.php?uname=".$cusername);
but here the page is not being opend don't know why ...
please tell what wrong iam i doing
here is my code
<!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=utf-8" />
<title>Untitled Document</title>
</head>
<?php
function connect()
{
$dbhost='localhost';
$dbuser='root';
$dbpass='swetha';
$conn= mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql'.mysql_error());
$dbname='hakman';
mysql_select_db($dbname);
return $conn;
}
function IsEmpty($cuser,$cpass)
{
$str1=strlen($cuser);
$str2=strlen($cpass);
$nRes=min($str1,$str2);
echo "$nres";
if ($nRes==0)
{
echo "<font size='4' face='Garamond' color='red'><b> Missing user Id / Password! </b></font> </br>";
}
return $nRes;
}
?>
<body bgcolor="#0a1936">
<form action="<?php $_SERVER['PHP_SELF'] ?>" method="post" name="form1" id="form1">
<label><input type="image" name="signin" id="signin" src="/hdr_signin1.PNG" /></label>
<br /><br />
<label><input type="image" name="access" id="access" src="/access_acc2.PNG" /></label>
<br /><br />
<label style="color:#FFFFFF">Email Id: </label>&nbsp;&nbsp;
<input type="text" name="cname" id='cname' height="14px" width="177px"/><br />
<br />
<label style="color:#FFFFFF">Password:</label>&nbsp;
<input type="text" name="cpass" id='cpass' height="14px" width="177px"/>
<p>
<input name="checkme" type="image" id="checkme" src="/sign_in_off1.PNG" />
<?php
if (!empty($_POST))
{
$cusername=$_POST['cname'];
$cpassword=$_POST['cpass'];
$check=IsEmpty($cusername,$cpassword);
if ($check>0)
{
$cloginuser=$cusername;
$c=connect();
$query = "SELECT user_id,password FROM users where user_id='".$cusername."' AND password='".$cpassword."'";
$result = mysql_query($query) or die ("Error in query: $query. ".mysql_error());
if (mysql_num_rows($result) > 0)
{
//echo"<font size='4' face='Garamond' color='white'><b>hello swetha</b></font></br>";

header("Location:spry_styles.php?uname=".$cusername);

}
else
{
echo "<font size='4' face='Garamond' color='white'><b>Oouchh.. you failed to Log In </b></font></br>";
}
}
}
?>
</p>
</span>
<p><label><font color="#FFFFFF" face="Monotype Corsiva" size="+2">Forgot Password : </font></label>&nbsp;
<a href="">click here </a></p>
<label><font color="#FFFFFF" face="Monotype Corsiva" size="+2">New Account:</font></label>&nbsp;
<label><input type="image" name="newacc" id="newacc" src="/create_new_account_off1.PNG" /></label>
</form>
</td>
</tr>
</table>
</body>
</html>
please reply me soon
thanks in advance

davidj
11-14-2008, 12:10 PM
could it be this...

$cusernam e

///^ notice the gap between your variable