Hi again,
I've fixed some of the big problems with my work, but I would like to ask how to solve a few problems. (:bemused: but also 😃)
First, when I submit a "Change Password" form, I get this error:
"Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /*/**/_*/changed.php on line 16"
Here's the code for the form:
<html>
<head>
<title> Lego Comic </title>
<link rel="stylesheet" type="text/css" href="style.css" />
<head>
<body>
<center>
<h1> Lego Comic </h1>
<h2> To change your password, fill in the form below. </h2>
<form action="changed.php" method="post" />
<p> Username: </p> <input name="username" />
<p> New Password: </p> <input type="password" name="newpassword" />
<p> <input type="submit" value="Change My Password" /> </p>
</form>
</center>
</body>
<html>
Here's the code for the handling page:
<html>
<head>
<title> Lego Comic </title>
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>
<center>
<h1> Your password has been changed! </h1>
<h2> If you are not immediately redirected to the main site, click <a href="mainsite.php" title="Main Site"> HERE. </a> </h2>
<?php
include "dbconfig.php";
$strSQL = "Update Members set ";
$strSQL = $strSQL . "password = '(.$_POST['newpassword'].)'";
$strSQL = $strSQL . "Where username = ( . $_POST['username'] . )";
mysql_query($strSQL);
mysql_close();
Header("Location: mainsite.php");
?>
</center>
</body>
</html>
Second, when I submit a "Delete Account" form, I get this error:
"Parse error: syntax error, unexpected '"', expecting T_STRING or T_VARIABLE or T_NUM_STRING in /*/**/_*/deleted.php on line 15"
Here's the code for the form:
<html>
<head>
<title> Lego Comic </title>
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>
<center>
<h1> Lego Comic </h1>
<h2> To delete your account, enter your username and password below. </h2>
<form action="deleted.php" method="post" />
<p> Username: </p> <input name="username" />
<p> Password: </p> <input type="password" name="password" />
<p> <input type="submit" value="Delte My Account" /> </p>
</form>
<h2> WARNING: Be sure you want to do this! If you have second thoughts, click <a href="mainsite.php" title="Don't Delete"> HERE </a> </h2>
</center>
</body>
</html>
Here's the code for the handing page:
<html>
<head>
<title> Lego Comic </title>
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>
<center>
<h1> Your account has been deleted... :( </h1>
<h2> If you are not immediately redirected to the home page, click <a href="index.php" title="Home Page"> HERE. </a> </h2>
<?php
include "dbconfig.php";
//The part below deletes the record
$strSQL = "DELETE FROM Members WHERE username = '( . $_POST["username"] . )' AND password = '( . $_POST["password"] . )'";
mysql_query($strSQL);
mysql_close();
Header("Location: index.php");
?>
</center>
</body>
</html>
I will address other issues as they come along.
Thank you all for your help in the past! 😃