Jump to content

[SOLVED] odd error


quickstopman

Recommended Posts

hi guys

im currently working on a delete user page for the user

it seems like it would work

but for some odd reason

i get this error

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting '}' in /home/pokebash/public_html/getmetola/deleteaccount.php on line 29

 

why exactly would i need a } on that line in the code

<?
include("config.php");
session_start();
ob_start();

if (!isset($_SESSION['username'])) {
include("header.php");

$choice = $_POST['choice'];
$yes = $_POST['yes'];
$no = $_POST['no'];

if ($choice) {

if ($yes = "Yes") {

mysql_query("DELETE FROM users WHERE id='{$_SESSION['id']'") or die(mysql_error());

header("Refresh:2; url=logout.php");

echo " Your account has been Deleted";
} else if ($no = "No") {
header("Location: editprofile.php");
}
} else {
echo "<h1> Are you sure??? </h1><br><br>";

echo "That you want to Delete "
echo $_SESSION['username'];
echo " ?"
echo '
<form name="choice" method="POST" action="deleteaccount.php">
<input type="submit" value="Yes" name="yes">  <input type="submit" value="No" name="no">
</form>
';


}
} else {
header("Location: default.html");
}

?>

 

thanks

 

-- Dustin

Link to comment
https://forums.phpfreaks.com/topic/51905-solved-odd-error/
Share on other sites

 

<?
include("config.php");
session_start();
ob_start();

if (!isset($_SESSION['username'])) {
include("header.php");

$choice = $_POST['choice'];
$yes = $_POST['yes'];
$no = $_POST['no'];

if ($choice) {

if ($yes = "Yes") {

mysql_query("DELETE FROM users WHERE id='{$_SESSION['id']'") or die(mysql_error());

header("Refresh:2; url=logout.php");

echo " Your account has been Deleted";
} else {
if ($no = "No") {
header("Location: editprofile.php");
}
} else {
echo "<h1> Are you sure??? </h1><br><br>";

echo "That you want to Delete "
echo $_SESSION['username'];
echo " ?"
echo '
<form name="choice" method="POST" action="deleteaccount.php">
<input type="submit" value="Yes" name="yes">  <input type="submit" value="No" name="no">
</form>
';


}
} else {
header("Location: default.html");
}

?>

 

try that,

Link to comment
https://forums.phpfreaks.com/topic/51905-solved-odd-error/#findComment-255878
Share on other sites

<?php
echo "That you want to Delete "; // semicolon required here
echo $_SESSION['username'];
echo " ?"; // semicolon required here
echo '
<form name="choice" method="POST" action="deleteaccount.php">
<input type="submit" value="Yes" name="yes">  <input type="submit" value="No" name="no">
</form>
';

 

These are basic syntax errors, I would look up on the basic syntax of PHP before you go too much further. These are not "odd errors" they are fully legit and very helpful as they point out the offending line. Also a syntax highlighting program might help you with this also.

Link to comment
https://forums.phpfreaks.com/topic/51905-solved-odd-error/#findComment-255885
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.