Printable Version of Topic

Click here to view this topic in its original format

HTMLHelp Forums _ Server-side Scripting _ Watermark

Posted by: tudsy Apr 2 2018, 08:34 AM

Hi

I have decided to do the watermarking by php. At the moment, I am having problems in converting from jS to php and php to js.
Can any one help?


The relevant code is in the picname function in ecovib2d_adriant.php.


Thanks.


Attached File(s)
Attached File  ecovib2d_adriant.php ( 16.23k ) Number of downloads: 631

Posted by: CharlesEF Apr 4 2018, 03:16 PM

I haven't had time to go over your code. But, since you want to use PHP now have you looked at this http://php.net/manual/en/image.examples-watermark.php?

Posted by: CharlesEF Apr 8 2018, 01:54 PM

Ok, I glanced over your code. I didn't get very far when I saw this:

CODE
var path = 'http://103.226.223.161/~ecovibdc/ECOVIB2D/MYART/' +  personname + '/Graphic/' + picname;
. Then I saw this:
CODE
<?php $path='"+path+"'; watermarkImage ($path,'ECOVIB2D©', $picnamew); ?>
. It looks like you defined a javascript variable and then tried to use that variable in a PHP call. As far as I know, you can't do it that way. If you have a javascript variable you want to use in PHP then you must send that variable to the server for PHP to use. You do that using a POST or GET request. Seems to me your watermark function should be setup to work using AJAX. Your current code will not pass the javascript variable to the server so your PHP $path variable isn't what you think it is.

Posted by: CharlesEF Apr 11 2018, 06:42 PM

Well, I haven't heard anything from you. Did you get it working? Attached is a couple of sample files: 'test.php' will show a watermarked image when you load the page. 'test.html' will let you select a picture from the drop down. Once a picture is selected a javascript AJAX call is made to display the watermarked image on screen.

If you haven't got it working then these examples should help.
Attached File  watermark.zip ( 282.07k ) Number of downloads: 881

Posted by: tudsy Apr 13 2018, 10:03 PM

QUOTE(CharlesEF @ Apr 12 2018, 09:12 AM) *

Well, I haven't heard anything from you. Did you get it working? Attached is a couple of sample files: 'test.php' will show a watermarked image when you load the page. 'test.html' will let you select a picture from the drop down. Once a picture is selected a javascript AJAX call is made to display the watermarked image on screen.

If you haven't got it working then these examples should help.
Attached File  watermark.zip ( 282.07k ) Number of downloads: 881




No I have not got it working and thank you for the examples.

Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)