#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2012
    Posts
    56
    Rep Power
    2

    Open details in pop-up page


    Hi,

    I want to open details of a record in a pop up page. I found something I am tryin:

    PHP Code:
    <table width=150 border=0 align=left class=allborder> \n     <tr> \n         
          
    <td width=70><a href="javascript:window.open('/details.php?m_id=$sn','_blank','width=300','height=400')">$mtitle</td> \n              
    </tr>\
    But, there is an error am getting:

    Code:
    Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in C:\Program Files\Abyss Web Server\htdocs\My MOVIES - Multiple Search\select.php on line 183
    Any help, please.

    Joseph
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Jul 2003
    Posts
    3,403
    Rep Power
    594
    Is this within <?php ?> tags somewhere? Based on the syntax I assume it is. If so then you need to print or echo that output not just use it as a literal and expect it to output it with substitution.
    PHP Code:
    echo "
    <table width=150 border=0 align=left class=allborder> \n     <tr> \n         
          <td width=70><a href=\"javascript:window.open('/details.php?m_id="
    .urlencode($sn).",'_blank','width=300,height=400')\">$mtitle</a></td> \n              
    </tr>\n
    "

    I added the call to urlencode in case '$sn' has reserved characters in it. You were also missing the closing </a> tag which I added.
    There are 10 kinds of people in the world. Those that understand binary and those that don't.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2012
    Posts
    56
    Rep Power
    2

    Open details in pop-up page


    Originally Posted by gw1500se
    Is this within <?php ?> tags somewhere? Based on the syntax I assume it is. If so then you need to print or echo that output not just use it as a literal and expect it to output it with substitution.
    PHP Code:
    echo "
    <table width=150 border=0 align=left class=allborder> \n     <tr> \n         
          <td width=70><a href=\"javascript:window.open('/details.php?m_id="
    .urlencode($sn).",'_blank','width=300,height=400')\">$mtitle</a></td> \n              
    </tr>\n
    "

    I added the call to urlencode in case '$sn' has reserved characters in it. You were also missing the closing </a> tag which I added.

    Thank you so much.

    Stay well.

    Joseph

IMN logo majestic logo threadwatch logo seochat tools logo