PHP - Need Assistance With Russian Fonts In My Auction Site System Emails
Hi friends,
I need assistance with making russian fonts displayable in the system emails that are being sent to my auction website users. Any reason the russian fonts I have entered below are displayed the way they are. Please also note I am brand new in PHP and simple llingo would be appreciated. Regards, <? ## Email File -> email an auction to a friend ## called only from the $item->auction_friend() function! ## File Version -> v6.10 if ( !defined('INCLUDED') ) { die("Access Denied"); } //$sender_details = $this->get_sql_row("SELECT u.name, u.email FROM " . DB_PREFIX . "users u WHERE u.user_id='" . $user_id . "'"); $send = true; // always sent; ## text message - editable $text_message = 'Dear %1$s, Your friend, %2$s, has forwarded an auction, posted on %3$s for you to look at. To view the details of the auction, please click on the URL below: %4$s Additional comments: %5%s Best regards, The %6$s staff'; ## html message - editable $html_message = 'Дорогой (ая) %1$s, <br> <br> Ваш друг, %2$s, отправил на Ваше рассмотрение Аукцион, выставленный на %3$s. <br> <br> [ <a href="%4$s">Нажмите здесь</a> ] чтобы просмотреть этот Аукцион. <br> <br> Дополнительные комментарии: %5$s <br> <br> С Уважением, <br> %6$s <br> <br> <br> Dorogoy (aya) %1$s, <br> <br> Vash drug, %2$s, otpravil na Vashe rassmotreniye Auktsion, vistavlenniy na %3$s. <br> <br> [ <a href="%4$s">Najmite zdes</a> ] chtobi prosmotret etot Auktsion. <br> <br> Dopolnitelniye kommentarii: %5$s <br> <br> S Uvajeniyem, <br> %6$s'; $auction_link = process_link('auction_details', array('name' => $item_details['name'], 'auction_id' => $item_details['auction_id'])); $text_message = sprintf($text_message, $friend_name, $sender_name, $this->setts['sitename'], $auction_link, $comments, $this->setts['sitename']); $html_message = sprintf($html_message, $friend_name, $sender_name, $this->setts['sitename'], $auction_link, $comments, $this->setts['sitename']); send_mail($friend_email, 'Проверьте этот Аукцион', $text_message, $this->setts['admin_email'], $html_message, $sender_name, $send); ?> Similar TutorialsHi, I'm trying to build a auction system now. Anyone mind explaining the concept? such as where should i store the highest bid and details of the bidder? create a new database table to store it? or any other way? can it be done by just php and sql? i just need to build a simple auction system with only 12 products net. thanks for the help. Good day all , I am in the processes of creating a add buyer page for an auction site. However , the rows are not updating when i add a new buyer. Below is the code i have written .
This is the add buyer form page :
<!doctype html>
<body>
else if ($_GET["buyer"] == "duplicate")
This is the check buyer form page :
<!doctype html>
<body>
if ($conn->connect_error)
$statement = "SELECT * FROM buyer WHERE username=?";
imagettftext() is used to write text to an image using TrueType fonts. Size being one of the parameters: Quote The font size. Depending on your version of GD, this should be specified as the pixel size (GD1) or point size (GD2). An inch representing 72 points. However how is the point size calculated? Is it based on the servers/clients screen resolution? Not sure where to start, and it may not be entirely PHP. I am helping a friend with a small social network (5,000 users). They want to add a feature where each user gets given their own email account in the format username@domain.com with domain.com being the domain of the social network. Is this too much? I've never thought of anything like this before. How would we create the email accounts? Can PHP do it? Would it be an API through the web host / email space provider? 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 I created a specific Linux user responsible to host a given site, created a postgresql user and database with the same name, and created a pool, and all is good... Almost. How can I make the user a system user (i.e. useradd -r my_user) without a home? Without a home, where should ssh keys go? Anything need to be changed when creating the postgresql user? Thanks This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=346529.0 Hello, recently I changed host of my website and when a visitor clicks "contact us" button in my website (in which one needs to enter his/ her email, name, phone , etc) and submit his/her message then I get email. Before this hosting I used to get emails from the visitor who filled the form so it was easier for me to reply but now after I changed the host I get email as "mydomain@hosting-company-domain" instead of the visitor's email. I messaged them then they told me something about SMTP authenticate using PHP, please guide me to fix this. I am looking for a tutorial or advice wherein I can create a timer for my auction items. You can see those timers on the site like quibids.com The concept is like this. I post and auction and set an end time for the auction. When the auction is live, The timer will start and will show how many hours and seconds are remaining. If any one has a class or some link to a tutorial site, that'll be a great help. Thanks a lot. Hello. I am pretty fresh at php. And i want to ad a quantity field for my auctions. So it needs a extra field in setting up auctions ,the extra input in auctions page and some way of autoupdate in the auction itself. Can i modify a inventory script to do this function or would it be easier to just implement it into the existing files?
And where can i find the codes i need?
This topic has been moved to PHP Applications. http://www.phpfreaks.com/forums/index.php?topic=348680.0 This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=319772.0 hello dear PHP-Fans - greetings to you - and a happy new year!! i set up a WAMP-System on my openSuse 11.4 system. In order to learn as much as i can bout PHP i want to do some tests and write some scripts. Well the WAMP is allready up and running. Now i try to give the writing access to the folder mkdir /srv/www/ where the php-scripts should go in... i want to give write permission to all to all files in /srv/www As root I generally: mkdir /srv/www/ chown <webmaster usrername> /srv/www/ /srv/www/ should be readable and traversable by all, but only writeable by it's owner (the user designated as the webmaster.) can i do this like mentioned above,... Love to hear from you greetings db1 I am working on an existing system. It has the GD library (I think). The system is very hard to understand because of how it was built. Either way, I am trying to add new fonts. I notice each font the other developer uses has a .php, .ttf, .t18 and .afm. Each one of the font has each one of those files, named the same as the font. I am going crazy, trying to figure out how to add more fonts. The client has requested that I add another 5-15 fonts. Pretty much whatever I can get my hands on. So I was curious, where can I find these kinds of fonts. Since there is a .php file, I assumed this was located somewhere as a php resource. I have search all over, but don't know what I am looking for. Or do I have to use any font, and then custom build the php file for that font, based off how that font works. How would someone learn how the internal workings would work, for a specific font? Hi Not that often I play with these (and normally just a single font I use). However I am trying to generate an image with a ttf bit of text on it. No problem using Tuffy.ttf (the normal one I use), but I want to use some arrow characters which it doesn't support. I have tried using Wingding and Webdings but neither work with GD. Am I missing something (hopefully something obvious)? All the best Keith I have set this up with a form on another page so that they can generate a runescape stat signature, although there is something wrong, if they do not select a font it comes up with an error. Here is the Code: Code: [Select] <?php header("Cache-Control: no-store, no-cache, must-revalidate"); header("Cache-Control: post-check=0, pre-check=0", false); header("Pragma: no-cache"); $user = ""; $img = ""; $fnt = ""; if(isset($_GET['user'])) { if(!empty($_GET['user'])) { $user = $_GET['user']; } } if(isset($_GET['img'])) { if(!empty($_GET['img'])) { $img = $_GET['img']; } else{$img='blue';} } else{$img='blue';} if(isset($_GET['fnt'])) { if(!empty($_GET['fnt'])) { $fnt = $_GET['fnt']; } else{$fnt='arial';} } else{$img='blue';} if(isset($_POST['user'],$_POST['img'],$_POST['fnt'])) { if(!empty($_POST['user'])) { $user=$_POST['user']; } if(!empty($_POST['img'])) { $img = $_POST['img']; } if(!empty($_POST['fnt'])) { $fnt=$_POST['fnt']; } } //Skill Grabs $order = array("Overall", "Attack", "Defence", "Strength", "Hitpoints", "Ranged", "Prayer", "Magic", "Cooking", "Woodcutting", "Fletching", "Fishing", "Firemaking", "Crafting", "Smithing", "Mining", "Herblore", "Agility", "Thieving", "Slayer", "Farming", "Runecraft", "Hunter", "Construction", "Summoning", "Dungeoneering"); $get = file_get_contents("http://hiscore.runescape.com/index_lite.ws?player=$user"); $get = explode("\n", $get); $i = 0; foreach ($order as $key => $value) { $value = strtolower($value); $temp = explode(",", $get[$i]); $temp = array("rank" => $temp[0], "level" => $temp[1], "exp" => $temp[2]); $stats[$value] = $temp; $eval = "\$$value = array(\$temp[\"rank\"], \$temp[\"level\"], \$temp[\"exp\"]);"; eval($eval); $i++; } //End Skill Grabs $image = imagecreatefrompng("http://slay2day.x10.mx/highscores/signatures/".$img.".png"); $font = "/fonts/".$fnt.".ttf"; $color = imagecolorallocate($image, 255,255,255); ImageTTFText ($image, "7", 0, 280, 10, $color, "/fonts/arial.ttf","Slay2day"); ImageTTFText ($image, "12", 0, 240, 55, $color, $font,$user); if(is_numeric($overall[0])) { if($overall[0]==-1) { ImageTTFText($image, "11", 0, 230, 105, $color, $font,"2000000+"); } else { ImageTTFText($image, "11", 0, 240, 105, $color, $font,$overall[0]); } } else { ImageTTFText($image, "11", 0, 230, 105, $color, $font,"2000000+"); } ImageTTFText ($image, "10", 0, 27, 20, $color, $font,$attack[1]); ImageTTFText ($image, "10", 0, 27, 42, $color, $font,$strength[1]); ImageTTFText ($image, "10", 0, 27, 64, $color, $font,$defence[1]); ImageTTFText ($image, "10", 0, 27, 88, $color, $font,$hitpoints[1]); ImageTTFText ($image, "10", 0, 27, 114, $color,$font,$ranged[1]); ImageTTFText ($image, "10", 0, 70, 20, $color, $font,$prayer[1]); ImageTTFText ($image, "10", 0, 70, 42, $color, $font,$magic[1]); ImageTTFText ($image, "10", 0, 70, 64, $color, $font,$cooking[1]); ImageTTFText ($image, "10", 0, 70, 88, $color, $font,$woodcutting[1]); ImageTTFText ($image, "10", 0, 70, 114, $color,$font,$fletching[1]); ImageTTFText ($image, "10", 0, 117, 20, $color, $font,$fishing[1]); ImageTTFText ($image, "10", 0, 117, 42, $color, $font,$firemaking[1]); ImageTTFText ($image, "10", 0, 117, 64, $color, $font,$crafting[1]); ImageTTFText ($image, "10", 0, 117, 88, $color, $font,$smithing[1]); ImageTTFText ($image, "10", 0, 117, 114, $color,$font,$mining[1]); ImageTTFText ($image, "10", 0, 162, 20, $color, $font,$herblore[1]); ImageTTFText ($image, "10", 0, 162, 42, $color, $font,$agility[1]); ImageTTFText ($image, "10", 0, 162, 64, $color, $font,$thieving[1]); ImageTTFText ($image, "10", 0, 162, 88, $color, $font,$slayer[1]); ImageTTFText ($image, "10", 0, 162, 114, $color,$font,$farming[1]); ImageTTFText ($image, "10", 0, 212, 20, $color, $font,$runecraft[1]); ImageTTFText ($image, "10", 0, 212, 42, $color, $font,$construction[1]); ImageTTFText ($image, "10", 0, 212, 64, $color, $font,$hunter[1]); ImageTTFText ($image, "10", 0, 212, 88, $color, $font,$summoning[1]); ImageTTFText ($image, "10", 0, 212, 114, $color,$font,$dungeoneering[1]); header("Content-type: image/png"); imagepng($image); imagedestroy($image); //Logging $url = getenv("HTTP_REFERER"); // connect to the database include('connect-db.php'); //variables date_default_timezone_set('Pacific/Auckland'); $datepickerbox = $_POST['datepickerbox']; $datepickerbox = date("Y-m-d H:i:s", time($datepickerbox)); echo $datepickerbox; // save the data to the database mysql_query("INSERT signature SET user='$user', img='$img', time='$datepickerbox', url='$url', font='$fnt'") or die(mysql_error()); //End Logging ?> if they do not have a font i get: Code: [Select] Warning: imagettftext() [function.imagettftext]: Could not find/open font in /home/slay2day/public_html/highscores/signatures/signature.php on line 130 but of they dont choose a font i want it to use arial... ok... I'm still struggling with PHP syntax, my editor's linting keeps flagging a line as incorrect. it's supposed to read as " when d1 minus 1 is less than or equal to d2 with d2 being less than or equal to d1 plus 1" so in other words its supposed to be true if d2 is between d1 minus 1 and d1 plus 1, inclusive. I don't want d2 being the previous number, the same number or the next number relative to d1. The same goes for d3, d4, and d5 (4 and 5 are un coded because why code in errors).
That being said... This isn't exactly my correct goal but I'm not sure how to code what I really want... I can't seem to find a good way to test this without the commands I know from other languages like CountIf, Iffn and RandSamp. (those are Ti-Basic commands) I know "please do it for me" is frowned upon, and hate saying it (I'd rather learn to do it myself), but if anyone can explain how to do this I'd really appreciate it. Edited March 23, 2019 by Karaethon Hi guys, Here is what I have so far: http://www.autoshopgarage.com/new-era/generate.php What I am trying to do is instead of having Line 1 and Line 2, I want to just have one big textarea so I don't have to limit the user so much. I did it this way because I want to have two versions of text, the light version and the bold version. Is it possible to have two different fonts with just one textarea of text? Right now I have two functions: Quote ImageTTFText($image, $fontSize, $fontRotation, 435, 80, $color, $font1, wordwrap($first, 18, "\n", true)); ImageTTFText($image, $fontSize, $fontRotation, 485,120, $color_black, $font2, wordwrap($last, 18, "\n", true)); So I would limit that to just 1, and it would automatically wordwrap but what would I put for the $font variable? Is this even possible? I was thinking of just using BBCode so they could type in [b*]Bold Text[/b*] and it would use the Bold version of the font if it sees that. Any help is appreciated. Thanks! Here is the full code: Quote <?php $first = $_GET['first']; $last = $_GET['last']; $font_color = $_GET['color']; header("Content-type: image/png"); $image = imagecreatefrompng ( "banner_blank.png" ); $color_black = imagecolorallocate($image, 0, 0, 0); $color_red = imagecolorallocate($image, 255, 0, 0); if($font_color == "Red") { $color = $color_red; } elseif($font_color == "Black") { $color = $color_black; } $font1 = 'HelveticaNeueLTStd-BdEx.ttf'; $font2 = 'HelveticaNeueLTStd-LtEx.ttf'; $fontSize = "21"; ImageTTFText($image, $fontSize, $fontRotation, 435, 80, $color, $font1, wordwrap($first, 18, "\n", true)); ImageTTFText($image, $fontSize, $fontRotation, 485,120, $color_black, $font2, wordwrap($last, 18, "\n", true)); imagepng ( $image ); imagedestroy ( $image ); ?> I have an array here that looks like this: Code: [Select] Array ( [server_info] => Array ( [up] => 1 [up_since] => Sun, 23 Oct 2011 04:04:01 -0600 [up_for] => 2588 [version] => Beta 1.9 Prerelease 4 ) [players] => Array ( [0] => Pyr3x ) [server_settings] => Array ( [map] => Underworld [pvp] => 1 [pve] => 1 [max] => 50 ) [admins] => [ops] => Array ( ) ) How would I for example print the contents of the players array without having to be specific on which object within it that I wish to print, it's dynamic so it's always going to change. Example of the output I'd like is: Players: Pyr3x, SomeGuy, AnotherGuy Thank you for any help you may be able to provide. -Pyr3x So I have the following and for some reason or another it's not wanting to work with me. If I do the query directly in phpmyadmin it will return the number, however for some reason when I throw it into a variable it won't return anything. I have a feeling it's because of the text string? How do you properly represent a string of text that has a space between it? 1st query get's the name from another table: $query = "SELECT name FROM info WHERE userdid = 4"; $data = mysqli_query($dbc, $query); $row = mysqli_fetch_array($data); $tname = $row['name']; Table: testing rows: number name data: 4 Testing This $query1 = "SELECT number FROM testing WHERE name = '" . $tname . "'"; $data1 = mysqli_query($dbc, $query1); $row1 = mysqli_query($data1); $numreturn = $row1['number']; // Do stuff |