Hello all,
I have a registration form that creates a user and a software License. Once the new user is activated and logged in they have a new form available to them that shows them their user info - including their license info and reveals a download link that has the license data attached already for them.
I have had this working fine for some time - but then I was asked to create a Session variable that would distinguish between visitors from the US and those outside the US (which I call "INTERNATIONAL")This has caused the download script to complain. So instead of writing this:
I would like to simply call a install.php script from the form and send it the 3 variables $login, $name, $version
how can I do that if the script is outside of the Joomla?
Thanks,
I have a registration form that creates a user and a software License. Once the new user is activated and logged in they have a new form available to them that shows them their user info - including their license info and reveals a download link that has the license data attached already for them.
I have had this working fine for some time - but then I was asked to create a Session variable that would distinguish between visitors from the US and those outside the US (which I call "INTERNATIONAL")This has caused the download script to complain. So instead of writing this:
<?php
$user =& JFactory::getUser();
$uid = $user->id;
global $mainframe;
$database =& JFactory::getDBO();
$database->setQuery( '
SELECT
license_start,
license_duration,
key_code,
first_name,
last_name,
user_email,
title,
vm_hospitalaffiliation,
address_1,
address_2,
city,
state,
country,
zip
FROM jos_vm_product_license a, jos_vm_user_info b
WHERE a.user_id = '.$uid.'
AND a.user_id = b.user_id');
$database->query();
$licenseinfo = $database->loadAssoc();
$dLicense = 6 * 2592000; //this multiplies the duration by num seconds in a month - I now only want 90 days no matter what
$nTime = $dLicense + $licenseinfo['license_start']; // this gives us the expiration date - should always be 90 days out*
?>
<div style="position:relative; top:23px; padding:7px; text-align=left;">
<?php
//## code for creating the installer##//
require_once '../test.mysite.com/mysite_api/inc/functions.php';
$license = $licenseinfo['key_code'];
$name = $user->username;
if($_SESSION['country'] != "USA Website")
{
$version = "International";
}
else
{
$version = "US";
}
if (chdir('../test.mysite.com/mysite_api/nsis/users'))
{
$outdir = getcwd() . '/' . $name;
if(!is_dir($outdir))
{
mkdir ( $outdir );
}
if($license == '')
{
if($version == '')
{
$cmd = "makensis " .
" -DMYOUTDIR=\"" . $outdir . "\"" .
" -DSURGIMAPVERSION=\".\"" .
" MySoftware.nsi";
}else{
$cmd = "makensis " .
" -DMYOUTDIR=\"" . $outdir . "\"" .
" -DSURGIMAPVERSION=\"" . $version . "\"" .
" MySoftware.nsi";
}
}else{
if($version == '')
{
$cmd = "makensis " .
" -DMYOUTDIR=\"" . $outdir . "\"" .
" -DSURGIMAPVERSION=\".\"" .
" -DUSERNAME=\"" . $name . "\"" .
" -DLICENSE=\"" . $license . "\"" .
" MySoftware.nsi";
}else{
$cmd = "makensis " .
" -DMYOUTDIR=\"" . $outdir . "\"" .
" -DSURGIMAPVERSION=\"" . $version . "\"" .
" -DUSERNAME=\"" . $name . "\"" .
" -DLICENSE=\"" . $license . "\"" .
" MySoftware.nsi";
}
}
exec($cmd,$output,$rval);
}
echo $version."
";
echo '<a href = "surgimap_api/download.php?login='.$name.'&file=SurgimapSetup.exe" ><img src="/images/stories/download.jpg" border="0" alt="Download Now" title="Download Now" hspace="0" vspace="0" onmouseover="this.src=\'images/stories/download_hover.jpg\';" onmouseout="this.src=\'images/stories/download.jpg\';" /></a><BR>'."
";
//echo "<div style=\"width:733px\"><p>" . print_r($cmd,TRUE) . "</p></div>";
echo "<div style=\"width:333px\"><pre><font size='1'><b>Return Value: " . $rval . "</b><br/>" . print_r($output,TRUE) . "</font></pre></div>";
?>
</div>
I would like to simply call a install.php script from the form and send it the 3 variables $login, $name, $version
how can I do that if the script is outside of the Joomla?
Thanks,