Search the Community
Showing results for tags 'printf'.
-
Hi All, I'm trying to return HTML page contains the Russian characters sent as POST variables and also static data as part of HTML result. I'm not able to put it work together. If I set windows-1251 - the static data displayed incorrectly. If I set UTF-8 - the dynamic (POST) data displayed incorrectly Any thoughts? Thank you very much in advance, Evgeny Following is the simple HTML example and also Fiddler request example <?php header('Content-Type: text/html;charset=windows-1251'); $firstName = $_POST["from"]; $subject = $_POST["subject"]; $message = $_POST["message"]; $version = phpversion(); $messageToSend = " <html> <meta http-equiv='Content-Type' content='text/html; charset=windows-1251'> <head> <title>Christiada2033 automatic email</title> </head> <body> <p>Static russian: По-русски</p> <table> <tr> <td>Version:</td> <td>$version </tr> <tr> <td>Static russian: Отправитель:</td> <td>Post value russian: $firstName</td> </tr> <tr> <td>Static russian: Тема:</td> <td>Post value russian: $subject</td> </tr> <tr> <td>Static russian: Сообщение:</td> <td>Post value russian: $message</td> </tr> </table> </body> </html> "; printf($messageToSend); die(); ?> =====================Fiddler===================== POST http://myhost/mysite/mail_html2.php HTTP/1.1 Host: myhost Connection: keep-alive Content-Length: 132 Cache-Control: max-age=0 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8 Origin: http://localhost User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.111 Safari/537.36 Content-Type: application/x-www-form-urlencoded Referer: http://myhost/mysite/Mail_Html2.shtml Accept-Encoding: gzip,deflate Accept-Language: en-GB,en;q=0.8,en-US;q=0.6,ru;q=0.4,he;q=0.2 from=%C8%E2%E0%ED+%CF%E5%F2%F0%EE%E2&subject=%D2%E5%EC%E0&message=%CF%F0%E8%E2%E5%F2%2C+%EF%F0%E8%E2%E5%F2%21&submit=Submit+Feedback =====================Fiddler=====================
-
Hi I want to make a table that has table rows like this: There are 3 horses in the sky. There are 4 cows in the stable. There are 5 dogs in the sea. The numbers, the animal names and the places have to be placed neatly below each other, so therefore I probably need to use the <td></td>. I tried using the printf ($format, $number, $animal, $place) function, and the array's $number=array(3,4,5); $place=array(sky,stable,sea); $animal=array(horses, cows, dogs); But I only get one tablerow that says (, There are, Array, Array, in the, Array); Can anyone please tell me what code I have to use to make this? Thanks already.