Search found 7 matches
- Fri Nov 11, 2011 4:41 am
- Forum: PHP
- Topic: Login system and user profile
- Replies: 8
- Views: 2013
Re: Login system and user profile
header('Refresh: 0; url=profile.php'); $_SESSION['username']=$username; you have this in line 29 or 30 when the php start the header will be start first the the header function work it going to cancel anything bellow {I think like that } better 2 user meta refresh {html} better than header('Refresh...
Re: User id
yes i know but is better of show the datajacek wrote:That idea is exactly right, but there code has a few problems. There is no need for a while loop when only selecting one row, and that query should really go in a function.
Re: User id
<?php session_start(); $sql="SELECT username,password FROM users WHERE username='userfrom post' AND password='password from post '"; while($user=mysql_fetch_assoc($sql)){ $id=$user['id']; $username=$user['username']; $password=$user['password']; } if($username = $_POST['user'] && ...
Re: User id
hi
you can make it
hen the user is login and he is logined do like this
when your code are checked if that was login or not
save the user id in session =)
that is the best way
=)
you can make it
hen the user is login and he is logined do like this
when your code are checked if that was login or not
save the user id in session =)
that is the best way
=)
- Mon May 16, 2011 8:15 pm
- Forum: Tutorials
- Topic: How to Secure IDs For a MySQL Query
- Replies: 6
- Views: 4503
Re: How to Secure IDs For a MySQL Query
I agree with him, using (int) is a lot simplier yet just as effective, although your method is just as good. I use (int) in most cases as it's easy, simple, and effective (repeating myself ftw!). int is the best, the web host I use has a older version of PHP and doesn't support php_round_half_down,...
- Mon May 16, 2011 8:13 pm
- Forum: Tutorials
- Topic: How to Secure IDs For a MySQL Query
- Replies: 6
- Views: 4503
Re: how to securty primerkey
thanks for your postjacek wrote:thanks for contributing this,
Slight problem though
if
if(is_int($page)){is true, it means that there cant be a + or - in the variable, doesn’t it
either way, another effective method would be to do
$id = (int)$_GET['id'];
and it's nice way
- Mon May 16, 2011 7:39 pm
- Forum: Tutorials
- Topic: How to Secure IDs For a MySQL Query
- Replies: 6
- Views: 4503
How to Secure IDs For a MySQL Query
hi. how are you there this is my first tutorail in this website. les get start; we know the id is primerkey we use in database table to count or to make in order imagen that you want to make a blog and the url is will be like this localhost/blog/index.php?topicid=number like 1 in example for example...