Jump to content

mrtezmo

Member
  • Posts

    7
  • Joined

  • Last visited

  • Days Won

    1

mrtezmo last won the day on March 27 2014

mrtezmo had the most liked content!

mrtezmo's Achievements

Newbie

Newbie (1/14)

1

Reputation

  1. For 8 Hours I was trying to solve this yesterday, been out all day with kids, got back and the first thing i tried worked ! Hoorah ! if ( md5($_POST['current_password'].$Acc->salt)!= $Acc->get_current_passw($_SESSION['the_id'])) The reason as to why it never worked when comparing the two vars that held exactly the same data is beyond me, but I would still like to know if anyone who reads this knows why.
  2. mrtezmo

    Gradient

    Gradients are used to fade one color to another. Linear gradient is where the color fades down the page for example or accross, there are other types such as radial (circular) where it starts in the middle and fades to the edge. You can specify the start and end positions of the gradient, hence the top left and bottom left. You can also use more than two colors and specify multiple start points for each color. The syntax to apply a gradient differs from browser to browser, as in your example webkit(Chrome, Safari) is different from Mozilla (Firefox)but will both produce the same result. I am just a beginner myself and I am sure someone else can clarify this better, if i have a css problem i usually start by looking at css tricks , a very useful website.
  3. This morning I tried: if ('290662176e3fece19eba2b3c1a032ee3' != '290662176e3fece19eba2b3c1a032ee3') And this worked as expected. I did wonder if the problem was due to the single quotes, however removing them with the above example generates a blank page with an error, unlike when using the variables and then my own error is displayed as it should, NOT equal, when they are. Below is the page in question: if (isset($_POST['new_pass_submit'])) { // if any blank then send alert redirect if ($_POST['current_password'] == '' || $_POST['new_passw'] == '' || $_POST['new_passw2'] == '') { if ($_POST['current_password'] = ''){$Temp->set_data('error_current_pass', 'isrequired');} if ($_POST['new_passw'] == ''){$Temp->set_data('error_new_passw', 'isrequired');} if ($_POST['new_passw2'] == ''){$Temp->set_data('error_new_passw2', 'isrequired');} $Temp->set_alert('Please fill in all required fields', 'app_error'); // set data so any fields filled in are displayed, clean first! $Temp->set_data('log_current_pass', $_POST['current_password'], TRUE); $Temp->set_data('log_new_passw', $_POST['new_passw'], TRUE); $Temp->set_data('log_new_passw2', $_POST['new_passw2'], TRUE); // load view and exit $Temp->load('app/views/v_change_pass.php', 'Change Password'); exit(); } if ($_POST['current_password'] != '' || $_POST['new_passw'] != '' || $_POST['new_passw2'] != '') // check all fields are between 8 and 20 chars, if not set alert { /*// set data so any fields filled in are displayed, clean first! $Temp->set_data('log_current_pass', $_POST['current_password'], TRUE); $Temp->set_data('log_new_passw', $_POST['new_passw'], TRUE); $Temp->set_data('log_new_passw2', $_POST['new_passw2'], TRUE);*/ if (strlen($_POST['current_password']) < 8 || strlen($_POST['current_password']) > 20) { $Temp->set_data('error_current_pass', 'isrequired'); // set alert load view and exit $Temp->set_alert( 'Your password must be between 8 and 20 characters long', 'app_error'); $Temp->load('app/views/v_change_pass.php', 'Change Password'); exit(); } if (strlen($_POST['new_passw']) < 8 || strlen($_POST['new_passw']) > 20) { $Temp->set_data('error_new_passw', 'isrequired'); // set alert load view and exit $Temp->set_alert( 'Your password must be between 8 and 20 characters long', 'app_error'); $Temp->load('app/views/v_change_pass.php', 'Change Password'); exit(); } if (strlen($_POST['new_passw2']) < 8 || strlen($_POST['new_passw2']) > 20) { $Temp->set_data('error_new_passw2', 'isrequired'); // set alert load view and exit $Temp->set_alert( 'Your password must be between 8 and 20 characters long', 'app_error'); $Temp->load('app/views/v_change_pass.php', 'Change Password'); exit(); } } // if passwords dont match - (new and confirmed new) if ($_POST['new_passw'] !== $_POST['new_passw2']) { // set errors and alert $Temp->set_data('error_new_passw', 'isrequired'); $Temp->set_data('error_new_passw2', 'isrequired'); $Temp->set_alert('New Password fields do not match!', 'app_error'); // redirect back $Temp->load('app/views/v_change_pass.php', 'Change Password'); exit(); } else { // else everything ok so first check pass in db matches with current pass // so only user can change pass // i did start with a method in the if()which was passed the md5 of post current pass and the user id , /* function check_current_passw($id, $cp) { $dbp = $this->get_current_passw($id); if ($dbp != $cp) { do stuff; } } */ // this method used $Acc->get_current_pass() to get pass from database using the id // this is when problem started, I originally thought that method held the problem so I removed it and added whats below $cp = md5($_POST['current_password'].'1may2013'); //salt added directly - change later $db_cp = $Acc->get_current_passw($_SESSION['the_id']); if ($cp != $db_cp) { // error , passes dont match // set alert, error class, and redirect $Temp->set_data('error_current_pass', 'isrequired'); $Temp->set_alert('Current password is incorrect!<br/>'.$cp.'<br/>'.$db_cp.'', 'app_error'); $Temp->load('app/views/v_change_pass.php', 'Change Password'); } else // passwords match, change password { $Temp->set_data('clean_new_pass', md5($_POST['new_passw'].'1may2013'), TRUE); if($Acc->enter_new_pw($Temp->get_data('clean_new_pass',FALSE), $_SESSION['the_id'])) { //if value changed successfully alert redirect $Temp->set_alert('Password has been changed!'); // clear values //$Temp->set_data('clean_new_pass') = ''; $Temp->load('app/views/v_temp_success.php', 'Change Password'); } else { $Temp->set_data('error_current_pass', 'isrequired'); $Temp->set_alert('Could not update password! Please try later'); $Temp->load('app/views/v_change_pass.php', 'Change Password'); } } } } else { // form not submitted load form view $Temp->load('app/views/v_change_pass.php', 'Change Password'); } This could probably be done a lot better, however I am still learning and this is for a college assignment so please excuse me.
  4. I have been trying to solve this for hours and have ran out of ideas. i have two variables, db_pw holding the hashed value of password from the database and cp which holds the hashed (password plus salt) entered by the user. This is the if statement if ($db_pw != $cp) set alerts:Current password is incorrect! echo vars to check, load view etc else carry on this is the alert I get when the statement runs, i have echoed the two variables Current password is incorrect! database password value : 290662176e3fece19eba2b3c1a032ee3 form password value : 290662176e3fece19eba2b3c1a032ee3 what am i missing ? surely this should return false as the values are equal and hence drop to the else any help would be much appreciated thanks.
  5. Hi Ben Thanks for the reply, the site is not online unfortunately, I am using xampp. I am going to try the cart at college tomorrow in an attempt to rule out the possibility of any browser settings causing this problem, and also seek the advice of friends/tutors. If this does not produce a solution I will send you a zip of the site and dump of database, however I will try to solve this before sending the e-mail as I don't want to give you even more to do, especially at the weekend. I will let you know if I do manage to find the cause, Thanks very much Terrence The problem was being caused by IE security settings being set to high, I never experienced that problem before, but then I only use IE for testing. Terrence
  6. I have followed the PHP Shopping Cart with OOP and MVC video tutorials and am up to the stage of integrating it with paypal. Before doing this I decided to test the site in all browsers as I have made some additions to the code, mainly adding extra pages, such as contact and about, and altering style to fit the site the cart is going into. Everything is fine in Chrome and Firefox yet the cart does not work in IE9. All the links and content display yet the add to cart buttons do not add to cart. I was wondering if anyone else has had a similar problem or knows a possible reason to why this is happening. Thanks in advance for any advice or ideas on the cause of this.
  7. i've learnt more here in a month than the whole of last year at college!

    1. spiralmind

      spiralmind

      Yeah who needs college anymore? The world is changing. :)

  8. mrtezmo

    Styling Cms Login

    I have been following the php cms video tutorials which i purchased recently. I am now at video 20 and have run into issues when trying to style the colorbox login form, it currently takes the index page's css properties. I have spent many hours going over the code and comparing it to the source files but I cannot find any errors, i am currently about to compare the code for the third time. I have also been through the videos twice and cannot see where i have gone wrong and was wondering whether anyone else has had this problem, i am thinking it is something really simple that i'm missing. Thanks in advance for any replys.
×
×
  • Create New...