reel_biggy_fish
Members-
Posts
31 -
Joined
-
Last visited
Never
Profile Information
-
Gender
Not Telling
reel_biggy_fish's Achievements
Newbie (1/5)
0
Reputation
-
I have a theme and i cant get the images to display where i want them. i have the documentation on what i need to do but i dont know what i actually have to do. the documentation says i have to change the DOCUMENT_PATH to the sub domain document path the line i know i have to change is: // set document root $doc_root = $_SERVER['DOCUMENT_ROOT']; but i have no idea what i need to do. could someone please help me thanks
-
load data from db into a option box
reel_biggy_fish replied to reel_biggy_fish's topic in PHP Coding Help
no sorry that didnt work unfortunatly -
i have a dropdown menu that displays the options i have in a database. i have this all working in mysqli as i didnt write this part on another website. but i am struggling to convert it back to mysql. the original code is: $query = "SELECT gallery_type_id, gallery_type_desc FROM gallery_type ORDER BY gallery_type_id"; /* run the query */ $result = $dbLink->query($query); /* load the query's results into an array */ $i=1; while($row=$result->fetch_assoc()){ $galleryTypes[$i] = $row; $i++; } $num_results = $result->num_rows; <select name="gallery_type" id="gallery_type"> <option>Please Select an Album <?php for($i = 1; $i < $num_results+1; $i++) { echo "<option value=\"" . $galleryTypes[$i]['gallery_type_id'] . "\">"; echo $galleryTypes[$i]['gallery_type_desc']; echo "</option>\n"; } ?> the code i have got so far: $query1 = "SELECT id, question FROM securtiyq ORDER BY id"; /* run the query */ $result= mysql_query($query1); $row = mysql_fetch_array($result); /* load the query's results into an array */ $i=1; while ($row = mysql_fetch_assoc($result)) { $galleryTypes[$i] = $row; $i++; } $num_results = mysql_num_rows($result); <select name="gallery_type" id="gallery_type"> <option>Please Select A Security Question <?php for($i = 1; $i < $num_results+1; $i++) { echo "<option value=\"" . $galleryTypes[$i]['id'] . "\">"; echo $galleryTypes[$i]['question']; echo "</option>\n"; } ?> </option> </select> the only problem is nothing from the database is displayed in the dropdown box. could someone point out where im going wrong thanks in advance
-
check fields in db and overwrite one
reel_biggy_fish replied to reel_biggy_fish's topic in PHP Coding Help
ohhh okay i understand you. isnt that just $n = $_POST['username']; select question from securityq where usern = $n -
check fields in db and overwrite one
reel_biggy_fish replied to reel_biggy_fish's topic in PHP Coding Help
im sorry youve confused my with that by saying locking the question and answer? -
check fields in db and overwrite one
reel_biggy_fish replied to reel_biggy_fish's topic in PHP Coding Help
ahh okay thanks for clearing that one up. so i presume from all of this i would do ("SELECT * FROM `user` WHERE `question` = '$n'")); run the query, and then display the results in a textbox -
check fields in db and overwrite one
reel_biggy_fish replied to reel_biggy_fish's topic in PHP Coding Help
oh okay i could easily just create a drop down menu and let them select from a wide choice. would this mean when they type their secret question would i have to display their secret question? or could i not have to do that and make sure they remember it? thanks again for your help. i have kinda understanding what i have to do -
check fields in db and overwrite one
reel_biggy_fish replied to reel_biggy_fish's topic in PHP Coding Help
to make life simple could i have a simple question like name of first school and then everyone types in the answer for first school? if i understand correctly i would do an if statement like if (temp_pw == true) { header(www..........) } else {header (home.php) { is that right? -
check fields in db and overwrite one
reel_biggy_fish replied to reel_biggy_fish's topic in PHP Coding Help
ahhh i kinda understand the temp password bit, so when they create a user you create a question and the answer goes into a field in the db and witth the change password bit it doesnt only check the email and username but it checks the security password aswell. the login bit still confuses me how would they know which user to redirect when youve given them a temp password? -
check fields in db and overwrite one
reel_biggy_fish replied to reel_biggy_fish's topic in PHP Coding Help
yer its working for me now thanks . yer i might add a secruity question. would that kinda be like implmenting a captcha? for the temp password i would create a function to create a password, then use UPDATE to update the password but what would i do when they log in? -
check fields in db and overwrite one
reel_biggy_fish replied to reel_biggy_fish's topic in PHP Coding Help
this is my final code. i found out why it wasnt writing to the db because the $_POST['pass1'] which it should have been pass_1 <?php $n=$_POST['uname']; $e=$_POST['email']; $p1 = $_POST['pass_1']; $p2 = $_POST['pass_2']; $referrer = $_SERVER['REFERRER']; //if form submitted if($_SERVER['REQUEST_METHOD'] == "POST"){ //check to see if passwords match if($p1 == $p2){ //db config stuff include('config.php'); //check to see if username and email exists $user_exists = mysql_num_rows(mysql_query("SELECT * FROM `user` WHERE `uname` = '$n' AND `email` = '$e'")); if($user_exists == 1){ //if there is one username and email pair //update the password $update_pass = mysql_query("UPDATE `user` SET `pw` = md5('$p2') WHERE `uname` = '$n' AND `email` = '$e'"); echo "Successfully Updated"; } else { //cannot find 1 username and email pair echo 'Username and Email Pair does not exist. Go back and try again <a href="'.$referrer.'">here</a>'; } } else { //passwords do not match echo 'Passwords Do Not Match Go back and try again <a href="'.$referrer.'">here</a>'; } } ?> <form action="" method="post"> <input type="text" name="uname" id="uname" size="30"> <input type="text" name="email" id="email" size="30"> <input type="password" name="pass_1" /> <input type="password" name="pass_2" /> <input type="hidden" name="submitted" value ="yes" /> <input type="submit" name="submit" value="Change Password" /> </form> what do you suggest to make it more secure? as i should learn to make it better -
check fields in db and overwrite one
reel_biggy_fish replied to reel_biggy_fish's topic in PHP Coding Help
EDIT: i now cant get it to write to my database at all. when the passwords dont match it still says sucsefully updated and i cant work out why -
check fields in db and overwrite one
reel_biggy_fish replied to reel_biggy_fish's topic in PHP Coding Help
it kinda works. but i cant log in. it changes my password but if the fist textbox doesnt match the second it still changes it. the only problem is i cant log in any more update_pass = mysql_query("UPDATE `user` SET pw=md5('$p2') WHERE `uname` = '$n' AND `email` = '$e'"); all ive changed is putting the password into the db using md5. ill attach my login page (please bare in mind its not the best log in page but i now cant log in at all when i update the password [attachment deleted by admin] -
check fields in db and overwrite one
reel_biggy_fish replied to reel_biggy_fish's topic in PHP Coding Help
ill try and break it down for you: a person has forgotten his or her password they enter there username and a contact email address a email is sent to them with a web link to change the password they enter in there username and there orgiinal email address they registered with and the password they want to change twice for security if their username and email address match the ones theyve entered and the passwords all okay write the new password into the db. if username or email dont match show an error, i know at the top of my code i have that bit of php to check if the password textboxes match thats something i need to keep as they need to match to even continue aswell i am using sessions on the pages that need you to be logged in. when i log into my blog it has session start() at the top etc. -
check fields in db and overwrite one
reel_biggy_fish replied to reel_biggy_fish's topic in PHP Coding Help
what would you suggest? this was the way i thought up and thougth it was a good idea. now you got me second guessing. EDIT: i just tried your code you gave me but for some reason no error is given when it searches the db and the username and email dont match