icon Get the most out of Surmunity, read our tips here! Need an interesting blog to read? You've got to read the Surpass Blog! | Welcome! Please register to access all of our features.
Old January 3rd, 2007, 8:14 PM   #10 (permalink)
Surpass Fan
Excelling Contributor
 
Joined in Dec 2005
Lives in my computer
Hosted on pass86'd
660 posts
Gave thanks: 56
Thanked 14 times
ok... I see where you going, but what I am wanting to do is take the index.php?action=www.themaxfiles.info < domain from there and compare it to the database..

I would like to be able to compare what ever domain is added to the end, to the database...

MJ

and as you can see, $action is locked to one domain, I would like to change that to be using any domain compare to the database, and if the domain is there display a 1 and if not a 0.
__________________

panache is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old January 3rd, 2007, 8:48 PM   #11 (permalink)
Surpass Fan
Excelling Contributor
 
cowboy's Avatar
 
Joined in Nov 2005
Lives in Colorado
Hosted on DEDI
937 posts
Gave thanks: 2
Thanked 95 times
You changed your url mid-stream, originally it was ?domain= now it is ?action=. That is the variable name in $_GET[''].

So, if you want to see if the variable is found in the database, one way is:
PHP Code:
<?
connect to 
and select database
 
$compare 
$_GET['action'];
 
$sql "select domain from table where domain='".$compare."'";  // field names equal to your database setup
 
if (mysql_query($sql)) {
    echo 
"it is there in the database.";
} else {
    echo 
"that domain is not in the database.";
}
?>
__________________
Where would you be if you were at the highest court in the land (US)?
cowboy is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
This user thanks cowboy for this great post!
panache (January 3rd, 2007)
Old January 3rd, 2007, 8:52 PM   #12 (permalink)
Surpass Fan
Excelling Contributor
 
cowboy's Avatar
 
Joined in Nov 2005
Lives in Colorado
Hosted on DEDI
937 posts
Gave thanks: 2
Thanked 95 times
Quote:
Originally Posted by Bigjohn View Post
Hey cowboy! Have a bubble bath lately?
New Year's dinner is black-eye peas and ham with sourdough corn bread.
__________________
Where would you be if you were at the highest court in the land (US)?
cowboy is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old January 3rd, 2007, 11:23 PM   #13 (permalink)
Surpass Fan
Excelling Contributor
 
Joined in Dec 2005
Lives in my computer
Hosted on pass86'd
660 posts
Gave thanks: 56
Thanked 14 times
ok I did all that and its still not giving me a true answer..

also I thought that you had to have something to compare the action against the result..

maybe I Am still confused on this..
__________________


Last edited by panache; January 3rd, 2007 at 11:29 PM..
panache is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old January 3rd, 2007, 11:34 PM   #14 (permalink)
Surpass Fan
Excelling Contributor
 
cowboy's Avatar
 
Joined in Nov 2005
Lives in Colorado
Hosted on DEDI
937 posts
Gave thanks: 2
Thanked 95 times
Quote:
Originally Posted by panache View Post
ok I did all that and its still not giving me a true answer..

also I thought that you had to have something to compare the action against the result..

maybe I Am still confused on this..
Let me see your coding and database structure. OK to PM if you wish.
__________________
Where would you be if you were at the highest court in the land (US)?
cowboy is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old January 4th, 2007, 12:00 AM   #15 (permalink)
Surpass Fan
Excelling Contributor
 
Joined in Dec 2005
Lives in my computer
Hosted on pass86'd
660 posts
Gave thanks: 56
Thanked 14 times
ur purple, I'm blue, I dont got that ability..


db is called test on my account..

Code:
CREATE TABLE `hlsremote` (
  `ID` int(9) NOT NULL auto_increment,
  `domain` text NOT NULL,
  `date` timestamp NOT NULL default CURRENT_TIMESTAMP,
  PRIMARY KEY  (`ID`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ;

-- 
-- Dumping data for table `hlsremote`
-- 

INSERT INTO `hlsremote` VALUES (1, 'www.themaxfiles.info', '2007-01-01 00:00:00');
INSERT INTO `hlsremote` VALUES (2, 'www.panacheweb.net', '2007-01-01 00:00:00');

thats what the db structure is

I want to simply compare the the domain in the db with what someone would put at the end of index.php?action=www.themaxfiles.info

I just want it to check the database and see if the domain is in the database..

with your last example, I changed everything as it would say in my db, and I used any number of domains and it came back as those domains where there in the db while infact they were not there...
__________________

panache is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old January 4th, 2007, 1:55 AM   #16 (permalink)
Surpass Fan
Excelling Contributor
 
cowboy's Avatar
 
Joined in Nov 2005
Lives in Colorado
Hosted on DEDI
937 posts
Gave thanks: 2
Thanked 95 times
Sorry to mislead you by not including the array extraction statement. This example does work (tested).

PHP Code:
<?
$link 
mysql_connect('localhost''db_username''db_password');
$db_selected mysql_select_db('yourusername_test'$link);
 
$compare $_GET['action'];
 
$sql "select domain from hlsremote where domain='".$compare."'";
 
$result mysql_fetch_array(mysql_query($sql));
 
if (
$result['domain'] == $compare) {
    echo 
"it is there in the database.";
} else {
    echo 
"that domain is not in the database.";
}
?>
__________________
Where would you be if you were at the highest court in the land (US)?
cowboy is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
This user thanks cowboy for this great post!
panache (January 4th, 2007)
Old January 4th, 2007, 2:49 AM   #17 (permalink)
Surpass Fan
Excelling Contributor
 
Joined in Dec 2005
Lives in my computer
Hosted on pass86'd
660 posts
Gave thanks: 56
Thanked 14 times
ok I ran this against the data that I have... but the else is not proving a negative, its only showing a positive... thats where I am having the issue.. if I put a domain in thats not in my db its showing a positive result...

if this equals this then say this else say that... its not saying that, its still saying this... the else part is not working for some reason..
__________________

panache is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old January 4th, 2007, 8:25 AM   #18 (permalink)
Surpass Fan
Excelling Contributor
 
cowboy's Avatar
 
Joined in Nov 2005
Lives in Colorado
Hosted on DEDI
937 posts
Gave thanks: 2
Thanked 95 times
Quote:
Originally Posted by panache View Post
ok I ran this against the data that I have... but the else is not proving a negative, its only showing a positive... thats where I am having the issue.. if I put a domain in thats not in my db its showing a positive result...

if this equals this then say this else say that... its not saying that, its still saying this... the else part is not working for some reason..
You can try the script here: http://simple2say.com/test.php?actio...panacheweb.net
__________________
Where would you be if you were at the highest court in the land (US)?
cowboy is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

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

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