Jump to content

jimfog

Members
  • Posts

    1,803
  • Joined

  • Last visited

Everything posted by jimfog

  1. jimfog

    session cookie

    I have 2 more questions.... Am I right to assume that setting the date is useful in the "remember me" feature only? Is there any point using session_start() on the login page of a website....the user has not yet logged in....or it depends the content of the login page?
  2. jimfog

    session cookie

    yes...and the session cookie has a past date by default... Having said the above is there any point when logging out using setcookie() to set an expiry date in the past(for the session cookie)....since it has already a past expiry date.
  3. jimfog

    session cookie

    there is something I do not understand about session cookies....to destroy it we set a past expiry date. By default though when the session cookie is sent to the browser it has a ...1981 expiry date. After a web search I found that this is for preventing caching the response.... So what is going on here?
  4. You are right about the parentheses..they are not needed.
  5. I am facing a very weird situation with a prepared statement....if I run the sql statement in the editor(NEtbeans IDE console I get back a row. The same statement though as a prepared statement returns 0 row...here is the code: if($stmt = $connection->prepare("SELECT name FROM users WHERE registr_hash=(?) AND email=(?)")) { $stmt->bind_param('ss',$hash,$email);//αυτο το έχω αλλάξει για testing..κανονικα ειναι siisii $stmt->execute(); $stmt->store_result(); var_dump($stmt->num_rows);return;//this here returns 0 while it should return 1 if($stmt->errno!==0) { error_log("error message for check_member_status()-execution failed:".$stmt->error."for buser:".$email.",time of error:".date('d F Y h i')." n", 3,"../Administrator/error_log.log"); mail_error($email);return false; } if($stmt->num_rows>0){ // We have a match $result=activate_account($connection,$email,$hash); $stmt->fetch(); $_SESSION['valid_user'] = $email; if($result==true) { if($usertype==='buz_user') {header("Location: buz_member.php?verified=true");} else {} }//$status='O κωδικός σου επιβεβαιώθηκε'; //go to adminmember page }else{ // No match -> invalid url or account has already been activated. $status='<div class="statusmsg">wrong URL or you have already activated your account.</div>'; } } else { error_log("error message for check_member_status()-prepared failed:".$connection->error."for buser:".$email.",time of error:".date('d F Y h i')." n", 3,"../Administrator/error_log.log"); mail_error($email);return false; } What can be wrong? I have checked the syntax of the prepared statement above myriad times.
  6. No....I will keep this code though in the case where ajax does not work.
  7. I want to ajaxify a login form...I suppose serve-side validation must be in the file where the ajax request will be made. Am I correct? Currently I have this code in the same file where the markup is located and it runs upon clicking the submit button.
  8. Can you give an example....
  9. well I need to do some testing before answering...I cannot remember why the code is the way it is.
  10. I do not understand... what does the same thing either way?
  11. I have a javascript function with a conditonal in which I use return false...but I really do not know if the return is of any use in such a case....see the code to understand what I mean; $('.deactivate').click(function(e){//account deletion if(deletestate==0) { if(trimmeddelpass!=="") { //ajax request here } else { $('#delerror').html('message'); return false; } } if(deletestate==1)//to confirm deletion { if(trimmeddelpass!=="") { { //ajax request here } } else { $('#delerror').html('message'); return false; } } }); there are two if/else statements above...in the else bracket there is "return false"...do you think it is redundant?
  12. I suppose you mean 20sec...20min is just unacceptable.
  13. Ok...I have one last question...currently I am in a local environment...and as you said the mail server might be causing the delay. I am just trying to think what will happen in production environment...cause if locally there might be delays am I right to assume that in production things can get much worse?
  14. The only thing that I have installed is Apache....there is not any mail server in it...as far as I can tell. Can you guide me to search somewhere to find the mail server? As far as I can recall I do not remember installing any mail server...only sendmail so that mail() can work. Are you sure mail() requires a mail server to work locally?
  15. How i can verify the existence of this mail server in my system...is it a file somewhere?I am just curious to find out...thanks
  16. are you referring to sendmail?
  17. the application is built locally... as such...there is not any mail server.
  18. I have created a function where it sends a verification mail(using PHP's mail function) whenever the user attempts to change his e-mail. I have noticed that if this function is called with sending of the verification mail pending...(made from a previous call)...the execution is delayed considerably... I am not sure that is the cause of the delay-I just wanted to ask-from your experience,if mail() is called without having finished before sending an email,can this create a bottleneck?
  19. here is what get printed(print_r is used outside of the loop): Array ( [0] => Array ( [service] => haircut [price] => 65.00 [serviceID] => 19 [duration] => 20 ) [price] => 1 [1] => Array ( [service] => μανικιουρ [price] => 70.00 [serviceID] => 20 [duration] => 20 ) ) I think [price] is creating the issue here... So the question becomes how to integrate prices to the array without triggering such a notice.
  20. I am using a prepared statement to bring results from more that 2 tables. One of the tables lists servicenames with prices and duration....each table row corresponds to one service....so: while ($stmt->fetch()) { $serviceslist[]=array('service'=>$servicename,'price'=>$price,'serviceID'=>$serviceID,'duration'=>$duration); } The problem is that I need to fetch some data that reside to another table....regarding if the prices of the services should be visible or not....so I do something like this: while ($stmt->fetch()) { $serviceslist[]=array('service'=>$servicename,'price'=>$price,'serviceID'=>$serviceID,'duration'=>$duration); $serviceslist['prices']=$prices_visibility; } and then to print to the browser: for($i = 0, $size = count($serviceslist); $i < $size; ++$i) {?><input class='services' data-service="<?php {echo $serviceslist[$i]['serviceID'];} ?>" size ='40' value="<?php {echo $serviceslist[$i]['service'];} ?>" type="text" name="<?php echo 'service'.$i ?>"> //line 258 <input class='price' size ='3' value="<?php {echo $serviceslist[$i]['price'];} ?>" type="text" name="<?php echo 'price'.$i ?>"> <input class='duration' size ='3' value="<?php {echo $serviceslist[$i]['duration'];} ?>" type="text" name="<?php echo 'duration'.$i ?>">λεπτά <?php }?> the problem is that I get a warning: <br /><b>Notice</b>: Undefined offset: 2 in <b>C:Apache24htdocsAppointmentsAdministratorprofile.php</b> on line <b>258</b><br /> Obvioulsy adding to the array the prices index creates a problem with the loop...but what that might be?
  21. I have a problem with an input of the textarea type inside a fieldset.... Take a look at this fiddle https://jsfiddle.net/fiddlehunt/3uwr7v2t/ Go to the textarea with the heading few words...adjust the size of the textarea as you like...you will notice that height of the fieldset is adjusted accordingly.... Unfortunately...locally this is not the case....the textarea goes beyond the bottom borders of the fieldset. Furthermore I cannot replicate this effect in jsfiddle. What might be causing this? Go to this location to see what happens locally...see the blue arrow: http://1drv.ms/1IESh1W
  22. Yes that seems to be the solution...thanks
  23. I just made the following thought... Is it maybe better that initial data/state is created with PHP and not JS? JS will be there just for modification with ajax calls? I just what your comment on the above.
  24. I have placed all my code inside a doc ready function. The problem is that until this function runs that markup is "unpainted"...the result is that the user sees for a fraction of a second the unpainted markup(as the HTML is loaded first and then the JS code inside doc.ready)... How I can prevent such effect...I hope you understand what I am talking about.
×
×
  • Create New...