Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
[Help Needed] In checking already exist data in Database
Old 06-14-2009, 10:03 AM [Help Needed] In checking already exist data in Database
Haris's Avatar
Novice Talker

Posts: 11
Name: Ali Haris
Trades: 0
Hello,

I will try to explain this as clearly as I can.

Here is how Database is Designed


Can anyone write a script like this

If 124.195.209.112 already exists, page need to be redirected to loggedin.php else redirect to login.php

Last edited by Haris; 06-14-2009 at 10:04 AM..
Haris is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 06-14-2009, 01:59 PM Re: [Help Needed] In checking already exist data in Database
cbeaudin's Avatar
Extreme Talker

Posts: 158
Name: cbeaudin
Location: Proud to be Canadian
Trades: 1
Probably not the best way to do this as I am not well experienced with PHP but ill try to help, i will assume you know how to connect to the database...

PHP Code:
$ip "124.195.209.112";
$q "SELECT * FROM tablename WHERE ip_address='$ip'";

if (
mysql_numrows(mysql_query($q)) > 0) {
header("Location: loggedin.php");
}
else {
header("Location: login.php");


This however is not a great way of checking if someone is logged in or not. For a complete login system with an explanation of what most of the code does go to:
http://www.evolt.org/node/60384
__________________
- cbeaudin
cbeaudin is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to [Help Needed] In checking already exist data in Database
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 1.26364 seconds with 12 queries