Jump to content

Recommended Posts

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?

Link to comment
https://forums.phpfreaks.com/topic/111576-passing-variables/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.