Skip to content

How to get overlay image from upload form #30

Description

@lamkute

hi,
im trying to get overlay image from upload form with this code but it not work.
please help.
Thank you!

   <form method="post" enctype="multipart/form-data">
   <table>
   <tr>
   <td>Upload Image*</td>
   <td><input type="file" name="uploadfile" /></td>
   </tr>

   <tr>
   <td colspan="2">
    <small><em>* Acceptable image formats include: GIF, JPG/JPEG and PNG.
	</em></small>
   </td>
   </tr>

   <tr>
   <td colspan="2" style="text-align: center;">
    <input type="submit" name="submit" value="Upload"/>
  </td>
  </tr>
  </table>
  </form>

<?php
if(isset($_POST['submit'])){
require_once('../src/PHPImage.php');

$bg = './img/benji.jpg';
$overlay = $_FILES['uploadfile']['tmp_name'];
$image = new PHPImage();
$image->setDimensionsFromImage($bg);
$image->draw($bg);
$image->draw($overlay, '50%', '75%');
....
$image->show();
}
?>

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions