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.


Passed URL string (lil help Andy?)

 
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 -> Drop Shadowed Thumbnail Creator
View previous topic :: View next topic  
Author Message
motionbliss
Newbie


Joined: 11 Jul 2005
Posts: 21

PostPosted: Thu Dec 01, 2005 3:43 pm    Post subject: Passed URL string (lil help Andy?) Reply with quote

Hi Andy -- I could really use your help with something...

I've got a Gallery app that I'm using and adding a dropshadow to on the fly, but at the beginning of each session, it appends a string of characters to end of the image path. Do you think you'd be able to help me filter it out?



Take a peek at this thread (or below) to see this problem:
http://gallery.menalto.com/node/40941

Code:
http://travelvice.com/support/alterimage.php?url=http://snapshots.travelvice.com/download/1495-8/thailand.jpg?g2_GALLERYSID=6d9ba394bdecb7fed172ff65f56e81ee


Thanks for the brain power Andy!

- Craig


Last edited by motionbliss on Fri Dec 02, 2005 5:05 am; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website
amnuts
Site Admin


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

PostPosted: Fri Dec 02, 2005 4:58 am    Post subject: Reply with quote

OK, so if I understand it, you have a url posted to a webpage that looks like:

Code:
http://travelvice.com/support/alterimage.php?url=http://snapshots.travelvice.com/download/1495-8/thailand.jpg?g2_GALLERYSID=6d9ba394bdecb7fed172ff65f56e81ee


And given $_GET['url'], which looks like:

Code:
http://snapshots.travelvice.com/download/1495-8/thailand.jpg?g2_GALLERYSID=6d9ba394bdecb7fed172ff65f56e81ee


You want to be able to extract just the url not including the query string, right?

If so, that's easy!

PHP:
<?php $url substr($_GET['url'], 0strpos($_GET['url'], '?')); ?>


Andy
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
motionbliss
Newbie


Joined: 11 Jul 2005
Posts: 21

PostPosted: Fri Dec 02, 2005 5:06 am    Post subject: Reply with quote

That's perfect Andy!

It turned into this on my end...

PHP:
<?php //check for (and remove) Gallery 2 session marker
        
$g2pos strpos($url'?g2_GALLERYSID');
        if (
$g2pos !== false) {
            
$url substr($url0$g2pos);
        } 
?>
Back to top
View user's profile Send private message Visit poster's website
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 -> Drop Shadowed Thumbnail Creator 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