forum.coppermine-gallery.net

Support => cpg1.4.x Support => Older/other versions => cpg1.4 miscellaneous => Topic started by: net on March 22, 2008, 09:39:55 pm

Title: [Solved]: Help making a <a href> with referer, is this possible?
Post by: net on March 22, 2008, 09:39:55 pm
Hi,

I've added your documented "hack" in displayimage.php to tell users to register and login to view full image

Code: [Select]
if (!USER_ID) cpg_die(ERROR, 'You need to <a href=register.php><u>register</u></a> and <a href=login.php><u>login</u></a> to view this page', __FILE__, __LINE__);
This works great, but i saw that the true login button does refer to the actual page the user was on when he clicked the login button, so once hes logged on he will be kicked back to the image he was trying to display.

I checked include/themes.inc.php to see what code is done and it seems that i need to add "login.php?referer=$REFERER" however this does not seem to work in html, any clue how i could do it another way?
Title: Re: Help making a <a href> with referer, is this possible?
Post by: Nibbler on March 22, 2008, 10:02:16 pm
Code: [Select]
if (!USER_ID) cpg_die(ERROR, 'You need to <a href="register.php">register</a> and <a href="login.php?referer='.$REFERER.'">login</a> to view this page', __FILE__, __LINE__);

Should work.
Title: Re: Help making a <a href> with referer, is this possible?
Post by: net on March 23, 2008, 03:58:54 am
Thanks once again Nibbler, you are much helpful!