Jump to content


Photo

Php Redirection code


  • Please log in to reply
5 replies to this topic

#1 softmind82

softmind82
  • New Members
  • Pip
  • Newbie
  • 6 posts

Posted 03 June 2006 - 06:34 PM

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

#2 .josh

.josh
  • Staff Alumni
  • .josh
  • 14,871 posts

Posted 03 June 2006 - 06:41 PM

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.
Did I help you? Feeling generous? Buy me lunch! 
Please, take the time and do some research and find out how much it would have cost you to get your help from a decent paid-for source. A "roll-of-the-dice" freelancer will charge you $5-$15/hr. A decent entry level freelancer will charge you around $15-30/hr. A professional will charge you anywhere from $50-$100/hr. An agency will charge anywhere from $100-$250/hr. Think about all this when soliciting for help here. Think about how much money you are making from the work you are asking for help on. No, we do not expect you to pay for the help given here, but donating a few bucks is a fraction of the cost of what you would have paid, shows your appreciation, helps motivate people to keep offering help without the pricetag, and helps make this a higher quality free-help community :)

#3 softmind82

softmind82
  • New Members
  • Pip
  • Newbie
  • 6 posts

Posted 03 June 2006 - 07:10 PM

[!--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) View Post[/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

#4 .josh

.josh
  • Staff Alumni
  • .josh
  • 14,871 posts

Posted 03 June 2006 - 07:19 PM

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]
Did I help you? Feeling generous? Buy me lunch! 
Please, take the time and do some research and find out how much it would have cost you to get your help from a decent paid-for source. A "roll-of-the-dice" freelancer will charge you $5-$15/hr. A decent entry level freelancer will charge you around $15-30/hr. A professional will charge you anywhere from $50-$100/hr. An agency will charge anywhere from $100-$250/hr. Think about all this when soliciting for help here. Think about how much money you are making from the work you are asking for help on. No, we do not expect you to pay for the help given here, but donating a few bucks is a fraction of the cost of what you would have paid, shows your appreciation, helps motivate people to keep offering help without the pricetag, and helps make this a higher quality free-help community :)

#5 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 03 June 2006 - 07:39 PM

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 mod_login.php for editing which is in the modules folder.

Scroll down to line 75 and you should find this:
    <form action="<?php echo sefRelToAbs( 'index.php' ); ?>" method="post" name="login" >
change that to the following:
    <form action="<?php echo sefRelToAbs( 'index.php' ); ?>?return=pagename.php" method="post" name="login" >
change where it says pagename.php 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]

#6 softmind82

softmind82
  • New Members
  • Pip
  • Newbie
  • 6 posts

Posted 03 June 2006 - 07:57 PM

[!--quoteo(post=379713:date=Jun 3 2006, 02:39 PM:name=wildteen88)--][div class=\'quotetop\']QUOTE(wildteen88 @ Jun 3 2006, 02:39 PM) View Post[/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 mod_login.php for editing which is in the modules folder.

Scroll down to line 75 and you should find this:
    <form action="<?php echo sefRelToAbs( 'index.php' ); ?>" method="post" name="login" >
change that to the following:
    <form action="<?php echo sefRelToAbs( 'index.php' ); ?>?return=pagename.php" method="post" name="login" >
change where it says pagename.php 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 mypage.php 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 .




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users