Help me figure how how I made a mistake

Help me figure how how I made a mistake

timcadieuxtimcadieux Posts: 76Questions: 22Answers: 0
edited July 2009 in General
Folkz, I can't figure this one out. I have a Details link that i've added with an A HREF that points to a Target=new. This is so someone can use the filters, view something and not have to re-apply the filters.

Here's my question. The popup works perfectly fine, until I view the page when I'm an Admin. The ONLY difference is 1 line where I check for a Session variable and if it's valid, I add an Edit link that's also a popup.

As soon as I view the page as an admin, both links work, just not as popups?

Weird, ideas anyone? I know it's something dumb I did, I just can't see what.

[code]

$sOutput = '{';
$sOutput .= '"sEcho": '.$_GET['sEcho'].', ';
$sOutput .= '"iTotalRecords": '.$iTotal.', ';
$sOutput .= '"iTotalDisplayRecords": '.$iFilteredTotal.', ';
$sOutput .= '"aaData": [ ';
while ( $aRow = mysql_fetch_array( $rResult ) )
{
$sOutput .= "[";
$sOutput .= "'".$aRow['id']."',";
$sOutput .= "'".mysql_real_escape_string($aRow['fldsurname'])."',";
$sOutput .= "'".mysql_real_escape_string($aRow['fldfirstnameinitial'])."',";
$sOutput .= "'".mysql_real_escape_string($aRow['flddeceased'])."',";
$sOutput .= "'".mysql_real_escape_string($aRow['fldrank'])."',";
$sOutput .= "'".mysql_real_escape_string($aRow['fldservice'])."',";
$sOutput .= "'".mysql_real_escape_string($aRow['fldunit'])."',";
$sOutput .= "'".mysql_real_escape_string($aRow['fldcountry'])."',";
$sOutput .= "'".mysql_real_escape_string($aRow['fldcemetery'])."',";
$sOutput .= "'".mysql_real_escape_string($aRow['fldotherdetails'])."',";
$sOutput .= "'".mysql_real_escape_string("Details");

if ($_SESSION['SESS_ENABLED'] == 'Authenticated'){
$sOutput .= mysql_real_escape_string(" - Edit");
}

$sOutput .= "'";
$sOutput .= "],";
}
$sOutput = substr_replace( $sOutput, "", -1 );
$sOutput .= '] }';
[/code]
echo $sOutput;.

Replies

  • allanallan Posts: 63,508Questions: 1Answers: 10,471 Site admin
    Hi Tim,

    I can't see anything obviously wrong with it, although it might be worth making the HTML return valid. For example it should be:
  • timcadieuxtimcadieux Posts: 76Questions: 22Answers: 0
    Thx for the tips, I knew i was missign something. How i missed that html I won't understand.

    Anyhow, the JSON IS valid. here's an example.

    "aaData": [
    [
    "94191",
    "Aadland",
    "Richard",
    "12th February 1945 ",
    "Rifleman",
    "Army",
    "Regina Rifle Regiment RCIC",
    "The Netherlands",
    "Groesbeek Canadian War Cemetery ",
    "Age 40. Son of Mandius and Malena Aadland, of Chambery, Saskatchewan.\r\n
    ",
    "Details - Edit"
    ],

    The weird thing is that from the server_Processign file, the popup do work, just not from the Search.php ?


    Weird
  • allanallan Posts: 63,508Questions: 1Answers: 10,471 Site admin
    Hi Tim,

    Is the markup returned from the two different server-side scripts different? One thing off the top of my head - is the window 'new' controlled by you? I thought to get a new window to popup automatically when clicking a link the target should be "_blank", unless you have specified a window or frame which is already open with that name.

    Regards,
    Allan
This discussion has been closed.