Click here to Skip to main content
15,890,845 members
Home / Discussions / Linux, Apache, MySQL, PHP
   

Linux, Apache, MySQL, PHP

 
Questionlogin script returns blank page Pin
komanche10-Sep-11 2:05
komanche10-Sep-11 2:05 
AnswerRe: login script returns blank page Pin
Gerben Jongerius10-Sep-11 3:56
Gerben Jongerius10-Sep-11 3:56 
GeneralRe: login script returns blank page Pin
komanche12-Sep-11 1:42
komanche12-Sep-11 1:42 
AnswerRe: login script returns blank page Pin
Vasudevan Deepak Kumar10-Sep-11 12:57
Vasudevan Deepak Kumar10-Sep-11 12:57 
AnswerRe: login script returns blank page Pin
Marc Firth12-Sep-11 2:10
Marc Firth12-Sep-11 2:10 
GeneralRe: login script returns blank page Pin
komanche15-Sep-11 2:29
komanche15-Sep-11 2:29 
GeneralRe: login script returns blank page Pin
Marc Firth15-Sep-11 2:50
Marc Firth15-Sep-11 2:50 
GeneralRe: login script returns blank page Pin
Marc Firth15-Sep-11 3:22
Marc Firth15-Sep-11 3:22 
This works (tested):

PHP
<?php
session_start();
mysql_connect('localhost', 'user', 'pass');
mysql_select_db('dbname');
if (isset($_POST['username']) && isset($_POST['password'])) {
	$username = $_POST['username'];
	$password = sha1($_POST['password']);
				
	if (!empty($username) && !empty($password)) {
		$query_run = mysql_query("SELECT id, password FROM users WHERE username = '$username' AND password = '$password' LIMIT 1");
							
		if (mysql_num_rows($query_run) == 0) {
			echo 'Invalid username / password combination';
		} else {
			echo 'Ok.';
		}
			
	} else {
		echo 'You must supply a username and password.';
	}
}
?>

<form action="" method="post">
 <label>Username:</label>
 <input type="text" name="username" size="10" value="<?php echo htmlentities("$username"); ?>" />

 <label>Password:</label>
 <input type="password" name="password" size="10" value="<?php echo htmlentities("$password"); ?>" />

 <input type="submit" name="login" value="Log In" />
 <input type="submit" name="join" value="Join" />
</form>


GeneralRe: login script returns blank page Pin
komanche17-Sep-11 3:08
komanche17-Sep-11 3:08 
QuestionOpenConnect fails with SSL connection failed Pin
Vasudevan Deepak Kumar9-Sep-11 6:20
Vasudevan Deepak Kumar9-Sep-11 6:20 
QuestionAnyone aware to make Google Unicode (Tamil/Hindi) fonts appear in Ubuntu Linux Pin
Vasudevan Deepak Kumar9-Sep-11 6:19
Vasudevan Deepak Kumar9-Sep-11 6:19 
AnswerRe: Anyone aware to make Google Unicode (Tamil/Hindi) fonts appear in Ubuntu Linux Pin
Bernhard Hiller12-Sep-11 22:17
Bernhard Hiller12-Sep-11 22:17 
GeneralRe: Anyone aware to make Google Unicode (Tamil/Hindi) fonts appear in Ubuntu Linux Pin
Vasudevan Deepak Kumar13-Sep-11 7:46
Vasudevan Deepak Kumar13-Sep-11 7:46 
GeneralRe: Anyone aware to make Google Unicode (Tamil/Hindi) fonts appear in Ubuntu Linux Pin
N a v a n e e t h7-Oct-11 0:57
N a v a n e e t h7-Oct-11 0:57 
QuestionAny tips to prune down the unwanted services in Ubuntu 11.04 for a classic simple desktop Pin
Vasudevan Deepak Kumar9-Sep-11 5:47
Vasudevan Deepak Kumar9-Sep-11 5:47 
AnswerRe: Any tips to prune down the unwanted services in Ubuntu 11.04 for a classic simple desktop Pin
N a v a n e e t h7-Oct-11 0:59
N a v a n e e t h7-Oct-11 0:59 
AnswerRe: Any tips to prune down the unwanted services in Ubuntu 11.04 for a classic simple desktop Pin
LloydA1117-Nov-11 13:46
LloydA1117-Nov-11 13:46 
QuestionCalling ASP page in PHP page Pin
sarang_k8-Sep-11 3:23
sarang_k8-Sep-11 3:23 
AnswerRe: Calling ASP page in PHP page Pin
cjoki8-Sep-11 5:32
cjoki8-Sep-11 5:32 
AnswerRe: Calling ASP page in PHP page Pin
Vasudevan Deepak Kumar10-Sep-11 12:58
Vasudevan Deepak Kumar10-Sep-11 12:58 
AnswerRe: Calling ASP page in PHP page Pin
Shah Rizal13-Sep-11 21:19
Shah Rizal13-Sep-11 21:19 
AnswerRe: Calling ASP page in PHP page Pin
headspring16-Sep-11 21:51
headspring16-Sep-11 21:51 
QuestionLinux GUI Programming [modified] Pin
Iranian MM7-Sep-11 9:11
Iranian MM7-Sep-11 9:11 
AnswerRe: Linux GUI Programming Pin
hansoctantan9-Sep-11 21:57
professionalhansoctantan9-Sep-11 21:57 
GeneralRe: Linux GUI Programming Pin
Iranian MM9-Sep-11 23:13
Iranian MM9-Sep-11 23:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.