grappy
Members-
Posts
39 -
Joined
-
Last visited
Previous Fields
-
Languages
XHTML, XML, CSS, SQL, PHP(Learning), Javascript (Learning)
Contact Methods
-
Website URL
http://
-
ICQ
0
grappy's Achievements
Newbie (1/7)
0
Reputation
-
add my email etheric_tempest at hotmail dot com
-
well, this is my code. <?phpecho "<table width='800' border='0' cellspacing='0' cellpadding='0' align='center' >\n"."<tr>\n". "<th width='798' colspan='2' height='170'>\n". "<img src='../../banner.png' alt='welcome to the image gallery' width='798' height='170'/></th>\n". "</tr>\n". "<tr>\n". "<th colspan='1' width='160' valign='top' bgcolor='#CCCCCC' height='800'>\n". "<a href='../../index.php' class='navigation'><li class='navigation'>Home</li></a>\n";$con = mysql_connect("localhost","lewke_acc","123456");if (!$con) { die('Could not connect: ' . mysql_error());}//selects databasemysql_select_db("lewke_image", $con);//creates the query including the variables$user = $_SESSION['logname'];$query = "SELECT ('acc_un','acc_pw') FROM accounts WHERE acc_un=.$user.";//sends the query to mysql$result = mysql_query($query);$row = (mysql_fetch_array($result));if (($_SESSION['logname'] = $row['acc_un']) && ($_SESSION['443f'] = $row['acc_pw'])){echo "<a href='/1/".$user."' class='navigation'><li class='navigation'>Logged in as ".$user."</li></a>";}else{echo "<a href='../../login.php' class='navigation'><li class='navigation'>Login</li></a>";}echo "<a href='../../register.php' class='navigation'><li class='navigation'>Register</li></a>\n". "<a href='../../browse.php' class='navigation'><li class='navigation'>Browse</li></a>\n". "<a href='../../contact.php' class='navigation'><li class='navigation'>Contact Us</li></a>\n". "<a href='../../filestypes.php' class='navigation'><li class='navigation'>Image Filetypes</li></a>\n". "<a href='../../terms.php' class='navigation'><li class='navigation'>Terms & Conditions</li></a>\n";//creates the query including the variables$query = "SELECT * FROM accounts WHERE acc_un =.$user.";//sends the query to mysql$result = mysql_query($query);$row = (mysql_fetch_array($result));if (($_SESSION['logname']=$row['acc_un'])&&($_SESSION['443f']=$row['acc_pw'])){ echo "<form class='browse' action='../uploadscript.php'><input name='search' type='file' maxsize='2000000' size='9'/><input name='submit' type='submit' value=' Upload! '/>\n"."<br /><em class='formstext'>Accepted file formats are .JPG, .GIF, .PNG, .BMP, .PSD<br />Files must be no larger than 2MB each</em></form>";}echo "</th>\n". "<th width='638' colspan='1' class='content' valign='top'>\n";print_r ($_SESSION);?> and for some reason the sessions merge after i try $user = $_SESSION['logname']; if i use print_r at the top of the page, they are entirely unmerged, however when i use it at the bottom, this is the output Array ( [logname] => [443f] => 8277e0910d750195b448797616e091ad ) ^37 long which is supposed to be a md5 hash encryption, and in this case d is the login name, with the first 36 being the acutal hash.i have no idea on it =\
-
i thought md5 was 36 characters, that member login key is only 32, perhaps its a randomly generated string by invision power boards in which case u should have access to the source code, meaning u could find where it is generated and submit it to your own personal database at the same time giving you access to it from your own site.
-
rofl, runescape. just ask micheal west, i have him on my msn, he made runehead. u can find him on RSD forums, but good luck with it. cause every1 uses runehead
-
well, i want to create a mailing list from a sql database, it'd be great if someone could tell me what steps to do in order to create such a script, ive looked in a few places and google'd it but to no avail, thanks in advance
-
never mind now i have it working perfectly
-
i changed the code to have a full value off $mypath= "home/lewke/domains/lukegibson.co.uk/public_html/imagegallery/1/" .$un. ""; and now it makes a folder called home where i want it to make one using the $un variable, any other errors in my code possible?
-
well using the print_r i managed to find out what it was printing, using a username of test5 it printed /test5 which is exactly what i wanted it to do, any other ideas?
-
how much data needs to be passed? alot or only a small amount? (in characters)
-
That isnt the problem, im trying to make a directory from the variable so that can not possibly be the problem because the variable is correct.
-
<?php//checks for the fields to be setif ( ( isset($_REQUEST['username']) && isset($_REQUEST['pass1']) && isset($_REQUEST['pass2']) && isset($_REQUEST['email']) && isset($_REQUEST['actype']) && isset($_REQUEST['tc'])) ){//creates the variables to be inserted by getting data from the form$un = $_POST['username'];$p1 = $_POST['pass1'];$p2 = $_POST['pass2'];$email = $_POST['email'];$account = $_POST['actype'];$terms = $_POST['tc'];//checks the passwords matchif ($p1 == $p2){//encrypts the password$pass = md5($p1);//connects to database$con = mysql_connect("localhost","lewke_acc","");if (!$con) { die('Could not connect: ' . mysql_error());}//selects databasemysql_select_db("lewke_image", $con);//creates the query including the variables$query = "INSERT INTO accounts (acc_un,acc_pw,acc_type,acc_email) VALUES ('$un','$pass','$account','$email')";//sends the query to mysqlmysql_query($query);//makes the user their own directory$mypath= "/" .$un. "";mkdir($mypath,0664,TRUE);//redirects to the errorsheader ( 'Location: ../login.php?id=1' );}else{header ( 'Location: ../register.php?id=2' );} }else{header( 'Location: ../register.php?id=1' );}?> and i get the error that permission is denyed, the chmod is set to 777 and the GID is apache (Direct admin), so what could possibly be wrong with the code/server? ive tryed several methods to fix this and none have worked... if some1 could help fix it :$ would be greatful
-
rofl, i totally missed that thanks, its allways a stupid mistake with me
-
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/lewke/domains/lukegibson.co.uk/public_html/imagegallery/loginscript.php on line 23thats the obvious error, and i cant make it work, i had this error before but i was able to fix it, and now i cant fix it again lol <?phpif ( ( isset($_REQUEST['username']) && isset($_REQUEST['password'])) ){$un = $_REQUEST['username'];$pass = $_REQUEST['password'];$p = md5($pass);//connects to database$con = mysql_connect("localhost","lewke_acc","");if (!$con) { die('Could not connect: ' . mysql_error());}//selects databasemysql_select_db("lewke_image", $con);//sends the query to mysql$query = "SELECT * FROM accounts WHERE acc_un ='$un'";$result = ($query);$row = (mysql_fetch_array($result));if ($row['acc_pw'] == $p){header ( 'Location: gallery.php?un=$un' ); }elseheader ( 'Location: login.php?id=2' );}elseheader ( 'Location: login.php?id=2' );?> any help with the problem would be great...since im still learning php