Making a Profiles System. Help, anybody?

So I’m making a profile system. I plan on the URL being messy (not like example.com/profiles/user, more like example.com/profiles/bunch of mess from $_GET) so no detailed stuff, just basic.

In the url, instead of it being example.com/profiles/id?=1 I want it to go by email. I know this may sound unsucure, but I’m hashing it, so don’t worry. (Don’t include the hash. I’m doing a certain hash). What would it be like? I imagine it’d be like this…

[php]

This profile belongs to

<?php
$hashemail = hash(“sha512”, $email);
echo($_GET[’$hashemail’]); ?>[/php]

Or something like that. I just thought it up now, never testing it. I just finished my login system, now I’m working on profiles

Thanks a billion!

Hashing won’t make a difference.[php]

<?php $Email = $_GET['email']; $link = mysql_connect("host","user","pass"); mysql_select_db("database"); $Query = "SELECT * FROM table WHERE email='{$Email}'"; $Result = mysql_query($Query, $link); If (!$Result) { die("Could not find user"); } $User = mysql_fetch_array($Result); ?>

This profile belongs to:

<?php Echo $User['name']; ?> [/php]

Thanks. My site, though, the users are know by first and, if they choose, last name. I can’t parade around their email in the address bar. Is there a way to hash it before I use $_GET?

Also, at the beginning when I do $_GET[‘email’] I have nothing loaded from the GET variable. Should I use $_SESSION[‘email’] instead, since I have the email stored in a session? Is there a way to go from a session to using $_GET on the same page? I’m pretty new, so bare with me

if you type address as http://domain.com/[email protected] it will load the email correctly in the $_GET. If you’re determined to go this way, you have no choice but to show their email in the bar.

Hm. Ok, thanks. I think I’ll use their unique number then, or when I register I can make a hashed version of their email and I display that under $_GET

Sponsor our Newsletter | Privacy Policy | Terms of Service