andy's php projects
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
Script and site usage:
All of the scripts on this site are provided free for non-commerical, personal or non-profit use. If you find these scripts useful to you, appreciate the free support, or are just an all round nice person, then why not donate a little dosh? If you wish to use any of these in a commercial system, please refer to the payment plan.


'static' variable passing issue

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    php.amnuts.com Forum Index -> Crop Canvas
View previous topic :: View next topic  
Author Message
rjlowe
Newbie


Joined: 21 Feb 2005
Posts: 2

PostPosted: Tue Feb 22, 2005 4:13 pm    Post subject: 'static' variable passing issue Reply with quote

Cropping and interface work great, btw!

here's the issue, I submit a couple of values to the page that is using the cropinterface, but since the interface submits to itself, I lose those variables and an unable to pass them along to the next set of pages after the cropping is complete. Is there a work-around? can I just submit those 'static' variables along with the other data, where ci will just ignore them and pass them along with it's self-submission? How would I go about doing this? Or is there an easier way to do this that I'm missing. Thanks in advance!

For example, I'm wanting users to only be able to upload 3 images at a time, tracked with $imgnum (3 or less), and I want to track their original filename for the final report I display when they are done uploading/cropping images, $imgorigname

I originally had something like
$ci->loadImage($_GET['file']);
$ci->cropToDimensions($_GET['sx'], $_GET['sy'], $_GET['ex'], $_GET['ey']);
$ci->saveImage('upload_dir/cropped/test.jpg', 100);
<meta http-equiv='refresh' content=1;url='validateimg.php?myimage='$imgorigname'&num='$imgnum'>

but... that doesn't work because by this time $imgnum and $imgorigname have been wiped out by, I suspect, the self-submission from the cropping button. (?) How do I preserve those old variables?

--RJ
Back to top
View user's profile Send private message
rjlowe
Newbie


Joined: 21 Feb 2005
Posts: 2

PostPosted: Tue Feb 22, 2005 11:34 pm    Post subject: OK - figured it out, at least one way around it Reply with quote

Kinda feel dumb, but I'm new to this, so it was terribly easy to fix, just by using $_SESSION variables for those things I wish to keep around for a few pages Razz

Live and learn, hehe. LOVE THE SCRIPT by the way, it's a lifesaver!

--RJ
Back to top
View user's profile Send private message
amnuts
Site Admin


Joined: 01 Sep 2002
Posts: 662
Location: East Sussex, England

PostPosted: Wed Feb 23, 2005 3:47 am    Post subject: Reply with quote

Hi RJ, and welcome to the board!

Well done for sorting it out. Smile If you didn't want to use sessions, but instead wanted to pass the information along in the query string, then check out this thread:

http://php.amnuts.com/forums/viewtopic.php?t=167

It adds a new method to the class and tweaks some of the javascript output, but gives the ability to add extra parameters.

Glad you like the script! Smile

Andy
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    php.amnuts.com Forum Index -> Crop Canvas All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group