Jump to content


  • Posts

  • Joined

  • Last visited

breaststroke's Achievements


Newbie (1/7)



  1. I've found a solution, at least it has worked once. I had and have to do this: if($reg=mysql_fetch_array($registros2))since it belongs to $registros2. I hope it keeps working... birbal, thank you very much for replying, I hadn't seen your last message till after submitting mine. It seems I found the solution. I guess the While loop got stopped when it came across that wrong $registros.I'll check the links you provide. I didn't know about thoem and I am sure they'll come in handy.thank you very much again! p.s I have to do that when I do a query through $registros2, before the Update
  2. Hello! Thank you for replying.It doesn't return any errors. But only one e-mail is sent and the last query to the database doesn´t work either (there is no such UPDATE).
  3. Hello, I have a problem involving Phpmailer and a While loop. Actually I have always had problems to sending emails this way. Now for instance I can send e-mails trough an IF (instead of While) and the following script works fine. But as soon as I change it into While it doesn't. Even the last part of the script (UPDATE) doesn't work (it worked upon IF). I am trying with just two e-mails to be sent and only the first one is sent.I would be so happy to solve this issue. While loop is really important when it comes to sending e-mails. This is my script: ...include('conexioninclude.php');mysql_set_charset('utf8');$registros=mysql_query("SELECT mail, name, password, codigo FROM alert WHERE status='on' AND language1='$language2' AND language2='$language1' AND way LIKE '%$way%' ORDER BY codigo",$conexion)ordie("Problems at selectt:".mysql_error());require("class.phpmailer.php");$mail = new PHPMailer();while($reg=mysql_fetch_array($registros)){$mailu=$reg['mail'];$namee=$reg['name'];$password=$reg['password'];$codigo=$reg['codigo'];$mail->IsSMTP();$mail->Port = 465;$mail->SMTPSecure = "ssl"; $mail->Host = "smtp.gmail.com"; $mail->SMTPAuth = true;$mail->Username = "xxxxx";$mail->Password = "xxxxxx"; // SMTP password$webmaster_email = "xxxxxx"; //Reply to this email ID$email="xxxxx"; // Recipients email ID$name="Admin"; // Recipient's name$mail->From = "xxxxxx";$mail->FromName = "Sharinglanguage.com";$mail->AddAddress($mailu,$namee);$mail->AddReplyTo(xxxxxx,"Webmaster");$mail->WordWrap = 50; // set word wrap$mail->SetLanguage("en","/php/language/");$mail->AddAttachment("/var/tmp/file.tar.gz");$mail->AddAttachment("/tmp/image.jpg", "phone.jpg");$mail->AddAttachment("image.jpg", "phone.jpg"); $mail->IsHTML(true); // send as HTML$mail->Subject = "xxxxxxxxx";$foto= "imagess/bonito.jpg";$mensaje='<font-color="#559999"><img src="'. $foto .'" width="600"><br /><br />Hello '.$namee.',<br /><br />xxxxxxxxxxxxxxxx .<br /><br />Sincerely yours</font>'; $mail->MsgHTML($mensaje);if(!$mail->Send()){print<<<HEREmessage wasn't sent;HERE;}else{$registros2=mysql_query("SELECT yep FROM vamos WHERE password='$password'",$conexion)ordie("Problems at selectt:".mysql_error());if($reg=mysql_fetch_array($registros)){$yep=$reg['yep']; // it's an Int type field (numbers)$saw=$yep+1;$registros3=mysql_query("UPDATE vamosSET yep='$saw'WHERE password='$password'",$conexion)ordie("Proble8uhims with selectttt:".mysql_error());}print<<<HEREsuccess!;HERE;}... Thank you very much in advance for any help. Regards
  4. Hi,I got it. The compareTo method is not for arranging Strings by their number of characteres but by their alphabetical order. Sorry!
  5. I don't know if it's necessary to say, but i am working on Java.I have realised the compareTo method works but only with Strings which start with the same letter. Then it arranges them properly.But it only arranges from lowest to higuest the String that start with the same letter.Isn't there a method which can be applied to any Strings regardless the letter they start with? p.s when above I say "order", I meant "arrange", "sort". English not being my native language..., sorry.
  6. Hello, I am trying to comprehend how to compare the length between Strings.i have the following, to compare the length of 10 countries inserted by the user. It also orders them from lowest to highest: public void load() { teclado=new Scanner(System.in); paises=new String[10]; for(int f=0;f<paises.length;f++) { System.out.print("Ingrese el nombre del pais:"); paises[f]=teclado.next(); } } public void ordenar() { for(int k=0;k<9;k++) { for(int f=0;f<9-k;f++) { if (paises[f].compareTo(paises[f+1])>0) { String aux; aux=paises[f]; paises[f]=paises[f+1]; paises[f+1]=aux; } } } } When I use the same method with numbers it works. For instance: public void ordenar() { for(int k=0;k<9;k++){ for(int f=0;f<9-k;f++) { if (vec[f+1]<vec[f]) { int aux; aux=vec[f]; vec[f]=vec[f+1]; vec[f+1]=aux; } } } } So I deduce maybe : if (paises[f].compareTo(paises[f+1])>0) is not correct, because it's the only difference comparing it to the method on numbers.Is there any other way to compare the length between Strings? thank you in advance. p.s I took it from a tutorial which has been working fine till now. I have even checked the "compareTo" on other sites and it seems to be appropriate but I don't know why it's not working here. I would appreciate any help.
  7. I have managed to solve it.I don't completely figure it out and since it is a very particular problem probably it's not neessary to explain (or try to.) what i have done.But if someone wants me to try I am ready and set. Regards
  8. Hello. I have created an animation which consists of several movie clips.I have added an stop at the end of the main Time Line so that everything gets stopped. But when managing one of this movie clips ('mywindow'), I don't know what I have done (I have gotten it to stop and to play later on) that now it disappears in the last frame, and it shouldn't.I don't know how to correct this and why this happened.I would appreciate any help.This is the link of the file: https://hotfile.com/...facade.fla.html Thank you vey much,Regards
  9. Thank you very much birbal.I don't know anything about annonymouse functions yet, I will check it out.I conclude I can request two pages within the same function as I showed above. I will try.Regards
  10. Hello! I am wondering whether we can make to calls to different pages within the same function.Something like this: function lcalls(){var xmlhttp;if(window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); }else {// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); }xmlhttp.open("GET","calls1.php",true);xmlhttp.send();xmlhttp.open("GET","calls2.php",true);xmlhttp.send();//maybe it would be enough to type just one send() at the bottom?} Or, if we could have two different functions within the same event.Something like this: <body onkeyDown="calls1(),calls2()"> I can try them, but I don't know whether to do that is correct or not.Thank you in advance.
  11. hi, Finally, i got it to work fine (at least for now;)), thanks to this link: http://snipplr.com/view/5144/getset-cursor-in-html-textarea/
  12. Hello, I just wanted to say I thank you for the courses you offer through w3school. I have learnt a lot from them.thank you, also, for these forums. Regards.
  13. Hello, I am trying to replace an emoticon for text into a textarea (Actually I may be interested in including the emoticon itself, but it seems to be more complex, and first I would like to learn how to do this.)I have the following in HTML: <a href="javascript:Smile(' [] ')"><img src="http://www.websmileys.com/sm/sad/239.gif" border="0" alt="imagen" /></a><br /><div style="text-align:center;margin-bottom:25px"><form name="formulariol"><textarea cols="40" name="textol"rows="4" id="txt" ></textarea></form> and the following, in Javascript, related to the former: <script type="text/javascript">function Smile(texto){document.formulariol.textol.value = document.formulariol.textol.value + texto;document.formulariol.textol.focus();}</script> It works fine, but either in Chrome or in Safari the cursor is set just before the text that replaces the emoticon, not after.I would like it to be at the end of the text, in all browsers.any idea about how to handle this, please? Thank you very much in advance. Regards
  14. Hello thescientist. Thank you for your response and your explanations too. I have found another code which includes the e into de function.yours didn't work but i will try to analyze it so that I work it out.this is what I have made: function showUser(str,e){var keycode=e.which?e.which:e.keyCode;if (keycode == 13){if(str==""){... Thanks a million
  15. Hello Ingolme. Thank you.This is the HTML code related to the function: <textarea cols="20" name="texto"rows="4" id="txt" onkeyPress="showUser(this.value)"></textarea></div> the function works untill that part, but on Firefox.On the rest of browsers it works fine.According to my information keydown would seem more appropriate but i have tried with it as well and I have found the same problem.I have read somewhere onkeyPress and the code I have inside the function are a good option. Regards p.s.I have edited the javascript function on the previous post because I had duplicated the same code.As you suggest, if I include an alert (for example) just when the function starts it is okay, but not when I do it after: if (keycode == 13){Thank you again.
  • Create New...