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
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 09-11-2013, 08:52 PM   #1
ls101
Confirmed User
 
ls101's Avatar
 
Industry Role:
Join Date: Nov 2012
Posts: 713
Php Basic Code

Code:
<?php

#host = "localhost";
#user = "root";
#pass = "pass";
#db = "test";

mysql_connect(#host, #user, #pass);
mysql_select_db(#db);

if (isset($_POST['username'])) {
	$username = $_POST['username'];
	$password = $_POST['password'];
	$sql = "SELECT " FROM users WHERE username='".#user."' AND password='".#pass."' LIMIT 1";
	#res = mysql_query($sql);
if (mysql_num_rows(#res) == 1) {
	echo "You have successfully logged in";
	exit();
} else {
	echo"Invalid Log In information. Please return to the previous page.";
	exit();
}
?>

What is wrong with this code? Can't figure it out!
ls101 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-11-2013, 08:54 PM   #2
KillerK
Confirmed User
 
Join Date: May 2008
Posts: 3,406
you are missing }

before the 2nd if
KillerK is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-11-2013, 08:57 PM   #3
Vapid - BANNED FOR LIFE
Barterer
 
Industry Role:
Join Date: Aug 2004
Posts: 4,864
Sql injection has gotten very advanced...
Vapid - BANNED FOR LIFE is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-11-2013, 09:25 PM   #4
freecartoonporn
Confirmed User
 
freecartoonporn's Avatar
 
Industry Role:
Join Date: Jan 2012
Location: NC
Posts: 7,683
Quote:
Originally Posted by ls101 View Post
Code:
<?php

#host = "localhost";
#user = "root";
#pass = "pass";
#db = "test";

mysql_connect(#host, #user, #pass);
mysql_select_db(#db);

if (isset($_POST['username'])) {
	$username = $_POST['username'];
	$password = $_POST['password'];
	$sql = "SELECT " FROM users WHERE username='".#user."' AND password='".#pass."' LIMIT 1";
	#res = mysql_query($sql);
if (mysql_num_rows(#res) == 1) {
	echo "You have successfully logged in";
	exit();
} else {
	echo"Invalid Log In information. Please return to the previous page.";
	exit();
}
?>

What is wrong with this code? Can't figure it out!
shitloads of corrections/improvements can be made....

ref: http://www.w3schools.com/php/func_my...ape_string.asp
freecartoonporn is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-12-2013, 12:17 AM   #5
Paul&John
Confirmed User
 
Paul&John's Avatar
 
Industry Role:
Join Date: Aug 2005
Location: YUROP
Posts: 8,609
why is there #user instead of $user ?
__________________
Use coupon 'pauljohn' for a $1 discount at already super cheap NameSilo!
Anal Webcams | Kinky Trans Cams Live | Hotwife XXX Tube | Get your Proxies here
Paul&John is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-12-2013, 12:20 AM   #6
freecartoonporn
Confirmed User
 
freecartoonporn's Avatar
 
Industry Role:
Join Date: Jan 2012
Location: NC
Posts: 7,683
Quote:
Originally Posted by Paul&John View Post
why is there #user instead of $user ?
i thought its new way of declaring vars in latest php ....
duh.. me
freecartoonporn is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 09-12-2013, 01:44 AM   #7
Paul&John
Confirmed User
 
Paul&John's Avatar
 
Industry Role:
Join Date: Aug 2005
Location: YUROP
Posts: 8,609
Quote:
Originally Posted by freecartoonporn View Post
i thought its new way of declaring vars in latest php ....
duh.. me
it is?
__________________
Use coupon 'pauljohn' for a $1 discount at already super cheap NameSilo!
Anal Webcams | Kinky Trans Cams Live | Hotwife XXX Tube | Get your Proxies here
Paul&John 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



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.