Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar Mark Forums Read
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 06-22-2003, 01:13 PM   #1
nxventures
Confirmed User
 
Join Date: Mar 2003
Posts: 574
php guys -- database query, help!

On my "add user" page I need a query that will check if the login supplied already exists and if it does I need the user to be redirected to signup.php?name=1.

I am going on 40 something hours of no sleep, and I need to get this done, help is very much appreciated. And needed. Thanks a ton to whoever can help!!
__________________
SIG TOO BIG! Maximum 120x60 button and no more than 3 text lines of DEFAULT SIZE and COLOR. Unless your sig is for a GFY top banner sponsor, then you may use a 624x80 instead of a 120x60.
nxventures is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 06-22-2003, 01:35 PM   #2
vending_machine
Confirmed User
 
Join Date: Jun 2002
Location: Seattle
Posts: 1,062
Code:
$DBH = mysql_connect( ... );
mysql_select_db( 'database', $DBH );
$sql = "SELECT username FROM table WHERE username = 'foo'";
$query_result = mysql_query( $sql, $DBH );

if ( mysql_num_rows( $query_result ) hahahaha 1 )
{
      header( "Location: http://" . $_SERVER[ 'HTTP_HOST' ] . "/signup.php?name=1" );
}
vending_machine is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 06-22-2003, 01:50 PM   #3
nxventures
Confirmed User
 
Join Date: Mar 2003
Posts: 574
thats almost exactly what i have, but does the same thing. no go.
__________________
SIG TOO BIG! Maximum 120x60 button and no more than 3 text lines of DEFAULT SIZE and COLOR. Unless your sig is for a GFY top banner sponsor, then you may use a 624x80 instead of a 120x60.
nxventures is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 06-22-2003, 01:52 PM   #4
nxventures
Confirmed User
 
Join Date: Mar 2003
Posts: 574
it just goes through the rest of the actions as if the header redirect doesn't fucking exist.
__________________
SIG TOO BIG! Maximum 120x60 button and no more than 3 text lines of DEFAULT SIZE and COLOR. Unless your sig is for a GFY top banner sponsor, then you may use a 624x80 instead of a 120x60.
nxventures is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 06-22-2003, 02:16 PM   #5
vending_machine
Confirmed User
 
Join Date: Jun 2002
Location: Seattle
Posts: 1,062
Quote:
Originally posted by nxventures
it just goes through the rest of the actions as if the header redirect doesn't fucking exist.
You should exit your code as well (immediately after the header statement):

Code:
exit();
Do you have that? In addition, the header function will not work if you have already sent text to stdout.

Last edited by vending_machine; 06-22-2003 at 02:20 PM..
vending_machine is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 06-22-2003, 02:26 PM   #6
Hansm
Confirmed User
 
Join Date: Jun 2002
Posts: 871
$DBH = mysql_connect( ... );
mysql_select_db( 'database', $DBH );
$sql = "SELECT username FROM table WHERE username = 'foo'";
$query_result = mysql_query( $sql, $DBH );

if ( mysql_num_rows( $query_result ) hahahaha 1 )
{
header( "Location: http://" . $_SERVER[ 'HTTP_HOST' ] . "/signup.php?name=1" );
exit();
}
Hansm is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 06-22-2003, 03:18 PM   #7
nxventures
Confirmed User
 
Join Date: Mar 2003
Posts: 574
I have no idea why I didn't exit my code, I write beautiful code, must be time to catch up on that sleep. Thanks a ton guys, you're fucking great.
__________________
SIG TOO BIG! Maximum 120x60 button and no more than 3 text lines of DEFAULT SIZE and COLOR. Unless your sig is for a GFY top banner sponsor, then you may use a 624x80 instead of a 120x60.
nxventures is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks
Thread Tools



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.