Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: gallery/?user => gallery/profile.php?uid=2  (Read 11187 times)

0 Members and 1 Guest are viewing this topic.

2newbie

  • Coppermine newbie
  • Offline Offline
  • Posts: 4
gallery/?user => gallery/profile.php?uid=2
« 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
« Last Edit: June 16, 2005, 01:12:58 pm by 2newbie »
Logged

Nibbler

  • Guest
Re: gallery/?user => gallery/profile.php?uid=2
« Reply #1 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.
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Logged

2newbie

  • Coppermine newbie
  • Offline Offline
  • Posts: 4
Re: gallery/?user => gallery/profile.php?uid=2
« Reply #3 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
 ???
Logged

Tranz

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Female
  • Posts: 6149
Re: gallery/?user => gallery/profile.php?uid=2
« Reply #4 on: June 16, 2005, 04:09:52 pm »

Please post the actual code that you are using.
Logged

2newbie

  • Coppermine newbie
  • Offline Offline
  • Posts: 4
Re: gallery/?user => gallery/profile.php?uid=2
« Reply #5 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;
}
Logged

Tranz

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Female
  • Posts: 6149
Re: gallery/?user => gallery/profile.php?uid=2
« Reply #6 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?
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: gallery/?user => gallery/profile.php?uid=2
« Reply #7 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.
Logged
Pages: [1]   Go Up
 

Page created in 0.021 seconds with 19 queries.