Jump to content

Recommended Posts

I am pulling my hair out at this simple problem, sorry to waste your time with something like this but I really don't know where I have gone wrong. Here is error message:

 

Parse error: syntax error, unexpected T_VARIABLE in /home/abc/public_html/members/profile/updatebio.php on line 10

 

Here is my code:

 

<html>
<body>
<?php

session_start();

//CONNECT TO DATABASE//

$hostname = "abc"; 
$username = "abc";
$password = "abc";
$db_name = "abc";
$tbl_name = "accounts";

$connect = mysql_connect($hostname,$username,$password);
if (!$connect)
{
die("Connection to database failed.<br />" . " Please contact an Administrator and show them the code above.<br />");
}

//SELECT CORRECT DATABASE//
mysql_select_db("$db_name", $connect)or die("Cannot select database.");

////////////////////////

$currentusr = $_SESSION['usr'];
$currentema = $_SESSION['ema'];

$newbio = $_POST['changebio'];

$updatebio = mysql_query("UPDATE accounts SET bio='$newbio' WHERE usr='$currentusr' AND ema='$currentema'");

if($updatebio)
{
header(Location:"http://www.blu-byte.co.cc/members/profile/edit.php");
}
else
{
echo "Sorry about this but we have unsuccessfully changed your biography.";
}

?>
</body>
</html>

 

What is the problem?

Link to comment
https://forums.phpfreaks.com/topic/266768-simply-annoying/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.