Creating ID's
Moderator: General Moderators
-
sk8erh4x0r
- Forum Commoner
- Posts: 43
- Joined: Wed May 26, 2004 8:27 pm
Creating ID's
Having trouble creating ID's for users on my webpage... need help
?>
?>
-
kettle_drum
- DevNet Resident
- Posts: 1150
- Joined: Sun Jul 20, 2003 9:25 pm
- Location: West Yorkshire, England
Hmm sk8er you need to be more specific. (Its ur bud from mediamonks here by the way, hehe). Anyway if it's still the problem with your viewprofile use something along the lines of:
<?php
$show = $_GET['ID'];
$link = mysql_connect($host, $user, $pass);
mysql_select_db($dbname) or die("couldnt connect" . mysql_error());
$sql = "SELECT * FROM $tblname WHERE ID = '$show'";
$result = mysql_query($sql) or die(mysql_error());
if (mysql_num_rows($result))
{
$row = mysql_fetch_array($result);
etc, etc...
?>
It has nothing to do with ID's. I just used ID as a variable example, lol.
Peace man
<?php
$show = $_GET['ID'];
$link = mysql_connect($host, $user, $pass);
mysql_select_db($dbname) or die("couldnt connect" . mysql_error());
$sql = "SELECT * FROM $tblname WHERE ID = '$show'";
$result = mysql_query($sql) or die(mysql_error());
if (mysql_num_rows($result))
{
$row = mysql_fetch_array($result);
etc, etc...
?>
It has nothing to do with ID's. I just used ID as a variable example, lol.
Peace man
Last edited by Joe on Wed May 26, 2004 8:34 pm, edited 1 time in total.
-
sk8erh4x0r
- Forum Commoner
- Posts: 43
- Joined: Wed May 26, 2004 8:27 pm
little more detailed...
The ID's i am setting up are user ID's. People are able to register accounts there. When an account is created, it sends the info to the mySQL database and opens up a userinfo page. On that userinfo page, I want the ID to show up in the URL. Ex.
URL_HERE/userinfo.php?ID=sk8erhacker
How do i set up that ?ID= ?
URL_HERE/userinfo.php?ID=sk8erhacker
How do i set up that ?ID= ?
Last edited by sk8erh4x0r on Wed May 26, 2004 10:14 pm, edited 1 time in total.
I just told you the code required to make a userinfo profile. If your asking how the ID can forward you to the userinfo page when you click it's link you should setup a variable and a new db column. The variable should go like:
$user = "<A href=http://www.securityglitch.com/userinfo. ... rname."</A>";
$user = "<A href=http://www.securityglitch.com/userinfo. ... rname."</A>";
-
d3ad1ysp0rk
- Forum Donator
- Posts: 1661
- Joined: Mon Oct 20, 2003 8:31 pm
- Location: Maine, USA
http://www.securityglitch.com/Tutorials/
The fact that you have "Hacking" and "Cracking" in the same tutorials list makes me not want to help you much. :\
edit: also, check the freewebs TOS. I don't believe they allow illegal things to be hosted on their sites.
Also, try a new template.
The fact that you have "Hacking" and "Cracking" in the same tutorials list makes me not want to help you much. :\
edit: also, check the freewebs TOS. I don't believe they allow illegal things to be hosted on their sites.
Also, try a new template.
-
sk8erh4x0r
- Forum Commoner
- Posts: 43
- Joined: Wed May 26, 2004 8:27 pm
Hey LiLpunkSkateR, I must say that your opinion against security enthusiasts is very low. Do you know anything about hacking and what it's purpose is. I do not think the person in question is planning to destroy anything. Instead I think he's just trying to improve his security skills to prevent any unwanted intrusions to his property. And as for the freewebs problem, well I had a look and noticed that nothing from the freewebs server which is being used on that site is illegal at all.
Do not judge ones thoughts, we are all individuals!
Regards
Do not judge ones thoughts, we are all individuals!
Regards
Actually, I would personally use this approach, as it's very, very hard to have a primary unique id/key to apear twice. It's the most common version imho ( as seen on this very board, the u=11209 part of profile.php?mode=viewprofile&u=11209 )tim wrote:you could use auto_increment attribute here.
it would look like
user.php?id=8
or just use mysql_fetch_array to get the row['username'] and just connect to the sql server via the $_POST OR $_GET method to get the exact record(s) of the specific username
If you use an auto_increment id, you have more than half the work done made.
-
sk8erh4x0r
- Forum Commoner
- Posts: 43
- Joined: Wed May 26, 2004 8:27 pm
Ok
I'm having trouble with this auto_increment thing. I have a column set as:
field = id, type = varchar, length/values* = (none), attributes = (none), null = not null, Default** = (none), Extra = auto_increment.
When i go to save i get the error saying that it is incorrect. Any help?[/mysql_man]
field = id, type = varchar, length/values* = (none), attributes = (none), null = not null, Default** = (none), Extra = auto_increment.
When i go to save i get the error saying that it is incorrect. Any help?[/mysql_man]
-
sk8erh4x0r
- Forum Commoner
- Posts: 43
- Joined: Wed May 26, 2004 8:27 pm