Jump to content

radioactive

New Members
  • Posts

    8
  • Joined

  • Last visited

    Never

Everything posted by radioactive

  1. It's working now, thanks. Is it also possible to change the font?
  2. I want to implement the code within other PHP, and HTML divs. I set the content type to image/png, which is currently the cause of my problem. The image will not display because the whole file is running off a certain content type. No other content will display either. Also, is it possible to set the font as well as the size? <?php header("Content-type: image/png"); $size = 10; $width = 700; $height = 200; $string = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed ut magna a odio auctor vulputate. Sed condimentum condimentum lorem, sit amet suscipit leo porta in. Integer justo risus, tincidunt sed blandit a, mollis eu enim. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Aliquam dictum, lorem euismod vulputate mattis, purus ligula tristique libero, id vulputate lorem est eget neque. Nulla turpis enim, lobortis eget suscipit ac, vestibulum et augue. Sed id magna quam. Curabitur interdum, tortor luctus egestas rhoncus, ipsum lectus rutrum metus, ut venenatis lorem enim et risus."; $image = imagecreate($width, $height); $background = ImageColorAllocate($image, 255, 255, 255); $color = imagecolorallocate ($image, 0, 0, 0); image_create($image, $size, 3, 2, $string, $color, $width); imagepng($image); function image_create($image, $size, $x, $y, $text, $color, $maxwidth) { $fontwidth = ImageFontWidth($size); $fontheight = ImageFontHeight($size); if ($maxwidth != NULL) { $maxchar = floor($maxwidth / $fontwidth); $text = wordwrap($text, $maxchar, "\n", 1); } $lines = explode("\n", $text); while (list($numl, $line) = each($lines)) { ImageString($image, $size, $x, $y, $line, $color); $y += $fontheight; } } ?>
  3. I figured out my problem, I had forgotten to use session_start
  4. This is my changed code, but nothing is echoing still. $memberQuery = $db->prepare("SELECT expiry FROM members WHERE username=:username"); $memberQuery->execute(array(':username' => $_SESSION['username'])); $result = $memberQuery->fetchColumn(0); echo "$result";
  5. I want to echo the contents of column 4 for my username only, and it doesn't show anything. I can do if ($memberQuery->fetchColumn(4) < 2) though. $host = 'localhost'; $database = ''; $db_username = ''; $db_password = ''; if (($db = new PDO("mysql:host=$host;dbname=$database", $db_username, $db_password)) == NULL) { echo $db->getMessage(); } $memberQuery = $db->prepare("SELECT * FROM members WHERE username=:username"); $memberQuery->execute(array(':username' => $_SESSION['username'])); $result = $memberQuery->fetchColumn(4); echo "$result";
  6. Yes it does solve my problem, thank you. In a sense, I was headed in the right direction.
  7. There are two things I want done. 1. Grab the current date in TIMESTAMP form and increase by a certain number of days as assigned by $days 2. Similar to the previous one, it will grab an already specified TIMESTAMP, and work from there All it echoes is 86400, which I assume is the number of seconds? <?php $days = 1; echo strtotime("+$days days", strtotime($date)); ?>
×
×
  • 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.