Forum Moderators: coopster

Message Too Old, No Replies

php url redirect with $ GET function

please help me :o(

         

paxoooo

12:48 pm on Aug 6, 2006 (gmt 0)

10+ Year Member



Hi all!

Got a bit of a problem, I'm trying to get my user's ID into a url using php redirect. This is what I've got at the moment..

<?php

defined( '_VALID_MOS' ) or die( 'Restricted access' );

global $my;
if ( $my->id ) {

}
header("Location: http://www.example.com/".$_GET[$my->id]);
exit;

?>

I'm not a PHP expert, so I'm not sure what's going on, I'd really really appreciate a reply!

I also need to have it so that it only does the user id when there logged in!

Thanks in advance,

Steve

AjiNIMC

6:10 pm on Aug 6, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If I could understand your question, this is what you wanted.


<?php
defined( '_VALID_MOS' ) or die( 'Restricted access' );

global $my;
if ( $my->id ) {
header("Location: http://www.example.com/".$my->id;
exit;
}

?>

paxoooo

9:44 pm on Aug 6, 2006 (gmt 0)

10+ Year Member



Thank you so much, exactly what I was looking for!

Much appreciated!

You've done me a massive favour!