Jump to content

Archived

This topic is now archived and is closed to further replies.

softmind82

Php Redirection code

Recommended Posts

i am using joomla content management system and i want to redirect the page to mypages.php after login authentication which is outside from joomla , how can i make that ......

-------------------------------------------
where and what code i should put to redirect it .

i made some changing with redirection but its redirection but without authentication .. check this www.desigeneration.co.uk

Thanks

Share this post


Link to post
Share on other sites
have to look in joomla's script and find where does the authenticate condition and if authenticated, redirect with a header or something. you'd probably have better luck finding where in their script it is by going to their website.

Share this post


Link to post
Share on other sites
[!--quoteo(post=379685:date=Jun 3 2006, 01:41 PM:name=Crayon Violent)--][div class=\'quotetop\']QUOTE(Crayon Violent @ Jun 3 2006, 01:41 PM) [snapback]379685[/snapback][/div][div class=\'quotemain\'][!--quotec--]
have to look in joomla's script and find where does the authenticate condition and if authenticated, redirect with a header or something. you'd probably have better luck finding where in their script it is by going to their website.
[/quote]

i am not fimilar to php .could u plz write me exact syntaz of php redirection code .

Thanks

Share this post


Link to post
Share on other sites
i can't write you the exact code, as i do not have a copy of joomla sitting in front me to figure out how they have their script setup. but as far as doing redirection in php:

[a href=\"http://www.php.net/header\" target=\"_blank\"]http://www.php.net/header[/a]

Share this post


Link to post
Share on other sites
From looking at the code it looks like you can supply a url prarameter called return

To do so you need to open up a file called [b]mod_login.php[/b] for editing which is in the [b]modules[/b] folder.

Scroll down to line 75 and you should find this:
[code]    <form action="<?php echo sefRelToAbs( 'index.php' ); ?>" method="post" name="login" >[/code]
change that to the following:
[code]    <form action="<?php echo sefRelToAbs( 'index.php' ); ?>?return=pagename.php" method="post" name="login" >[/code]
change where it says [b]pagename.php[/b] to the actuall file you want the users to be redirected to when they login.

I'm not sure that is the correct way to do it but have a quick look at the code it seems thats the way to do it. You can always ask how you can do such a thing over at the offical [a href=\"http://forum.joomla.org/\" target=\"_blank\"]joomla forum[/a]

Share this post


Link to post
Share on other sites
[!--quoteo(post=379713:date=Jun 3 2006, 02:39 PM:name=wildteen88)--][div class=\'quotetop\']QUOTE(wildteen88 @ Jun 3 2006, 02:39 PM) [snapback]379713[/snapback][/div][div class=\'quotemain\'][!--quotec--]
From looking at the code it looks like you can supply a url prarameter called return

To do so you need to open up a file called [b]mod_login.php[/b] for editing which is in the [b]modules[/b] folder.

Scroll down to line 75 and you should find this:
[code]    <form action="<?php echo sefRelToAbs( 'index.php' ); ?>" method="post" name="login" >[/code]
change that to the following:
[code]    <form action="<?php echo sefRelToAbs( 'index.php' ); ?>?return=pagename.php" method="post" name="login" >[/code]
change where it says [b]pagename.php[/b] to the actuall file you want the users to be redirected to when they login.

I'm not sure that is the correct way to do it but have a quick look at the code it seems thats the way to do it. You can always ask how you can do such a thing over at the offical [a href=\"http://forum.joomla.org/\" target=\"_blank\"]joomla forum[/a]
[/quote]

i did the same thing and in return it redirect to [b] mypage.php [/b] without authentication, i mean what ever i enter in login detail it just accept but that login information is not yet saved in datad base....... if you enter ghgjhg user and password whtever it it redirect to the page but i need login authentication before that ,
i would appreciate your help.
Thanks

CHeck this where i made a changing as u said.. www.desigeneration.co.uk


i have posted this probelm on joomla but i havnt received any reply fromlast 24 hours .

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.