Jump to content

[SOLVED] simple problem (dont know how to put into words)


chocopi

Recommended Posts

This code is meant to get the id from the url and is meant to get the data from the table. however, in between the two //html there is $username and this is obviously meant to display the username however nothing is appearing.

 

<?php

$title = 'Edit Profile';

require_once ('page_header.php');

require_once ('url.php');

$inputcode = urlpart();

$query = "SELECT * FROM users WHERE id = '$inputcode'";
$result = mysql_query($query) or die(mysql_error());
$result = mysql_fetch_assoc($result);

$username = ucfirst($result['username']);
$email = $result['email'];
$gender = $result['gender'];
$orginal = $result['password'];

$raw_password = $_POST['password'];
$raw_confirm = $_POST['confirm'];

print("<a href=\"memberspage.php\">Home Page</a>\n");
print("<br />\n");
print("<form name=\"edit_profile\" method=\"post\" action=\"$PHP_SELF\"> \n");
// html

print("		$username \n");

// html

require_once ('page_footer.php');

?>

 

 

Any help would be appreciated,

 

~ Chocopi

The only way the username will have a value is if the query finds the record.

 

The only way the query will find the record is if the value in $inputcode is correct.

 

The easiest way to check if it is correct is to echo it so you can see what value it contains.

 

Just simple debugging.

 

echo $inputcode;

what it is, is that i am using lycos as an ftp and from some reason when you click on links is does not change the url and thats where i get the id from. so all i need to was open it in a new tab and it was fine

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.