View previous topic :: View next topic |
Author |
Message |
motionbliss Newbie

Joined: 11 Jul 2005 Posts: 21
|
Posted: Thu Dec 01, 2005 3:43 pm Post subject: Passed URL string (lil help Andy?) |
|
|
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 |
|
 |
amnuts Site Admin

Joined: 01 Sep 2002 Posts: 662 Location: East Sussex, England
|
Posted: Fri Dec 02, 2005 4:58 am Post subject: |
|
|
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'], 0, strpos($_GET['url'], '?')); ?> |
Andy |
|
Back to top |
|
 |
motionbliss Newbie

Joined: 11 Jul 2005 Posts: 21
|
Posted: Fri Dec 02, 2005 5:06 am Post subject: |
|
|
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($url, 0, $g2pos);
} ?> |
|
|
Back to top |
|
 |
|
|
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
|