coppermine-gallery.com/forum

No Support => Feature requests => Topic started by: 2newbie on June 15, 2005, 11:31:34 AM

Title: gallery/?user => gallery/profile.php?uid=2
Post by: 2newbie on June 15, 2005, 11:31:34 AM
Hello guys
i am a newbie in cpg users
i want to know can i do somthing like this

domain.com/gallery/?user

and go to profile page of user ( NOT USER GALLERY )

Example

domain.com/gallery/profile.php?uid=2

Tnx
Title: Re: gallery/?user => gallery/profile.php?uid=2
Post by: Nibbler on June 15, 2005, 03:36:30 PM
Add this code into the top of your index.php

$keys = array_keys($_GET);
$id = $keys[0];
if (is_numeric($id)){
header('Location: http://www.yoursite.com/coppermine/profile.php?uid='.$id)
exit;
}


Specify the actual url of your site in the code.
Title: Re: gallery/?user => gallery/profile.php?uid=2
Post by: Joachim Müller on June 16, 2005, 07:36:35 AM
NO SUPPORT in FEATURE REQUESTS (http://forum.coppermine-gallery.net/index.php?topic=15866.0)
Title: Re: gallery/?user => gallery/profile.php?uid=2
Post by: 2newbie on June 16, 2005, 01:06:22 PM
Quote from: Nibbler on June 15, 2005, 03:36:30 PM
Add this code into the top of your index.php

$keys = array_keys($_GET);
$id = $keys[0];
if (is_numeric($id)){
header('Location: http://www.yoursite.com/coppermine/profile.php?uid='.$id)
exit;
}


Specify the actual url of your site in the code.

I try this
but i get and error

Parse error: syntax error, unexpected T_EXIT in c:\wamp\www\pcg\index.php on line 25

???
Title: Re: gallery/?user => gallery/profile.php?uid=2
Post by: Tranz on June 16, 2005, 04:09:52 PM
Please post the actual code that you are using.
Title: Re: gallery/?user => gallery/profile.php?uid=2
Post by: 2newbie on June 16, 2005, 04:18:12 PM
$keys = array_keys($_GET);
$id = $keys[0];
if (is_numeric($id)){
   header('Location: http://www.yoursite.com/coppermine/profile.php?uid='.$id)
   exit;
}
Title: Re: gallery/?user => gallery/profile.php?uid=2
Post by: Tranz on June 16, 2005, 04:27:28 PM
Quote from: 2newbie on June 16, 2005, 04:18:12 PM
$keys = array_keys($_GET);
$id = $keys[0];
if (is_numeric($id)){
   header('Location: http://www.yoursite.com/coppermine/profile.php?uid='.$id)
   exit;
}
Your domain is yoursite.com?
Title: Re: gallery/?user => gallery/profile.php?uid=2
Post by: Joachim Müller on June 16, 2005, 06:09:52 PM
missing semicolon at the end of the line   header('Location: http://www.yoursite.com/coppermine/profile.php?uid='.$id)

2newbie: please don't make it so hard for us to support: if you're asked to paste the actual code, then you shouldn't replace stuff with pseudo-code like "yoursite.com", as it's likely to introduce errors.