Jump to content

budimir

Members
  • Posts

    522
  • Joined

  • Last visited

Everything posted by budimir

  1. Hi guys, How can I insert a picture into an email message, so it is opened like a header and footer??? I don't want it just to be attached to the mail. I want it integrated into mail message.
  2. I got it. It was o problem with ending foreach loop ... Thanks for your effort ...
  3. No, that's not it. In that part I'm getting only one user, because I wan't to know who is sending the email. All emails are here: $sql = "SELECT * FROM newsletter_primatelji WHERE list_id = '$list_id'"; $result = mysql_query($sql,$veza) or die("ERROR IN QUERY:".$sql."<br>".mysql_error()); while($row = mysql_fetch_array($result)){ $primatelj[$row["email"]] = $row["ime"]; } When I print out that array I can see that all the emails are inside. But when the mail is being sent, it's sent only to the first mail in the list. I'm not quite sure why!
  4. Better said, the mail is delivered only to the first one in the list. It's not sending to any other emails in the mail list. When I take a look at my array with the email adresses I can see that everyone is inside. Any ideas??? What am I missing??
  5. Hey guys, Can you tell me where is the problem in this peace of code. I'm trying to send an email from a newsletter system I've built. But, the mail is not delivered. There is no error message. It isn't delivering emails. //Početak slanja newslettera $sql = "SELECT * FROM newsletter_primatelji WHERE list_id = '$list_id'"; $result = mysql_query($sql,$veza) or die("ERROR IN QUERY:".$sql."<br>".mysql_error()); while($row = mysql_fetch_array($result)){ $primatelj[$row["email"]] = $row["ime"]; } //print_r($primatelj);die; require("e-posta_inc-html.php"); foreach ($primatelj as $key => $value){ include "newsletter_show.php"; $email_sadrzaj = $newsletter_show; //echo "$email_sadrzaj"; //die; $sqlUsM = "SELECT * FROM korisnici WHERE id='$user_id'"; $resultUsM = mysql_query($sqlUsM,$veza) or die (mysql_error()); $rowUsM = mysql_fetch_array($resultUsM); $senderrr_email = $rowUsM["email"]; if ($senderrr_email == ""){ $senderrr_email = "husqvarna@drezga.hr"; } //require_once("../phpmailer/class.phpmailer.php"); $mail = new PHPMailer(); $mail->IsSMTP(); $mail->Host = "server"; $mail->SMTPAuth = false; $mail->Username = ""; $mail->Password = ""; $mail->From = $senderrr_email; $mail->FromName = "Drezga-Deržić d.o.o."; $mail->AddAddress($key); //Ovdje nisam siguran kaj ide ($key, $value ili $primatelj) $mail->AddReplyTo($senderrr_email, "Drezga-Deržić d.o.o."); // Optional: Specify character coding and encoding $mail->CharSet = "utf-8"; $mail->Encoding = "quoted-printable"; $mail->IsHTML(true); $mail->Subject = $naziv; $mail->Body = $email_sadrzaj; $sql_att = "SELECT * FROM newsletter_privici WHERE newsletter_id = '$newsletter_id' AND file1 != '' ORDER by priv_id"; $result_att = mysql_query($sql_att,$veza) or die (mysql_error()); while($row_att = mysql_fetch_array($result_att)){ $mail->AddAttachment("privici/".$row_att["file1"],""); $mail->AddAttachment("privici/".$row_att["file2"],""); $mail->AddAttachment("privici/".$row_att["file3"],""); } if(!$mail->Send()) { $not_sent_arr[$key] = $value; } echo "<span style='font-family: Verdana; font-size: 11px;'>"; if ($not_sent_arr != ""){ echo "<b>Neuspjelo slanje:</b><br>"; foreach ($not_sent_arr as $key => $value){ echo $key." - ".$value."<br>"; } }
  6. Thanks a lot for you're effort, guys. MSSQL is new to me and I don't know much about it. If I find any solutions to this, I will post here in case someone else will have the same problem as I do. Once again, thanks a lot.
  7. @ Corbin: I'm not too sure I understood what you mean. Can you give me a short example of code, so I could understand it. How do you mean encode it into the same encoding as the column?
  8. How should I encode it so it could work with the MSSQL??? (I have tried UTF-8, ISO, WIN, but nothing worked ... Maybe I missed something...) UTF-8, ISO , WIN ... ?? It's PHP 5.1
  9. @ corbin: Data is coming from the php script I wrote. Do I need to put in formmating of that data???? Like to use UTF-8 or ISO or WIN???? @ crtreedude: I tried typing in directly to SQL Server Managment Studio and everything is OK. But if I run my PHP script I get a lot of shit characters in the DB. I'm not sure why my PHP script is not putting the correct data to MSSQL DB!
  10. SQL Server Managment Studio I open DB, find table which I need, click right click and Open Table. Then I look at the results that were stored with the PHP script.
  11. I'm sorry, I didn't mention that I'm storing the data to MSSQL. I'm looking the data directly in the DB. Not through the script. And still problems...
  12. Hey guys, I have a question about inserting special characters into MSSQL from PHP. I'm from Croatia and our language has special characters like "ščćđž". I have setup collation for a MSSQL server as Croatian_CI_AI, but when I run my script the data in DB looks really strange. There is no special characters "čćšđž" in DB but some strange characters. Did anyone had a problem with this??? Is there any solutions???
  13. Thanks corbin, but unfortunatlly I can not rename that table name, because then there is a lot of other stuff that will not work. Is there any other solutions?
  14. Thanks Mchl, But, when i did that. This is the error message I got. Warning: mssql_query() [function.mssql-query]: message: Invalid object name 'Drezga Deržić d_o_o_$OvlasteniServis'. (severity 16) in C:\wamp\www\erp\sql_servis.php on line 88 What does that mean??? I'm sure that table exists and has that name!
  15. Guys, I have a problem. I have taken over a job to create a program in PHP which would connect on MSSQL and write and read data from it. The problem is that the guy which created the DB, didn't use standard marking for fileds and names. The name of the table on which I need to connect and put data in is "Drezga Deržič d_o_o_$OvlasteniServis" and PHP is not working with that. I'm getting an error message "Warning: mssql_query() [function.mssql-query]: message: Incorrect syntax near 'Derži�'. (severity 15) in C:\wamp\www\erp\sql_servis.php on line 88". Could I somehow trick PHP and replace "Drezga Deržič d_o_o_$OvlasteniServis" wth "Drezga_Derzic_d_o_o_$OvlasteniServis" or even simplier, but that I can still connect to that table??? Does anyone have a solution how to go around this? Unfortunatelly I can't rename the table. It has to stay in that way.
  16. You can use header("Location:name_of_the_page_you_want_get_back_to.php");
  17. Thanks a lot rhodesa. That helped. Name of the table also contained '-'. After I removed it, it was OK. Again, thanks a lot.
  18. OK, I got that fixed. The problem was I had spaces in column names. Now the problem is the '-' sign in one of the variables. How do I force MSSQL to accept this data??? This the error I'm getting: INSERT INTO OvlasteniServis (Vrstaservisa, Grad, Postanskibroj, Nazivservisa, Adresa, Telefon, Fax, E-mail) VALUES (1, 'Krk', 51500, 'CRO - FUTURA d.o.o.', 'Slavka Nikolića 48', '051/221-441', '', 'cro-futura@ri.htnet.hr') Warning: mssql_query() [function.mssql-query]: message: Incorrect syntax near '-'. (severity 15) in C:\wamp\www\erp\sql_servis.php on line 87
  19. Thanks a lot, rhodesa. I made a mistake and putted $ infront of the tbl_name. But, now I'm getting this error. INSERT INTO OvlasteniServis ([Vrsta servisa], [Grad], [Poštanski broj], [Naziv servisa], [Adresa], [Telefon], [Fax], [E-mail]) VALUES (1, 'Krk', 51500, 'CRO - FUTURA d.o.o.', 'Slavka Nikolića 48', '051/221-441', '', 'cro-futura@ri.htnet.hr') Warning: mssql_query() [function.mssql-query]: message: Invalid object name 'OvlasteniServis'. (severity 16) in C:\wamp\www\erp\sql_servis.php on line 87
  20. Hey guys, I'm using this query to insert data into MSSQL table $upit1 = "INSERT INTO $OvlasteniServis ([Vrsta servisa], [Grad], [Poštanski broj], [Naziv servisa], [Adresa], [Telefon], [Fax], [E-mail]) VALUES ('$da', '$grad', '$ptt', '$naziv', '$adresa', '$telefon', '$fax', '$email')"; $rezultat1 = mssql_query($upit1,$veza3) or die ("MSSQL upit nije uspio!!!"); And this is error message I'm getting: INSERT INTO (Vrsta servisa, Grad, Poštanski broj, Naziv servisa, Adresa, Telefon, Fax, E-mail) VALUES ('1', 'Krk', '51500', 'CRO - FUTURA d.o.o.', 'Slavka Nikolića 48', '051/221-441', '', 'cro-futura@ri.htnet.hr') Warning: mssql_query() [function.mssql-query]: message: Incorrect syntax near '('. (severity 15) in C:\wamp\www\erp\sql_servis.php on line 87 I'm a new to MSSQL, so if you can help or point me to some page where I could read about this, I would appreciate it. Thanks a lot.
  21. How do you mean not working? Where do you get value for $_GET['error']? Try to echo $_GET['error'] to see what it holds!
  22. I got it!!! This is the code I needed: <script type="text/javascript"> function ChangeVal(Obj) { var selected_option = Obj.selectedIndex; var ctrl_id = Obj.id; switch( ctrl_id ) { case "prevozno_sredstvo": document.getElementById("vrsta_prijevoza2").selectedIndex = selected_option; document.getElementById("vrsta_prijevoza3").selectedIndex = selected_option; document.getElementById("vrsta_prijevoza4").selectedIndex = selected_option; document.getElementById("vrsta_prijevoza5").selectedIndex = selected_option; document.getElementById("vrsta_prijevoza6").selectedIndex = selected_option; document.getElementById("vrsta_prijevoza7").selectedIndex = selected_option; break; } } </script> It's working perfectly!!!! @toprashantjha Thanks a lot.
  23. @toprashantjha It's exactly what I need, but I have a problem. Here is the code I adjusted: <script type="text/javascript"> function ChangeVal(Obj) { var selected_option = Obj.selectedIndex; var ctrl_id = Obj.id; switch( ctrl_id ) { case "prevozno_sredstvo": document.getElementById("vrsta_prijevoza2").selectedIndex = selected_option; break; case "vrsta_prijevoza2": document.getElementById("prevozno_sredstvo").selectedIndex = selected_option; break; case "vrsta_prijevoza3": document.getElementById("prevozno_sredstvo").selectedIndex = selected_option; break; case "vrsta_prijevoza4": document.getElementById("prevozno_sredstvo").selectedIndex = selected_option; break; case "vrsta_prijevoza5": document.getElementById("prevozno_sredstvo").selectedIndex = selected_option; break; case "vrsta_prijevoza6": document.getElementById("prevozno_sredstvo").selectedIndex = selected_option; break; case "vrsta_prijevoza7": document.getElementById("prevozno_sredstvo").selectedIndex = selected_option; break; } } </script> My problem is, when I change first selecbox, only second select box changes it's value. How can I adjust it so all 6 is changed???
  24. I think it's exactly what I need. I will try it out and let you know if it worked. Thanks so much.
×
×
  • 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.