Jump to content

White_Lily

Members
  • Posts

    531
  • Joined

  • Last visited

  • Days Won

    1

White_Lily last won the day on November 1 2012

White_Lily had the most liked content!

About White_Lily

  • Birthday 12/28/1991

Profile Information

  • Gender
    Female

White_Lily's Achievements

Regular Member

Regular Member (3/5)

16

Reputation

  1. I know the security risks of this script, however it is just what he wanted. Also, your answer still doesn't explain why the update code does not update the database. You mentioned sanitizing the inputs - which I am doing...: function testStr($type, $string){ switch($type){ case "empty": if(strlen($string) == 0 || $string == NULL){return false;} else{return true;} break; case "clean": $string = strip_tags($string); $string = mysql_real_escape_string($string); return $string; break; } } Now, in any of the code that is posted, is there anything there that would be the cause of the database not being updated?
  2. Remember the issue is that it doesn't update the database... but returns no errors? Thanks for all your help!
  3. Here is the PHP code that processing the password recovery... <?php include("../../config.php"); if(isset($_POST)){ $error = array(); if(testStr("empty", $_POST["email"])){ $email = testStr("clean", $_POST["email"]); $check = mysql_select("users", "", "email = '{$email}'", NULL, 1); if(!mysql_num_rows($check)){$error[] = "That email address does not exist.";} }else{$error[] = "Please enter your email address.";} if(count($error) == 0){ $headers = "From: ".config('email/name')." ".config('email/address')."\r\n"; $headers.= "MIME-Version: 1.0\r\n"; $headers.= "Content-Type: text/html; charset=ISO-8859-1\r\n"; $pass = makePassword(15); $salt = salt(); $password = encrypt($pass, $salt); $htmlMessage = " <html> <body> <h2>Password Recovery for Ed's Login System</h2> <p>Hi, you requested a password change. Below you will find your new password.<br /> Once you have logged in, you will be prompted to change it again, this time - remember it!</p> <p><strong>Your New Password:</strong> {$pass}</p> </body> </html> "; if(mail($email, "Password Recovery", $htmlMessage, $headers)){ $update = mysql_update("users", array("password", "salt", "p_prompt"), array($password, $salt, 1), "email = '".$_POST["email"]."'"); if($update && count($error) == 0){ echo json_encode(array("success" => true, "message" => "Password has been changed successfully, check your email for your new password.")); }else{$error[] = "Failed to update password.";} }else{$error[] = "Something went wrong creating your password.";} } if(count($error) > 0){ echo json_encode(array("success" => false,"error" => $error)); } } ?>
  4. Here is the ajax code... jQuery(function($){ $("button#recovery").on("click", function(){ $.post("javascript/ajax/recovery.php", $("form").serializeArray(), function(data){ console.log(data); if(data.success){ $("div#error").addClass("pass").html("<p>" + data.message + "</p><br /><a href='login.php'>Login</a>"); }else{ var errorMsg = ""; for(i=0;i<data.error.length;i++){ errorMsg += "<p>" + data.error[i] + "</p>"; } $("div#error").addClass("fail").html(errorMsg); } }, "json"); }); });
  5. Hi, I have been asked by a friend to create a login system for him to use and it requires a password recovery page, and to have all the PHP processing code to be done with AJAX to avoid page 'refreshes', which is fine... However, on the password recovery page, you enter your email address... and nothing happens, it checks the email address is there and that it is a registered email address, but when it comes to updating the database with a new password... it comes up with nothing, no PHP errors, no MySQL errors, and no javascript errors... Here is the update function (no comments on the mysql method... I know it is deprecated, just his choice!)... function mysql_update($table, $columns, $values, $where) { $set = array(); for($up=0;$up<count($columns);$up++){ $set[] = "{$columns[$up]} = '{$values[$up]}'"; } $query = "UPDATE {$table} SET ".implode(",", $set)." WHERE {$where}"; return mysql_query($query); }
  6. I wouldn't say this is a CSS issue as such. I am using the value "100vh" in a height property on my portfolio and noticed that this value does not work in Safari. It then that I noticed that Apple has dropped support for Windows in their Safari software, so does this mean that it is recommended websites should drop support for Safari 5.1? What are peoples thoughts on this subject? The only reason I am asking is I need my portfolio to be up and running in the next few months, but I don't want to waste time finding "fixes" when it just isn't worth it! Any opinions and help on this matter are greatly appreciated!
  7. Thank you for this, it really helped!!
  8. Hi, I currently have a client that wants a custom CMS built onto their website. I have built the typical CMS that lets you edit pretty much everything on the site (even the design!). However he wants to take it 1 step further and be able to control his SEO trough his CMS rather than have to log into many different websites. So for example he wants to be able to see his Google Analytics from within his website, rather than go to the Google Analytics website and use it there. Is there a way to do any of this? I don't believe he got this idea by himself as such, I think he was looking at other CMS' because he provided a couple of links to CMS' that apparently have "SEO Built-in". For example: http://www.lightcms.com/ Any ideas and help would be appreciated.
  9. Thank you Barand, it was the credentials for the IP - the client gave us the wrong username and password.
  10. Hi, I am currently trying to build an Artist's website, the artist wanted a CMS that was completely customized to the site (so no Wordpress, Joomla, Drupel, etc) - because of this I am having to create a CMS completely from scratch. The problem I am having is with the database connection (hence the topic title), other sites that I have built with this same code work fine - however this particular site does not seem to want to play ball. It keeps giving me this error: SQLSTATE[HY000] [1045] Access denied for user 'web113-janesart'@'10.0.44.113' (using password: YES) I have tried obvious things such as spelling mistakes, wrong password/username/db name, nothing seems to get rid of this error. Any help on what else this could be would be appreciated.
  11. Never mind I have found out why they are not working.
  12. Hi, I have been asked to check some 301 redirects for a site we have recently built. I have run into a problem with this set: redirect 301 /contact-diverse-cleaning-company.php "http://www.deep-cleaning.com/contact-us" redirect 301 /cleaning-services/kitchen-floor-deep-cleaning.php "http://www.deep-cleaning.com/page/Kitchen%20Deep%20Cleaning" redirect 301 /domestic-commercial-cleaning-quote.php "http://www.deep-cleaning.com/page/Commercial%20and%20Private%20Sector" redirect 301 /cleaning-services/index.php "http://www.deep-cleaning.com/" redirect 301 /cleaning-services/high-level-cleaning.php "http://www.deep-cleaning.com/page/High%20Level%20Deep%20Cleaning" redirect 301 /cleaning-services/ventilation-system-cleaning.php "http://www.deep-cleaning.com/page/Ventilation%20System%20Deep%20Cleaning" redirect 301 /cleaning-customer-testimonials.php "http://www.deep-cleaning.com/testimonials" redirect 301 /cleaning-services/ "http://www.deep-cleaning.com/" redirect 301 /cleaning-services/daily-cleaning.php "http://www.deep-cleaning.com/" redirect 301 /cleaning-services/domestic-property-cleaning.php "http://www.deep-cleaning.com/" it appears that all the redirects that begin with "/cleaning-services/" dont work, the other 3 do work. any suggestions?
  13. is the search terms stored in a session or is the whole ting powered by javascript?
  14. On your company website, look at the code for the two buttons that say "Request a call back" and "Get a quote today", they use the css you will need to get your problem sorted.
  15. I have been asked to produce code that make a banner fade through a set of images, but in between fading the images need to slide a little bit. I have produced this: <script type="text/javascript"> $("#banner-images > img:eq(0)").show(); var box_height = 249, img_height = $("#banner-images > img:eq(0)").outerHeight(true), calc_bottom = ((img_height - box_height) - 30); $("#banner-caption").html($("#banner-images > img:eq(0)").attr("title")); $("#banner-images > img:eq(0)").animate({bottom: "-" + calc_bottom + "px"}, 5000); setInterval(function(){ $("#banner-images > img:eq(0)").fadeOut(1000); $("#banner-images > img:eq(0)").appendTo("#banner-images"); $("#banner-images > img:eq(0)").fadeIn(1000, function(){ $("#banner-caption").html($(this).attr("title")); var img_height = $(this).outerHeight(true), calc_bottom = ((img_height - box_height) - 30); $("#banner-images > img").css({bottom: "0px"}); $(this).animate({bottom: "-" + calc_bottom + "px"}, 4000); }); }, 5000); </script> The problem I have is that when you first go onto the page, the first image slides down fine, and then the rest follows suit. However if you click the refresh button on your browser ( or hit F5 ) the code seems to skip the animation of the first image completely and just straight into the second image. Any ideas as to why this is, and how to fix it would be much appreciated.
×
×
  • 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.