Jump to content

aspkiddy

New Members
  • Posts

    5
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

aspkiddy's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. HI, I use the POST method to send XML Data at web service Here is my code $myDataXml = '<item> <number>445</number> <itemId>7319</itemId> <name>GO</name> <user> <name>Jean</name> <lastName>Penn</lastName> </user> </item>'; $url_ws = 'https://ourwebservice.com/ws/item/TOTO?id=tototiti&pswd=87963215&xml='; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url_ws); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_COOKIESESSION, true); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: text/xml')); curl_setopt($ch,CURLOPT_POSTFIELDS, "xmlRequest=" . $myDataXml); $dataWS = curl_exec($ch); if(curl_errno($ch)) { echo 'CURL ERROR: ' . curl_error($ch); } else { $getInfo = curl_getinfo($ch); print_r($getInfo); } print_r($dataWS); curl_close($ch) It works without problem : I have not error with curl_error($ch) But web service me send this message by [print_r($dataWS);] : What must I do for this ? could you help me please have a nice day
  2. Hi, I have some difficulty with my 'select' In my select/menu, I display all the options come from a table (table_db_email) in my database In this table (tb_code_prmtn11_email) I have two field : fld_email_id fld_name_email It works here is a code <select name="email_adress_menu" id="email_adress_menu" class="valid" onchange="submit()"> <?php echo "<option selected=\"selected\" value=''>Choose your name</option>"; $req_email_adress_menu = " select DISTINCT id_email, fld_name_email, fld_adresse_email FROM $table_db_email ORDER BY fld_name_email "; $rep_email_adress_menu = mysql_query($req_email_adress_menu, $cnx) or die( mysql_error() ) ; while($show_email_adress_menu = mysql_fetch_assoc($rep_email_adress_menu)) { echo '<option value="'.$show_email_adress_menu['id_email'].'"'; //if($primes==$show_email_adress_menu['fld_name_email']){echo " selected";} //display to select an option!!!!!!!!!!!!!!!! echo '>'.$show_email_adress_menu['fld_name_email'].' - '.$show_email_adress_menu['fld_adresse_email'].'</option>'; } ?> </select> I have some other information come from another table : tb_code_prmtn11 (containing information about people) I have a few fields : id_resultat fld_name fld_email_id ( FOREIGN KEY (`fld_email_id`) REFERENCES `tb_code_prmtn11_email` (`id_email`) ON DELETE NO ACTION ON UPDATE CASCADE;) ... I want to put this menu on another Web page and this select must display all of the options as below( with) BY SELECTING THE OPTION THAT MATCHES THE INFORMATION FOUND IN THE SECOND TABLE : tb_code_prmtn11 How can I do this ? I know how I can make to my request : here is a code MySql : SELECT td.id_resultat,td.fld_email_id,email.fld_name_email FROM $table_db td INNER JOIN $table_db_email email ON td.fld_email_id = email.id_email WHERE td.id_resultat=$id This code works also but I don't know how I can include this second query in my menu ... Can you help me please :'(
  3. It works after I installed phpmailer-1.71 on my web site this is a my solution for windows web server 2008 : Copy thoso files class.phpmailer.php and class.smtp.php to your web site So you have installed phpmailer-1.71 You don't need to change your php.ini file Then, integrate the following code in your form: // Preparation email require("class.phpmailer.php"); // ("name_of_your_folder/class.phpmailer.php") $mail = new PHPMailer(); $mail->IsSMTP(); // telling the class to use SMTP $mail->SMTPAuth = true; // turn on SMTP authentication $mail->Host = "111.111.1.1"; // or name of your smtp exemple 111.111.1.1 or smtp.toto.com $mail->Username = "your_Username"; $mail->Password = "your_Password"; $mail->From = "your_email@toto.com"; $mail->AddAddress = "his_email@otot.fr"; // $mail->Subject = "First PHPMailer Message"; $mail->Body = "Hi! \n\n This is my first e-mail sent through PHPMailer."; $mail->WordWrap = 50; if(!$mail->Send()) { echo 'Message was not sent.'; echo 'Raison : ' . $mail->ErrorInfo; } else { echo "Message has been sent."; }
  4. I tried this one also : <?php $username = "tototiti"; $password = "tatatete"; $POPserver = "111.111.1.1"; ### php.ini's SMTP must correspond to this server ### and sendmail_from must be from this server (??) $msg = POP_authenticate($username, $password, $POPserver); if ($msg === FALSE) { mail("toto@gmail.com", "PHP test", "Line 1\nLine 2"); $msg = "mail (probably) sent.\r\n"; } exit($msg); ?> but the same error message :-\
  5. Hi, How I send an email with PHP on windows server (windows Server Web 2008 and IIS 7.0) with smtp external server. Into file : php.ini [mail function] ; For Win32 only. ; SMTP = localhost SMTP = mail.toto.com ; SMTP = 111.111.1.1 smtp_port = 25 I tried with this code, first time: //echo $var_emaill; //exit(); If (!empty($var_emaill)) { $recipient = $var_emaill; $subject = "confirmation …" ; $msg = "hello \t$var_mr \t$var_name\n"; $msg .= "Email : \t$var_emaill\n"; $msg .= "thanks for your inscription\n\n"; $msg .= "Seconde ligne….." ; $mailheaders = "From: toto.com<> \n"; //echo $msg; //exit(); // send email mail($recipient, $subject, $msg, $mailheaders); } Here is an error message : And after, I tried an other solution : I installed “phpmailer » : C:\phpmailer\class.smtp.php And I used an other code, this one : <?php //echo $var_emaill; //exit(); If (!empty($var_emaill)) { //PHP Mailer include ("C:\phpmailer\class.smtp.php"); // Preparation du mail $mail = new PHPmailer(); $mail->IsSMTP(); $mail->Host='mail.toto.com'; $mail->From='toto.com'; $mail->AddAddress($var_emaill); $mail->Subject='confirmation…'; $mail->Body='hello \t$var_mr \t$var_name\n'; if(!$mail->Send()){ //Test le return code de la fonction echo $mail->ErrorInfo; //error message } else{ echo 'Mail sent with succes'; } $mail->SmtpClose(); unset($mail); } ?> I have same error : Server Error 500 - Internal server error. There is a problem with the resource you are looking for, and it cannot be displayed. Can you help me : How must I configure php.ini ? must I configure class.smtp.php ? If yes how is it ? my code php (my codes, the two above,) are there correct ? Best regards
×
×
  • 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.