Jump to content

grappy

Members
  • Posts

    39
  • Joined

  • Last visited

Posts posted by grappy

  1. This is the problem:if (($_SESSION['logname'] = $row['acc_un']) && ($_SESSION['443f'] = $row['acc_pw']))You are using assignment, not comparison. You are assigning $_SESSION['logname'] to whatever the value of $row['acc_un'] is, and you are assigning $_SESSION['443f'] to whatever $row['acc_pw'] is. The = operator is for assignment, if you want to compare 2 values you need to use the == operator. Also, an MD5 hash is 32 bytes, not 36.
    i was told 36 :), and i thought it was the other way round, its allways a stupid mistake for me :)
  2. 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 =\

  3. 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.

  4. 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

  5. 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 :)

  6. 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?

  7. 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?

  8. Print the value of $mypath before you call mkdir, what is the directory name you are trying to make?
    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.
  9. <?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

  10. 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

  11. <?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);$mypath= "/$un";mkdir($mypath,0664,TRUE);header ( 'Location: login.php?id=1' );//redirects to the errors}else{header ( 'Location: register.php?id=2' );} }else{header( 'Location: register.php?id=1' );}?>

    and my error is

    Warning: mkdir() [function.mkdir]: Permission denied in /home/lewke/domains/lukegibson.co.uk/public_html/imagegallery/1/registerscript.php on line 46Warning: Cannot modify header information - headers already sent by (output started at /home/lewke/domains/lukegibson.co.uk/public_html/imagegallery/1/registerscript.php:46) in /home/lewke/domains/lukegibson.co.uk/public_html/imagegallery/1/registerscript.php on line 48

    I dont know what the problem is anymore, and neither does my friend mr_Chisol by the seems of it, all directorys needed are set to 755 permissions and it still doesnt work, if some1 could help with it that would be great...

  12. Hi.. First try to look @ ur page source code by view source There is no <td>,<tr> tag completing.. inner table should be in outer table's td try to maintain this.. you will get the things at proper place.. Regards, Vijay
    i use th tags, not td :) and i dont quite understand what u mean, i tryed what i think u mean and it didnt seem to work :S
  13. changing the date format using phpmyadmin on a sql database, atm its 0000-00-00 which is american format i believe, and i want it to uk format which should be 00-00-0000, any1 know how?

  14. $query = "INSERT INTO av_update (`update_name`,`update_date`,`update_title`,`update_c`) VALUES ("&$name","&$date","&$title","&$content")";

    it keeps erroring me on unexpected T_variables on that line lol, any1 know how to fix it?

×
×
  • Create New...