HOW TO SET THE URL ?user=username ???

Hello guys,

Im very new to this programming world… i am creating my website and i have found some free scripts that i am trying to adjust to my needs…

I found 2 scripts that allow users to register on my website and create their profile, they both work OK and i can add the information to my MYSQL data base (username, password, email, description, etc)

I have a file named “userprofile.php” which will allow me to see a specific user’s profile but i have to add the following syntax: ?username=USERNAMEHERE (where USERNAMEHERE is the name of whatever member on my site). BUT… I found another free script that also works fine like this one but i noticed that the syntax changes a lil bit and instead of my having to add ?user=XXX, it uses ?id=AND-NUMBERS (eg. ?id=10)

My question is… how or where can i choose whether i want to user ?user=XXX or id?=XX to display a profile??? i just cant find that anywhere in the code? or is it a database thing and thats the primary key or something?

i hope i made myself clear, im just a newbie and i dont really know the terms for all that stuff :o

thanks!

both ok but i think the id is batter for it hide the username! if you want to know how to do this please email me

i just emailed you… i dont know how to choose whether ?user= or ?id= or even if i can make a custom one like ?member=

Hi there,

From personal experience, I would go with ?id=[id]. It’s easier to maintain in your code and more commonly used. The id would be a user-like id number in your database which would be used as a primary key that can’t be duplicated by other rows and set to auto increment.

Hope this helps.

Sponsor our Newsletter | Privacy Policy | Terms of Service