Jump to content

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

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.