can someone tell me what is wrong w/ this code?

  • AHaz
  • Graduate
  • Graduate
  • User avatar
  • Posts: 144
  • Loc: New York

Post 3+ Months Ago

Code: [ Select ]
< php
session_start();
if (!session_is_registered("userid")) {
header("Location: http://www.ahazdesigns.com/login.htm");
}

if(!isset($_GET['id']))
header('Location: http://www.ahazdesigns.com/main.php');
$id = $_GET['id'];

$query="SELECT * FROM users WHERE userid = '$id'";
$result=mysql_query($query);
$row = mysql_fetch_array($result)

$first = "$row['first_name']";
$last = "$row['last_name']";
$name = "$first $last";
$age = "$row['age']";
$location = "$row['location']";
$website = "$row['website']";
$interests = "$row['interests']";
$username = "$row['username']";
>
  1. < php
  2. session_start();
  3. if (!session_is_registered("userid")) {
  4. header("Location: http://www.ahazdesigns.com/login.htm");
  5. }
  6. if(!isset($_GET['id']))
  7. header('Location: http://www.ahazdesigns.com/main.php');
  8. $id = $_GET['id'];
  9. $query="SELECT * FROM users WHERE userid = '$id'";
  10. $result=mysql_query($query);
  11. $row = mysql_fetch_array($result)
  12. $first = "$row['first_name']";
  13. $last = "$row['last_name']";
  14. $name = "$first $last";
  15. $age = "$row['age']";
  16. $location = "$row['location']";
  17. $website = "$row['website']";
  18. $interests = "$row['interests']";
  19. $username = "$row['username']";
  20. >

( "?"s left out intentionally)

it says Parse error: parse error, unexpected T_VARIABLE in /home/ahaz/public_html/profiles.php on line 15
Thanks
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • Scorpius
  • Proficient
  • Proficient
  • User avatar
  • Posts: 401
  • Loc: Scorpion Hole

Post 3+ Months Ago

Ok, well first you should put your code in php tags to make it easier to look at.
And second I'm pretty sure this is line 15:
PHP Code: [ Select ]
$row = mysql_fetch_array($result)

if so, change it to:
PHP Code: [ Select ]
$row = mysql_fetch_array($result);

Hope that was of some help for you.
  • AHaz
  • Graduate
  • Graduate
  • User avatar
  • Posts: 144
  • Loc: New York

Post 3+ Months Ago

i tried that and now i get another error...
  • pureone_36
  • Novice
  • Novice
  • pureone_36
  • Posts: 24
  • Loc: earth

Post 3+ Months Ago

then post the error or say what it is

Post Information

  • Total Posts in this topic: 4 posts
  • Users browsing this forum: No registered users and 131 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.