Dustin013 Posted June 23, 2008 Share Posted June 23, 2008 I am trying to modify a Joomla login script to pass the username to a php script running outside of Joomla. I know how to use forms to pass data between scripts but in this case this simply won't work. So basically the Joomla code that takes effect after the user submits their log in information (username and passwd) looks like so: // Get the information about the current user from the sessions table $my = $mainframe->getUser(); if ($option == 'login') { $mainframe->login(); // JS Popup message if ( $message ) { ?> <script language="javascript" type="text/javascript"> <!--// alert( "<?php echo addslashes( _LOGIN_SUCCESS ); ?>" ); //--> </script> <?php } What I was thinking is something like using $mobileuser = $_POST['username']; ($mobileuser being the variable that I would like to pass to another script containing the users current log in name) right below the code if ($option == 'login') { However, this seems to give me a warning about the headers already being used by one of Joomla's scripts... However, if I add the following below if ($option == 'login') { and before $mainframe->login(); I see the echo statement returning the username the user inputted into the form field. if ($option == 'login') { $mobileuser = $_POST['username']; echo $mobileuser; $mainframe->login(); So I need $mobileuser (or the value of 'username' that the user submitted on the log in form) passed to another script that isn't running under Joomla, any suggestions? Quote Link to comment https://forums.phpfreaks.com/topic/111576-passing-variables/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.