Jump to content

jimfog

Members
  • Posts

    1,803
  • Joined

  • Last visited

Posts posted by jimfog

  1. well...it seems the code is correct but something else is wrong.For testing I tried this: $(".edit1").click(function() { $(this).parent().css("background-color", "yellow") }); And it works the fieldset element DOES get a yellow background.So there os nothing wrong targeting the element I want. So far in order to make the element expand and show the input fields for editing I use PHP conditinalsmeaning, if edit icon clicked(GET variable) expand the fieldset element. Do you think that this INTERFERES somehow with the js code...and that I should do it solely on js:Place a hidden attribute in the fieldset element and just use js show to expand it.

  2. ....you may need to cancel the event to stop the link from getting the click event.
    What do you mean here. can you explain it a little? Furthermore I changed the code to this to see what will happen:
    $(".edit1").click(function()	    {//		    alert('hi');		    this.parentNode.getElementsByTagName("fieldset")[0].addclass("appear");		   	    });

    And I get a typeError. Specifically:I get the message(on the developers error console) "Cannot call method "addclass" of undefined.

  3. Ι tried this code but it did not work:

    $(".edit1").click = displayFieldset;

    Here is the html:

    <div class="edit1">    <a href="http://localhost/Appointments/Administrator/profile.php?editpersonal">	    <img  src="Images/editpen.png"></a>			 </div>

  4. Ι solved the issue-I did not need to install something else.I just set sendmail_path = in php.ini No error messages...The problem now is that I do not get the e-mail. In this case, the sender e-mail and destination e-mail is the same. It is the e-mail my ISP has given me.Any ideas what might be wrong.

  5. the strange is that I cannot even find the directories you are mentioning on my php installation. I really do not know what to assume. These dirs you are mentioning...there are ONLY found if sendmail is installed?Or they are there either way?

  6. When I put data into the db I always use the real_escape_string function for security purposes. Is there a need to do something similar when I SELECT data from the db? Are there any security issues to consider in the above scenario?

  7. I have made a form where upon clicking the edit button input element appear so that the user can change his data. Very common, like facebook's edit page example. The problem is how am I going to do it. certainly it is a click event targeting the specific edit element. This form has 6 such parts. It is impractical I think writing more or less that same thing 6 times. Such a form which is separated in fieldssets you can also find in the settings page of the new MySpace-this is exactly how I want to do it.

  8. Sendmail is not on your server? Have you checked the include path?
    Where is the include path? The only "include path" I know is the folder in the Netbeans IDE folder structure related to the project I am currently working.This is the ONLY include path i know.
  9. I am trying to use the mail function to send a mail-all done in localhost environment. So. in essence I am attempting to send a mail to my self. But on calling the mail function I got this error:

    Warning: mail(): "sendmail_from" not set in php.ini or custom "From:" header missing in C:\Apache24\htdocs\Appointments\Administrator\admin_db_code.php on line 110

    What is going on here.C:\Apache24\htdocs\Appointments\Administrator\admin_db_code.php on line 110 is the path of the file where the mailfunction is called...as you see...specifically it is at line 110.

  10. I have a form with 3 fields and when this is filled and the user pressesthe submit button a function is called which makes the checks and returns an array of them. You can see the function here:http://w3schools.invisionzone.com/index.php?showtopic=47281&hl=&fromsearch=1 How can I do it that the errors(if the checks fail) appear in specific points(aside the input elements) of the form and all these using a foreach loop-here is what I mean:

     $passerrors=update_password($_POST,$_SESSION['valid_user']);foreach ($passerrors as $k => $error) {					  ?>  <label class="label" for="current">current</label><?php echo  $error ?>						  <input class="service" size="40"  type="text" name="current"><br>						  <label class="label" for="new">new</label>						  <input class="price" size="3"type="text" name="new"><br>						  <label class="label" for="retyped">retyped</label>						  <input class="price" size="3"type="text" name="retypednew"><br>		 						  <?php 					  }?>

    The goal is that each input element is tied to the specific(own) error returned from the foreach loop

  11. You THINK you are returning an array with the value of $passerrors. That would look like this:
    return $passerrors;

    What you are actually returning is the RESULT of an assignment:

    return $passerrors['nopassindb']='........'

    Since the result of a simple assignment is the value being assigned, you are actually returning '........', which of course cannot be passed on to foreach.

    WHat you say is verified by the fact that I used is_array to make some testing and the result was what was returned was not an array-as you say.hm...ok how to fix it?
  12. I am using a function that goes updating the password of the user with all the relevant checks in it:

    function update_password($post,$email)    {	   global $conn;	   $passerrors=array();	   $current=mysql_real_escape_string($_POST['current']);	   $new=mysql_real_escape_string($_POST['new']);	   $retypednew=mysql_real_escape_string($_POST['retypednew']); 	  	  	  	   if($new!=$retypednew)		 {return $passerrors['notsame']='.........';}	   if(check_passwd($new)==false)		 {return $passerrors['smallpass']='............';}				   $conn->set_charset("utf8");		   $result = $conn->query('select password							    from credentials							    where email="'. $email.'"');		  		   if(!$result){		 throw new Exception('............');		 return false;		  }	    elseif( $result ->num_rows<0)		  {		  return $passerrors['nopassindb']='........';		  }		  else		  {echo 'thank you';}	  	      }

    Above, you will not find the update query because I am doing some testing first. The problem is this. I pass the function to a variable and the use a foreach loop to echo if any errors were found:

      $passerrors=update_password($_POST,$_SESSION['valid_user']);				    var_dump( $passerrors);                     foreach ($passerrors as $error) {					   echo $error;					  				   }

    I get this message:

    Warning: Invalid argument supplied for foreach() in C:\Apache24\htdocs\Appointments\Administrator\profile.php on line 440

    The weird is that var_dump DOES output the error founds in the function(for example in the case were the supplied password is below 6 characters). What can be wrong here?

  13. I suppose that if a user wants to change his password. it is always best practice to ask for old one, check with the db that indeed he has provided the old one and send a confirmation e-mail in order to finish the process. Is there something else to know about the change password procedure?

  14. You need to generate the password hash the same way every time. When they register you're basically creating a random salt, and hashing the password plus the salt. When you're checking on login you're using a different salt, you're using the hashed password instead of the random salt. You should save the salt in the database so that you can use the same one to compare with later.
    Does that mean that every time the user login a different password is created in the database?Password+newsalt=new password stored in db
  15. here is an alternative query I run:

    update busines_users,credentials				set phone='6973999099',email='john@yahoo.com'				where( select credentials.crID from credentials				where email='foryou1911@gmail.com');

    I get though the following error message: Error code 1093, SQL state HY000: You can't specify target table 'busines_users' for update in FROM clause I tried this also:

    update busines_users,credentials								    set phone="'.$phone.'",email="'.$emailnew.'"								    where busines_users.crID=credentials.crID								    and credentials.email='' '$email' ";

    Other errors appeared,worst than the case above-the whole page script is ruined. In general, it seems that I cannot update the e-mail and the same time use it i the where clause.

  16. If CrID is primary key , you can use that alone to determine unique user in your update query.
    I must stress, that phone and e-mail are in different tables....in order to use crID to determine unique user I must reach to itwith the e-mail...(so using the e-mail is inevitable)unless you have something else in your mind
    In your code $email will be same for the new one and stored one (use in SET and WHERE) so it will not match if user is trying to change his email to other one.
    IS that the reason you think I was receiving an empty array?
×
×
  • Create New...