Jump to content

Passing variables...


Dustin013

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

Archived

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

×
×
  • 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.