Skip to content

Commit

Permalink
WIP: opens the good folder
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasRannou committed Dec 1, 2011
1 parent fd926fd commit 17e2cfe
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
6 changes: 6 additions & 0 deletions login.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,15 @@
mysql_select_db("$db_name", $con)or die("cannot select DB");

// username and password sent from form
$myusername=$_POST['username'];
$mypassword=$_POST['password'];
$myemail=$_POST['email'];

// To protect MySQL injection (more detail about MySQL injection)
$myusername = stripslashes($myusername);
$mypassword = stripslashes($mypassword);
$myemail = stripslashes($myemail);
$myusername = mysql_real_escape_string($myusername);
$mypassword = mysql_real_escape_string($mypassword);
$myemail = mysql_real_escape_string($myemail);
$mypassword = md5($mypassword);
Expand All @@ -36,7 +39,10 @@
if($count==1){
// Register $myusername, $mypassword and $myemail and redirect to file "login_success.php"
//$_SESSION["myemail"] = $myemail;
$_SESSION["myemail"] = $myemail;
$_SESSION["myusername"] = $myusername;
session_register("myemail");
session_register("myusername");
header("location:registeredarea.php");
exit;
}
Expand Down
9 changes: 6 additions & 3 deletions registeredarea.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,14 @@
<link href="libs/jqueryFileTree.css" rel="stylesheet" type="text/css" media="screen" />

<script type="text/javascript">
var directory = '../../bank/';
var a = "<?php echo $_SESSION['myemail']; ?>";
var full = String(directory.concat(a));
var full2 = full.concat("/");
$(document).ready( function() {
$('#fileTreeDemo_1').fileTree({ root: '../../bank/', script: 'libs/connectors/jqueryFileTree.php' }, function(file) {
$('#fileTreeDemo_1').fileTree({ root: full2, script: 'libs/connectors/jqueryFileTree.php' }, function(file) {
alert(file)
;})
;});
;}) ;});
</script>

<style>
Expand Down

0 comments on commit 17e2cfe

Please sign in to comment.