forum.coppermine-gallery.net

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

Code: [Select]
$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
Add this code into the top of your index.php

Code: [Select]
$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

Code: [Select]
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
$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
Code: [Select]
   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.