Jump to content

Alex2k15

New Members
  • Content Count

    5
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Alex2k15

  • Rank
    Newbie
  1. http://i.imgur.com/rkCyozv.jpg Look at the botom part. That is suppose to show only after i edit the profile. Can we fix that?
  2. This is how it looks: <?php session_start(); include_once 'dbconnect.php'; if(!isset($_SESSION['user'])) { header("Location: index.php"); } $res=mysql_query("SELECT * FROM users WHERE user_id=".$_SESSION['user']); $userRow=mysql_fetch_array($res); ?> <!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>Home - <?php echo $userRow['username']; ?></title> <link rel="stylesheet" href="css/style.css" type="text/css" /> </head> <body> <div id="header"> <div id="left"> <label>Chillz</label> </div> <div id="right"> <div id="content"> Welcome, <?php echo $userRow['username']; ?> <a href="logout.php?logout">Sign Out</a> </div> </div> </div> <div id="body"> <b>Edit your Profile</b> <br><br> Please enter your details below to update your profile. <br><br> <form method="post" action="editprofile.php" name="editform" id="editform"> <table width=700px border=0 cellspacing=10><tr><td valign=top><table border=0> <b>Required Information:</b><br><br> <tr><td> <b>Username:</b> </td><td> <?php echo $username; ?> </td></tr><tr><td> <b>Email Address:</b> </td><td> <input type="text" name="email" id="email" value="<?php echo $email; ?>"> </td></tr></table></td><td valign=top> <table border=0> <b>Optional Information:</b><br><br> <tr><td> <b>Location:</b> </td><td> <input type="text" name="location" id="location" value="<?php echo $location; ?>"> </td></tr><tr><td> <b>Your Website:</b> </td><td> <input type="text" name="website" id="website" value="<?php echo $website; ?>"> </tr></td><tr><td valign=top> <b>Short About:</b> </td><td> <textarea name="about" id="about" rows="10" cols="20"><?php echo $about; ?></textarea> </td></tr></td> </table> </td></tr> </table> <input type="submit" name="register" id="register" value="Update" class=btn /> </form> <?php $editquery = mysql_query("UPDATE users SET email=$email, password=$password, location=$location, picture=$picture, website=$website, about=$about WHERE user_id=._$SESSION['user']); if($editquery) { echo "<b>Success!</b>"; echo "Your profile was successfully updated. Please click<a href=\"profile.php\"> here </a>to view."; } else { echo "<b>Error</b>"; echo "<p>Sorry, your profile update failed. Please go back and try again.</p>"; } ?> </div> </body> </html> i feel like i did the WHERE part wrong. Plus i get this error. Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/u890091543/public_html/login/edit.php on line 68
  3. so pretty much like this $editquery = mysql_query("UPDATE users SET email=$email, password=$password, location=$location, picture=$picture, website=$website, about=$about WHERE user_id=._SESSION['user']);
  4. Yeah idk what's wrong and i want some help. Let's start with edit.php <?php session_start(); include_once 'dbconnect.php'; if(!isset($_SESSION['user'])) { header("Location: index.php"); } $res=mysql_query("SELECT * FROM users WHERE user_id=".$_SESSION['user']); $userRow=mysql_fetch_array($res); ?> <!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>Home - <?php echo $userRow['username']; ?></title> <link rel="stylesheet" href="css/style.css" type="text/css" /> </head> <body> <div id="header"> <div id="left"> <label>Chillz</label> </div> <div id="right"> <div id="content"> Welcome, <?php echo $userRow['username']; ?> <a href="logout.php?logout">Sign Out</a> </div> </div> </div> <div id="body"> <b>Edit your Profile</b> <br><br> Please enter your details below to update your profile. <br><br> <form method="post" action="editprofile.php" name="editform" id="editform"> <table width=700px border=0 cellspacing=10><tr><td valign=top><table border=0> <b>Required Information:</b><br><br> <tr><td> <b>Username:</b> </td><td> <?php echo $username; ?> </td></tr><tr><td> <b>Email Address:</b> </td><td> <input type="text" name="email" id="email" value="<?php echo $email; ?>"> </td></tr></table></td><td valign=top> <table border=0> <b>Optional Information:</b><br><br> <tr><td> <b>Location:</b> </td><td> <input type="text" name="location" id="location" value="<?php echo $location; ?>"> </td></tr><tr><td> <b>Your Website:</b> </td><td> <input type="text" name="website" id="website" value="<?php echo $website; ?>"> </tr></td><tr><td valign=top> <b>Short About:</b> </td><td> <textarea name="about" id="about" rows="10" cols="20"><?php echo $about; ?></textarea> </td></tr></td> </table> </td></tr> </table> <input type="submit" name="register" id="register" value="Update" class=btn /> </form> </div> <?php $editquery = mysql_query("Update users (email, location, website, about) VALUES('".$email."', '".$location."', '".$website."', '".$about."')"); if($editquery ==) { echo "<b>Success!</b>"; echo "Your profile was successfully updated. Please click<a href=\"viewprofile.php\"> here </a>to view."; } else { echo "<b>Error</b>"; echo "<p>Sorry, your profile update failed. Please go back and try again.</p>"; } ?> </div> </body> </html> I can't upload an image but here is the urls: http://i.imgur.com/ZkHMM4a.jpg http://i.imgur.com/HsAhfiM.jpg I want to remove the error part. Plus i was hoping someone can help me work on the profile part
  5. Hi, My name is Alex. I recently registered for PhpFreak to learn more about php and ask for ALOT of help. I have experience using html/css. I'm in the process of learning js an python. I like warm walk on the beach and virtual worlds. Can't wait to see what the forum has to share. I'M GONNA GET MY FREAK ON
×
×
  • 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.