Jump to content

Search the Community

Showing results for tags 'wordpress image'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 1 result

  1. Normally I avoid asking for help but I am really confused. This is working on another site of mine. Pretty much a user enters their information and it auto generates using this code onto a image and then saves it. I am getting a different result then on the other and I am not sure why. working: http://www.drwayneandersen.com/display-cert/?cert_name=test Non: http://stopchallengechoose.com/testing-cert-display/?cert_name=testing Working: <?php require_once("http://www.drwayneandersen.com/wp-load.php"); require('./wp-blog-header.php'); //get_header(); $current_user = wp_get_current_user(); $email=$current_user->user_email; //echo "CURRENT TOP".$current_user->user_email; //ini_set('display_errors', 1); // you can set to 0 for production version //error_reporting(E_ALL); //echo "In the file"; function LoadJpeg() { //create the background image //if (file_exists($filename)) { // echo "The file $filename exists"; //} else { // echo "The file $filename does not exist"; //} $cert_id=30; if(isset($_REQUEST['cert_name'])){ $certname = $_REQUEST['cert_name']; } if(isset($_REQUEST['cert_id'])){ $cert_id = $_REQUEST['cert_id']; } if ($cert_id == 90) { $im = imagecreatefromjpeg('http://www.drwayneandersen.com/wp-content/uploads/2013/03/DrACertificate90Day.jpg'); $filename ="http://www.drwayneandersen.com/wp-content/uploads/2013/03/DrACertificate90Day.jpg"; } else if ($cert_id == 60) { $im = imagecreatefromjpeg('http://www.drwayneandersen.com/wp-content/uploads/2013/03/DrACertificate60Day.jpg'); $filename ="http://www.drwayneandersen.com/wp-content/uploads/2013/03/DrACertificate60Day.jpg"; } else { $im = imagecreatefromjpeg('http://www.drwayneandersen.com/wp-content/uploads/2013/02/cert.jpg'); $filename ="http://www.drwayneandersen.com/wp-content/uploads/2013/02/cert.jpg"; } /* See if it failed */ if(!$im) { /* Create a black image */ $im = imagecreatetruecolor(150, 30); $bgc = imagecolorallocate($im, 255, 255, 255); $tc = imagecolorallocate($im, 0, 0, 0); imagefilledrectangle($im, 0, 0, 150, 30, $bgc); /* Output an error message */ imagestring($im, 1, 5, 5, 'Error loading FILE ' . $filename, $tc); } $textcolor = imagecolorallocate($im, 89, 88, 93); $font = '/home1/drwaynea/public_html/arial.ttf'; imagettftext($im, 55, 0, 370, 1050, $textcolor, $font, $certname); // createCert($clientGoalImage[0], $im, $textColor, $fontfile, $clientGoalStatement[0], $galleryArray, $galleryCtr, $source); return $im; } header('Content-Type: image/jpeg'); $img = LoadJpeg(); $filePath='certs/'.$email.'/cert'.$cert_id.'.jpg'; $ckdirname = ("certs/" . "$email" . "/"); if (!(file_exists($ckdirname))) { mkdir("certs/" . "$email", 0777); } imagejpeg($img, $filePath); imagejpeg($img); imagedestroy($img); //get_footer(); ?> Not working <?php require_once("http://www.stopchallengechoose.com//wp-load.php"); require('./wp-blog-header.php'); //get_header(); $current_user = wp_get_current_user(); $email=$current_user->user_email; //echo "CURRENT TOP".$current_user->user_email; //ini_set('display_errors', 1); // you can set to 0 for production version //error_reporting(E_ALL); //echo "In the file"; function LoadJpeg() { //create the background image //if (file_exists($filename)) { // echo "The file $filename exists"; //} else { // echo "The file $filename does not exist"; //} $cert_id=30; if(isset($_REQUEST['cert_name'])){ $certname = $_REQUEST['cert_name']; } if(isset($_REQUEST['cert_id'])){ $cert_id = $_REQUEST['cert_id']; } if ($cert_id == 90) { $im = imagecreatefromjpeg('http://stopchallengechoose.com/wp-content/uploads/2014/03/certtesting.jpeg'); $filename ="http://stopchallengechoose.com/wp-content/uploads/2014/03/certtesting.jpeg"; } else if ($cert_id == 60) { $im = imagecreatefromjpeg('http://stopchallengechoose.com/wp-content/uploads/2014/03/certtesting.jpeg'); $filename ="http://stopchallengechoose.com/wp-content/uploads/2014/03/certtesting.jpeg"; } else { $im = imagecreatefromjpeg('http://stopchallengechoose.com/wp-content/uploads/2014/03/certtesting.jpeg'); $filename ="http://stopchallengechoose.com/wp-content/uploads/2014/03/certtesting.jpeg"; } /* See if it failed */ if(!$im) { /* Create a black image */ $im = imagecreatetruecolor(150, 30); $bgc = imagecolorallocate($im, 255, 255, 255); $tc = imagecolorallocate($im, 0, 0, 0); imagefilledrectangle($im, 0, 0, 150, 30, $bgc); /* Output an error message */ imagestring($im, 1, 5, 5, 'Error loading FILE ' . $filename, $tc); } $textcolor = imagecolorallocate($im, 89, 88, 93); $font = '/tank/www/users/medideascc/medideascc.pairserver.com/arial.ttf'; imagettftext($im, 55, 0, 370, 1050, $textcolor, $font, $certname); // createCert($clientGoalImage[0], $im, $textColor, $fontfile, $clientGoalStatement[0], $galleryArray, $galleryCtr, $source); return $im; } header('Content-Type: image/jpeg'); echo "<p>".$img."</p>"; $img = LoadJpeg(); $filePath='certs/'.$email.'/cert'.$cert_id.'.jpg'; $ckdirname = ("certs/" . "$email" . "/"); if (!(file_exists($ckdirname))) { mkdir("certs/" . "$email", 0777); } imagejpeg($img, $filePath); imagejpeg($img); imagedestroy($img); //get_footer(); ?>
×
×
  • 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.