PHP - Placing A Text Over On Image
Hi,
I have a project, where i want to place a text over the image dynamically, just like if it is sold, i want to make it as SOLD text over the image Looking for idea to implement this, Thanks, Similar TutorialsHi Guys, I'm going to try and watermark my uploaded images with a small logo (placed onto the original image) so they are all watermarked, is there any tutorials anyone can recommend to do this? i can't seem to find any online. thanks for any help guys Graham Hi there, I have a database with table column called EXPAMOUNT
if EXPAMOUNT value was £5.50 My code at moment echo “Total Expenses   £” . $row[‘SUM(EXPAMOUNT)’]. “ Hi, $_POST['arr_name']; I want to make the search so that am getting the array values and oputting in IN(val1, val2, val3) Thanks Okay, I would like to redirect my page within a specific time using java script: <meta http-equiv="Refresh" content="3;url=<?PHP echo 'progress.php?user=';$session->username?>"> Basically, I would like it to redirect to this: progress.php?user=$session->username. But it redirects to: progress.php?user= Please help, thanks ... I have two different tables and I am trying to condense them into one table.
The structure of the tables is
cc
-- ci
-- cc
-- cn
-- alpha_2
countries
-- id
-- cn
-- alpha_2
-- alpha_3
What I want to do is place the info from the column alpha_2 in the countries table into the alpha_2 column in the cc table.
I have tried inner joins, left joins, Insert and Select index. Everything that I have tried gives me an error message. I do not know what I am doing wrong and I was hoping that someone would be able to give me a hand.
I forgot to mention that I want the placement of the alpha_2 column to be based on the cn columns in both tables. So that the information in the alpha_2 column lines up with the right name in the cn column
Edited by mdmartiny, 09 August 2014 - 01:07 PM. I believe the solution the my problem should be simple I feel that it's staring me right in the face. I have a Cron Job that sends an email message to users who's bill "due date" falls on the current date. I want to make the email more personalized and say:
Dear John Doe:
You have the following bills due today:
Rent
Cable
Internet
Please login to pay your bills
Thanks,.
Here's my following PHP code
<?php header("Content-type: text/plain"); // OPEN DATA BASE define("HOSTNAME","localhost"); define("USERNAME",""); define("PASSWORD",""); define("DATABASE",""); mysql_connect(HOSTNAME, USERNAME, PASSWORD) or die("Connetion to database failed!"); mysql_select_db(DATABASE); joinDateFilter(); // BILL QUERY function joinDateFilter(){ $query = mysql_query("SELECT bills.billname, bills.duedate, bills.firstname, bills.email, bills.paid FROM bills JOIN users ON bills.userid=users.userid WHERE DATE(bills.duedate) = CURDATE() AND bills.PAID != 'YES'"); $mail_to = ""; while ($row = mysql_fetch_array($query)){ echo $row['firstname']." - ".$row['email']."\n"; $mail_to = $row['email'].", "; } if (!empty($mail_to)){ sendEmail($mail_to); } } // SEND EMAIL function sendEmail($mail_to) { $from = "MyEmail@myemail.com"; $message = "Dear " . $row['firstname'].", <br><br>" ."You have the following bills due today.<br><br>" .$row['billname']. "<br><br>" ."Please login to pay your bills"; $headers = 'From: '.$from."\r\n" . 'Reply-To:'.$_POST['email']."\r\n" . "Content-Type: text/html; charset=iso-8859-1\n". 'X-Mailer: PHP/' . phpversion(); mail($mail_to, "Today is your due date", $message, $headers); } ?> Edited by demeritrious, 26 December 2014 - 07:21 PM. Hi There, I would like to place the last for month names into an variable- for example: February 2011 January 2011 December 2010 November 2010 But I would like them to all have the same variable ($date) - so when I use it in a mssql_fetch_assoc - it increments with every instance of $date, as there will be one instance of $date for every row returned, getting older with every row. Hope that is enough info? Cheers Matt Hi There, I want to be able to populate 2 variables, $previousmon and $previousfri with 2 dates, being the previous Monday and the previous Friday to the week you are on. So for example, if it is Monday 31st Jan, then $previousfri would be 28/01/2011 and $previousmon would be 24/01/2011. Is this easy enough to do? Cheers Matt This code is creating broken image.please check it png and gd is enabled. i also remove the header but still getting broken image. there is no space before/after php tags.thanks you my code Code: [Select] <?php // Set the content-type header('Content-Type: image/png'); // Create the image $im = imagecreatetruecolor(400, 30); // Create some colors $white = imagecolorallocate($im, 255, 255, 255); $grey = imagecolorallocate($im, 128, 128, 128); $black = imagecolorallocate($im, 0, 0, 0); imagefilledrectangle($im, 0, 0, 399, 29, $white); // The text to draw $text = 'Testing...'; // Replace path by your own font path $font = 'arial.ttf'; // Add some shadow to the text imagettftext($im, 20, 0, 11, 21, $grey, $font, $text); // Add the text imagettftext($im, 20, 0, 10, 20, $black, $font, $text); // Using imagepng() results in clearer text compared with imagejpeg() imagepng($im); imagedestroy($im); ?> I want a div at the bottom of another div, and I want it centered, just using css not javascript.
HTML <div id="parent"> <div id="bottom_element">test</div> </div> CSS #parent {height:100% width:100%} #bottom_element {position:absolute; bottom:5px; width:200px; margin:0 auto}So the issue is that position absolute and margin auto do not seem to work together. What is an alternative without javasript? Basically i have a folder with 100+ images they are NOT all the same extension, what im wanting to do is use PHP to find all the images and put them all in a database. how would i go about doing this? thanks is there anway way of being able to paste a picture into a textarea? hi, i would like to no how people do this http://runelink.org/site/sc.php?server=TestScapez its an image with the name and votes of a server in a mysql database how would i do this? Hello guys. Well I've ran into a sorta crossroad here with this script. See I'm trying to create like a click to make point system on an image. I have it all working except 1 problem.. At the moment the text to image script is only adding 1 bit of text onto the image, that is fine, that is because this is the only one in the php file: Code: [Select] Imagettftext($im, 12, 0, $X, $Y, $black, 'verdana.ttf', "$text"); But, what I am trying to do is to let the user create more points. I thought I could achieve this by a database and just echoing out all of the rows from point txt which are like the above. So it will be like Imagettftext($im, 12, 0, 342, 455 $black, 'verdana.ttf', "$text"); Imagettftext($im, 12, 0, 443, 953, $black, 'verdana.ttf', "$text"); Imagettftext($im, 12, 0, 553, 445, $black, 'verdana.ttf', "$text"); And every time a user adds another point another one of the above is added to the database, it is then read by the TXT file, and displayed onto the image. Although I only have this running at the moment: Code: [Select] <?php echo $row['pointtxt']; ?><br> And for a test I just tried a simple echo command, and this is the only record or row in the database in the field pointtxt: Code: [Select] echo "hello"; As you can image, I don't think an echo can echo PHP commands, sorry this is really hard to explain, if anyone needs further explaining tho I will try. Its basically I just want a user to add one of these into the database Imagettftext($im, 12, 0, 553, 445, $black, 'verdana.ttf', "$text"); And on the image, it will grab all of those from the database, and run them so they all appear on the image. Thanks for your help. Is there any option to put text into this boxes where are red lines ? Okay I don't think I made myself clear last time. If this is too much hassle I will pay a small fee. But what I'm looking for is to be able to have a picture generated from my variables. I need 2 text inputs which put out the two lines shown. also need the background to gather from file directory. Also the biggest help i need is the text to be centered, since i keep messing that up PNG format = preferable. EXAMPLE - Thanks again. Hello. I would like to create a banner that gets two variables $one and $two. Then write them both onto my 468 by 60 image for examples sake "image.jpg" I know its something to do with imagettftext. However I can't find any good help around. Thanks is this possible to get the text in an image? Hi I have a database with all my game collection on and have the code to display it on a webpage, my problem is in one field called Media, i have the text 'Physical' in it and i would like to change this within PHP to an image of a floppy disk when it displays on the webpage. Can this be done. I have done something similar with and if statement to display a 'tick' instead of a 1.
IF ( owned = 1, '✔', 'X' ) AS owned, IF ( completed = 1, '✔', ' ' ) AS completed i would like to do this as above rather than adding it to the MySQL database - the floppy image is on my computer in a folder called Images. For starters. I'm relatively new to PHP programming. I've had minor VB and I have SOME understanding of programming in general. I was trying to find this solution myself without consulting anyone but with PHP5 and it's deprecated functions. I can't just paste code from the net and it work. Currently I have PHP 5.3.5 installed. I'm running on the newest Apache and MySQL builds. Now to the part I want to get to work. I'm trying this just because I can. Basically. I would like php to scan a certain path and filter out the images. I have a script that does that fine. What I want to do is take the file names, append my host address and turn it into a clickable link. I also have a script that will turn text into URL's. I will paste the snippets I have. I was initially trying to use eregi_replace() but apparently that's been deprecated and I believe I should now use FileInfo() or something like that. Not quite sure what they do but am really wanting to learn. Thanks for any help you guys can offer. <?php $path = 'http://www.krasikart.no-ip.org'; $dir=$_SERVER['DOCUMENT_ROOT']."/htdocs/pics/"; $total = ''; // Retrieve all the images. $files = glob ("$dir{*.jpg,*.jpeg,*.gif}", GLOB_BRACE); // Confirm that matches were made. if (is_array($files)) { // Loop through the array. foreach ($files as $image) { $total = $path . $image; print "$total \n"; // The Regular Expression filter $reg_exUrl = "/(http|https|ftp|ftps)\:\/\/[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}(\/\S*)?/"; // The Text you want to filter for urls $text = "$total"; // Check if there is a url in the text if(preg_match($reg_exUrl, $text, $url)) { // make the urls hyper links echo preg_replace($reg_exUrl, '<a href="'.$url[0].'" rel="nofollow">'.$url[0].'</a>', $text); } else { // if no urls in the text just return the text } } } else { echo 'No files matched the search pattern!'; } ?> |