Hello! I've written a script, to write text over an image. I use a form, to send Text, Font Color, Font Size and position over to my img.php file, where text is written over. Now, the only problem I currently have is, that after the image is created, I don't know how to save it :confused: I couldn't find and useful information on PHP.net, so i'm just gonna ask here. Source: PHP Code: <?php$text = $_POST['besedilo'];$im = "test.png";$color = $_POST['barva'];$size =
Articles similar to How to save image?:
Text in generated image won't wordwrap
For some reason, this is not wordwrapping after 17 characters like I want it to. Any ideas? (Also, I want the height of the image to be the height of the text, however many lines it ends up being)
Here's my code:
PHP Code:
<?php// Path to our font file$font = 'AvenirLTStd-Heavy.otf';$fontsize = 27;//Text to be written$helloworld = isset($_GET['text']) ? $_GET['text'] : "hello World";// word wrap$text2 = wordwrap($helloworld,17,true);// create a bounding box for the textIE text resize overrides my font-size in css
hi im a newbie, just made my first site and im having this problem. I set font-size in pixels for a couple of my divs such as the footer, but in IE when I re-size text the text in these divs changes which is terrible because i used ems for positioning and some sizes so it messes the whole layout.
This is part of my CSS:
CSS Code:
ul {
position:absolute;
top:214px;
left: 30px;
height: 55em;
border-right: 2px solid #f90;
padding-right: 60px;
font-size: 16px;
}
This is the corresponding div and ul:IE7 again - div, text and background-image
I'm stumped again. I have this CSS:
Code:
#FullScreenMessageDiv
{
float: right;
margin-right: 50px;
text-align: center;
padding-top: 0px;
border: 1px solid red;
}
#FullScreenMessageDiv .FullScreenMessageDivText
{
background-image: url(/images/MessageFlag.png);
color: #FFFFFF;
font-size: 10px; /* Not em, to make sure the size corresponds with the box */
padding-left: 10px;
padding-bottom: 2px;jQuery issue
JavaScript Code:
$('<a>', { class: 'prev page-numbers', href: '#', text: '«', click: function () { alert(this.text); } });
Unfortunately, the text displays as « not <<
it automatically converts & to & and I don't want it to...
thoughts?Security Question
I have written a security script for a contact page that does not have a database associated with it.
Here it is:
PHP Code:
$tokens = file('./tokens.txt', FILE_IGNORE_NEW_LINES);
if (in_array($_POST['token'], $tokens))
{
$name = $_POST['name'];
if (!preg_match("/[\w]+/", $name)) //verify $name contains only letters and spaces
{
Parse error: syntax error, unexpected T_VARIABLE, expecting ',' or ';'
problem line is between comments
PHP Code:
if(mysql_num_rows($result))
{
echo "<form action='#' method='post'><b><font size=2><b>Hammock Oaks Apartments</font> Rent Receipt:<br /><br />
while($row = mysql_fetch_assoc($result))
{
//*
echo "$name in apartment $apt has paid $amtpaid today $datepaid<br />";
//*
}
inserting custom data into database
hey guys I'm new to php, and trying to learn it by doing something thats how I learned other languagees, so here is the problem this is my form
PHP Code:
<form name="registration form" method="post" action="reg.php"><p>Username: <input type="text" name="user" /><br/><p>Password: <input type="password" name="password" /><br/>
