I have a php script that I got from another guy and for some reason the login function does not work unless it opens up in a new window. (??? no idea why but that's just how it is) Anyways when I execute the open up window javascript from my PHP file, it opens up a whole bunch of windows. I figured that it was somehow looping, so I put the javascript function inside of a for loop that should only execute once. When I click my button, it opens up windows continously until I feverishly close them all and it stops.
Here is the code that seems to be the issue:
if(basename($_SERVER['PHP_SELF'])==USRFILE && (isset($_REQUEST['usr']) || isset($_REQUEST['susr']) || isset($_GET['mp']) || isset($_REQUEST['rc'])))
{
if(ISAJAX === 0) include(USRTEMPL.'head.php'); // if not Ajax request, include head.php (from USRTEMPL)
include(USRINCLS.'class.UsersReg.php'); // include the class for Register (used also for Recovery data)
ob_start(); // start storing output in buffer
// if 'susr'=Register, create objet of UsersReg (for Register)
// if 'rc' or 'mp' (for Recover-Confirma), uses UsersRecov class
// if 'usr', create object of UserPage class (for user page data)
if(isset($_REQUEST['susr']) && $_REQUEST['susr']==$lsite['users_logform']['register']) {
$objRe = new UsersReg($mysql);
echo $objRe->result;
for($x = 0; $x < 1; $x=2)
{
echo "<script type='text/javascript'>window.open('http://www.thelegendmaker.net/users.php?susr=Register');</script>";
}
}
else if(isset($_REQUEST['rc']) || isset($_GET['mp'])) {
include(USRINCLS.'class.UsersRecov.php'); //account recovery
$objRe = new UsersRecov($mysql);
for($x = 0; $x < 1; $x=2)
{
echo "<script type='text/javascript'>window.open('http://www.thelegendmaker.net/users.php?rc=Recover');</script>";
}
}
Specifically this section:
if(isset($_REQUEST['susr']) && $_REQUEST['susr']==$lsite['users_logform']['register']) {
$objRe = new UsersReg($mysql);
echo $objRe->result;
for($x = 0; $x < 1; $x=2)
{
echo "<script type='text/javascript'>window.open('http://www.thelegendmaker.net/users.php?susr=Register');</script>";
}
I tried looking up javascript opening up many windows but didn't find anything noteworthy. Same goes when I looked up php opening up a whole bunch of windows. It really makes no sense why it is looking, because it was looping before I put the for loop in. I put in the for loop to stop it, and it still loops.