Jump to content

Wylderose

New Members
  • Posts

    4
  • Joined

  • Last visited

    Never

Everything posted by Wylderose

  1. Well, I thought I was onto something. Took your suggestion PFMa and included the $_POST in the very first php to run upon getting the password and login from the user. I put in: $pass = $_POST['pass']; $login = $_POST['login']; at the beginning with an echo to make sure information was being taken from the forum, success on that. Password and Login were being taken (step one). Was thinking for the menu section (step two) do the same, put those $_POST in and I'd be golden. But of course not. The information of the password and login is not being passed to the next section that below to get to the menu now. I am still getting the No password provided. I put in the echo to see if information was being collected and sure enough I'm not getting the passward or login that was collected from the login - step one. Now it is down to no information being sent onward, still tinkering away at it, but that now has me stumped. Thanks again for the help. <?PHP $pass = $_POST['pass']; $login = $_POST['login']; $id = $_POST['ID']; echo "ID is $id. Password is $pass. login is $login.<br>"; if( !isset($pass) ){ die("No password provided"); } if( $pass == "" ){ die("No password provided"); } $sql = "SELECT * FROM stlogin WHERE id='$ID'"; mysql_connect("localhost", "USERNAME", "PASSWORD"); $rs = mysql_db_query("primevil_database",$sql); while ($row = mysql_fetch_object($rs)){ $password1 = $row->pass; $login = $row->login; $access = $row->access; } if( $password1 == $pass ){ } else{ die("Password not matched"); } ?> <HTML> <HEAD> <TITLE>ST Tools Menu</TITLE> </HEAD> <BODY bgcolor="#000000" text="#FFFFFF"> <?PHP if($access >= 2){ echo "Welcome $login. <BR>"; } if($access == 3){ echo "<strong><font color=\"#FF0000\">ST Level Access</font></strong><BR>"; } if($access == 2){ echo "<strong><font color=\"#FF0000\">Assistant ST Level Access</font></strong><BR>"; } if($access == 4){ echo "<strong><font color=\"#FF0000\">Admin Level Access</font></strong><BR><a href=\"deletechar.php?ID=$ID&pass=$pass\">Delete Character.</a><br>"; } if($access == 3 | $access == 4){ echo "<a href=\"editchar.php?ID=$ID&pass=$pass\">Edit Character.</a><br>"; } if($access == 2 | $access == 3 | $access == 4){ echo "<a href=\"searchchar.php?ID=$ID&pass=$pass\">Search Character.</a><br><a href=\"viewchar.php?ID=$ID&pass=$pass\">View Character.</a>"; } ?> </BODY> </HTML>
  2. I've been still working on this and no solution, I've been looking up the $_Post and $_Get commands, but not exactly sure how to use them in the code provided below or how to rewrite the code to make it safe and do what it is expected to do. I am using the method = post in the form. I think once I figure out how to fix this, I should be golden to fix the code for the other forms used on my site. Thanks again for the aid! <?PHP if( !isset($pass) ){ die("No password provided"); } if( $pass == "" ){ die("No password provided"); } $sql = "SELECT * FROM stlogin WHERE id='$ID'"; mysql_connect("localhost", "USERNAME", "PASSWORD"); $rs = mysql_db_query("primevil_database",$sql); while ($row = mysql_fetch_object($rs)){ $password1 = $row->pass; $login = $row->login; $access = $row->access; } if( $password1 == $pass ){ } else{ die("Password not matched"); } ?> <HTML> <HEAD> <TITLE>ST Tools Menu</TITLE> </HEAD> <BODY bgcolor="#000000" text="#FFFFFF"> <?PHP if($access >= 2){ echo "Welcome $login. <BR>"; } if($access == 3){ echo "<strong><font color=\"#FF0000\">ST Level Access</font></strong><BR>"; } if($access == 2){ echo "<strong><font color=\"#FF0000\">Assistant ST Level Access</font></strong><BR>"; } if($access == 4){ echo "<strong><font color=\"#FF0000\">Admin Level Access</font></strong><BR><a href=\"deletechar.php?ID=$ID&pass=$pass\">Delete Character.</a><br>"; } if($access == 3 | $access == 4){ echo "<a href=\"editchar.php?ID=$ID&pass=$pass\">Edit Character.</a><br>"; } if($access == 2 | $access == 3 | $access == 4){ echo "<a href=\"searchchar.php?ID=$ID&pass=$pass\">Search Character.</a><br><a href=\"viewchar.php?ID=$ID&pass=$pass\">View Character.</a>"; } ?> </BODY> </HTML>
  3. @Radar -- I'll try that first suggestion, see if that makes things work. As for your second inquiry, once again I can only point you off towards another set of PHP code that was set up for me. The person who wrote this out was not very good at leaving behind comments in the code, no matter how many times we asked. The ID was defined in this code, and in the database there is an id field. <?PHP $sql = "SELECT * FROM stlogin WHERE login='$login'"; mysql_connect("localhost", "USERNAME", "PASSWORD"); $rs = mysql_db_query("primevil_database",$sql); while ($row = mysql_fetch_object($rs)) { $id = $row->id; $password = $row->pass; } if($pass == $password) { echo "<meta http-equiv=\"refresh\" content=\"5;URL=menu.php?ID=$id&pass=$password\">"; } ?> </head> <body bgcolor="#000000" text="#FFFFFF"> <?PHP if($pass == $password){ echo "Login Success. Forwarding to tools..."; } else{ echo "Login Failed."; } ?> @kenrbnsn -- The form code is as follow, its a small snippet, I was wondering if that was the case. My webprovider around the beginning of the year, now that you mentioned it, did go through some upgrades and that was about the same time in which all the coding I had set up for me started to fail one after the other. HTML Code below for the Login/Password: Please enter your login and password. <form action="dologin.php" method="post" name="login"> Login: <input name="login" type="text"><br> Password: <input name="pass" type="password"><br> <input name="submit" type="submit" value="Login"></form> @dolrichfortich -- Feel cheeky, but erm, I'm not certain about this php.ini. I have a control panel that I have access to via my webhost provided, it in turns give me acces to phpMyAdmin and MySQL Database, other than that in this regards, I don't handle much of the hands on with all provided. That's left up to my web providers. After the warning, thank you will not mess with that register. Rather fix the code than have my sites hacked! Thank you so much for the help!
  4. Hello, there I'm new at the PHP/MySql matter and so the code I'm going to bring up that I'm having trouble with was written by someone else for me a number of years ago. It worked just fine until recently and I'm not sure why it just up and stopped working. Nothing has changed, the database that this code is connected to is still very much the same. The problem I am having is trying to login via the Login name and Password. As I said before this code worked just fine up to a few days ago and the person that wrote this out for me has long since disappeared into the ether and I would really love to get this back up and working again, I just don't know where to begin. Now the problem, once from the login it gets me far enough to the "Login Success. Forwarding to tools..." that takes all who have access to tools to this next stage and that's when the trouble hit, with the information in and it sits and then come back "No password provided" so its basically not gettting the information from the database itself. Or something. So yes, if someone see something small, or an update in code or something, would be great. Otherwise... just have to give up on this. Be my luck the other PHP code that I have for the other various things - I run an online Roleplaying site requires people to submit character sheets, then to be able to view sheets, edit certain part of the sheets and this particular project is for the Storytellers to update those sheets - has decided to say um, I'm done working now. My webprovider offers the following if this is needed information wise: MySQL version 5.0.90-community PHP version 5.2.13 Thanks much for taking the moment to look this over, I'll try to provide as much detail I can if anyone post any further inquiry on this odd problem of mines. <?PHP if( !isset($pass) ){ die("No password provided"); } if( $pass == "" ){ die("No password provided"); } $sql = "SELECT * FROM stlogin WHERE id='$ID'"; mysql_connect("localhost", "USERNAME", "PASSWORD"); $rs = mysql_db_query("primevil_database",$sql); while ($row = mysql_fetch_object($rs)){ $password1 = $row->pass; $login = $row->login; $access = $row->access; } if( $password1 == $pass ){ } else{ die("Password not matched"); } ?> <?PHP if($access >= 2){ echo "Welcome $login. <BR>"; } if($access == 3){ echo "<strong><font color=\"#FF0000\">ST Level Access</font></strong><BR>"; } if($access == 2){ echo "<strong><font color=\"#FF0000\">Assistant ST Level Access</font></strong><BR>"; } if($access == 4){ echo "<strong><font color=\"#FF0000\">Admin Level Access</font></strong><BR><a href=\"deletechar.php?ID=$ID&pass=$pass\">Delete Character.</a><br>"; } if($access == 3 | $access == 4){ echo "<a href=\"editchar.php?ID=$ID&pass=$pass\">Edit Character.</a><br>"; } if($access == 2 | $access == 3 | $access == 4){ echo "<a href=\"searchchar.php?ID=$ID&pass=$pass\">Search Character.</a><br><a href=\"viewchar.php?ID=$ID&pass=$pass\">View Character.</a>"; } ?>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.