Hi Guys!
I am working with the Web Application recipes. I am currently working on the send password page. The page is working, but I sends the same password and username regardless of the email entered. Here is the code.
=========================code=============================
<?php require_once('Connections/newsfeed.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
$EmailParam_LostPassword = "webmaster@sk8photos.com";
if (isset($_POST['EmailAddress'])) {
$EmailParam_LostPassword = $_POST['EmailAddress'];
}
mysql_select_db($database_newsfeed, $newsfeed);
$query_LostPassword = sprintf("SELECT UserName, UserPassword FROM users WHERE UserEmail = %s", GetSQLValueString($EmailParam_LostPassword, "int"));
$LostPassword = mysql_query($query_LostPassword, $newsfeed) or die(mysql_error());
$row_LostPassword = mysql_fetch_assoc($LostPassword);
$totalRows_LostPassword = mysql_num_rows($LostPassword);
?>
<?php
$ConfirmMessage = "";
if ($totalRows_LostPassword > 0) {
$to = $_POST['EmailAddress'];
$from = 'From:webmaster@sk8photos.com <webmaster@sk8photos.com>rn';
$subject = "RE: Your sk8photos Login Information";
$body = "UserName: " . $row_LostPassword['UserName'] . "rPassword: " . $row_LostPassword['UserPassword'];
@mail($to,$subject,$body,$from);
$ConfirmMessage = "Your login information has been sent to: " . $_POST['EmailAddress'];
}
?>
<html>
<head>
<title>Sk8photos.com | Send Password</title>
<link rel="stylesheet" href="style.css" type="text/css">
<meta name="description" content="">
<meta name="keywords" content="keywords">
</head>
<body>
<div align="center">
<div id="container_big">
<div id="container">
<div id="header">
<div id="banner"></div>
<div id="logo">
<a href="#" title="Homepage »">Sk8photos.com</a></div>
<div id="slogan"><marquee behavior="slide" direction="left">Roll ......Click......Roll click</marquee></div>
<div id="menu">
<a href="#">HOME</a>
<a href="#">NEWS</a>
<a href="#">PHOTOS</a>
<a href="#">VIDEOS</a>
<a href="#">CONTACT US</a>
</div>
</div>
<!-- content begin -->
<div id="content">
<div id="right">
<div style="margin-left: 8px;">
<img src="images/i1.jpg" vspace="3"><br />
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis.
<img src="images/i2.jpg" vspace="4">
</div>
</div>
<div id="main">
<table width="100%" border="0" cellspacing="1" cellpadding="1">
<tr>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="40"><table width="100%" class="layoutTable" border="0" cellpadding="6" cellspacing="0">
<tr>
<td width="200" align="center" valign="bottom" bgcolor="#F82474" class="pageHeader">SEND
PASSWORD </td>
<td bgcolor="#E9BE15"> </td>
</tr>
</table></td>
</tr>
<tr>
<td><form name="SendPassword" method="post" action="">
<table width="100%" border="0" cellspacing="0" cellpadding="6">
<tr>
<td width="25"> </td>
<td colspan="2"> </td>
</tr>
<tr>
<td width="25"> </td>
<td colspan="2" class="plaintext">If you have forgotten your
password, please enter the email address you used to register
in the text box below. Your user name and password information
will be e-mailed to that email address. </td>
</tr>
<tr>
<td> </td>
<td colspan="2"><?php echo $ConfirmMessage; ?> </td>
</tr>
<tr>
<td width="25"> </td>
<td class="formTitle">Email Address</td>
<td class="formField"><input name="EmailAddress" type="text" id="EmailAddress" size="40"></td>
</tr>
<tr>
<td width="25"> </td>
<td class="formTitle"> </td>
<td class="formField"><input name="SendPWD" type="submit" id="SendPWD" value="Send Login Info"></td>
</tr>
</table>
</form> </td>
</tr>
</table>
</td>
</tr>
</table>
<h1><br clear="all">
</h1>
</div>
<br clear="all">
</div>
</div>
<!-- content end -->
<div id="footer">
© 2007 <a href="#"><strong>Celebrere.com</strong>
</div>
</div>
</div>
</div>
</div>
</body></html>
<?php
mysql_free_result($LostPassword);
?>
user data not transferring to new page
I'm a PHP learner. After an index.php page, the user goes to a login.php page. Both pages seem to be working.After logging in with username, password, and a special code, the user is transferred to
PHP SUBMIT
Code: <input name="doLogin" type="image" src="images/loginsubmit.jpg" id="doLogin3" value="Login">ON FIREFOX it works finebut on
VAT
how should I deal with VAT?if I have a product that costs £5.00 and VAT @ 17.5% (£0.875) the total cost of the product is £5.875.so how do people deal with VAT should I round up/down? are
Program with calculate Meteorologic measurements
Hello I'm a beginner and I want to make a program with calculate Meteorologic measurements:
mail()
Hi all. I have a problem with emails. I am trying to set up a mail system where customers can subscribe to a news letter . Those who subscribe will receive a monthly email. They can unsubscribe using
Display certain image depending on time of year
Hi, I am new to these forums and would really appreciate some advice on a piece of coding I have done.Basically what I am trying to do is on our intranet, display a different home page banner
article site help remaining text
Hi all hope you will be fineI am creating a article site in this site i want to put some text on main page and link it via "read more" text from articles page and complete article will be
server trace logs
could any one tell me from where do i get error logs in xMII??I want to check the reason for dtabase connection failure
Need help PLEASE
ok i have this warning showing upWarning: in_array() [function.in-array]: Wrong datatype for second argument in /home/lalala/public_html/attack.php on line 72the code i use Code: [Select]//same ip
When i am Canseling the Billing Document in VF11 I am getting Shortdump
Hi Experts