window.open in a php script

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Joker7

    #1

    window.open in a php script

    Hi-I'm stuck again can anyone help me out here.
    I'm trying to open a frame less window (popup) from within a PHP script
    this is what it looks like before I had a play :((

    $link = "<a
    href=\"news.php ?renew=0&mid=". $message_info->tp_message_id. "&sign=".$sign. "\
    ">";

    My try:(

    $link = '<a href="news.php? renew=0&mid="'. $message_info-onClick="javasc ript:
    window.open('ht tp://"news.php?renew =0&mid="'.$mess age_info-','rad','width= 25
    0,height=285,to p=200,left=300, screenX=200,scr eenY=300,scroll bars=no,resizab l
    e=no');return false;" target="_self"> tp_message_id.' &sign='.$sign.' >';

    With my try the whole thing goes to pot.

    Parse error: parse error, unexpected '=' in
    /home/site/public_html/news/web/show_header.php on line 450

    Regards
    Chris



  • Lee

    #2
    Re: window.open in a php script

    Joker7 said:[color=blue]
    >
    >Hi-I'm stuck again can anyone help me out here.
    >I'm trying to open a frame less window (popup) from within a PHP script
    >this is what it looks like before I had a play :((
    >
    >$link = "<a
    >href=\"news.ph p?renew=0&mid=" .$message_info->tp_message_id. "&sign=".$sign. "\
    >">";
    >
    >My try:(
    >
    >$link = '<a href="news.php? renew=0&mid="'. $message_info-onClick="javasc ript:
    >window.open('h ttp://"news.php?renew =0&mid="'.$mess age_info-','rad','width= 25
    >0,height=285,t op=200,left=300 ,screenX=200,sc reenY=300,scrol lbars=no,resiza bl
    >e=no');retur n false;" target="_self"> tp_message_id.' &sign='.$sign.' >';
    >
    >With my try the whole thing goes to pot.
    >
    >Parse error: parse error, unexpected '=' in
    >/home/site/public_html/news/web/show_header.php on line 450[/color]

    When you cause PHP errors by modifying PHP code that you
    don't understand, you should ask for help in a PHP group.

    Comment

    • Joker7

      #3
      Re: window.open in a php script


      "Lee" <REM0VElbspamtr ap@cox.net> wrote in message
      news:ct0ksf02de v@drn.newsguy.c om...
      : header.php on line 450
      :
      : When you cause PHP errors by modifying PHP code that you
      : don't understand, you should ask for help in a PHP group.
      :

      I have and PHP groups say go and ask in Javascript groups :(( as it's a
      Javascript problem.

      Chris


      Comment

      • Mick White

        #4
        Re: window.open in a php script

        Joker7 wrote:

        [color=blue]
        >
        > I have and PHP groups say go and ask in Javascript groups :(( as it's a
        > Javascript problem.
        >
        > Chris
        >
        >[/color]

        Definitely a PHP problem, the javascript is never called.
        Mick

        Comment

        • Lee

          #5
          Re: window.open in a php script

          Joker7 said:[color=blue]
          >
          >
          >"Lee" <REM0VElbspamtr ap@cox.net> wrote in message
          >news:ct0ksf02d ev@drn.newsguy. com...
          >: header.php on line 450
          >:
          >: When you cause PHP errors by modifying PHP code that you
          >: don't understand, you should ask for help in a PHP group.
          >:
          >
          >I have and PHP groups say go and ask in Javascript groups :(( as it's a
          >Javascript problem.[/color]

          They're just trying to blow you off.

          Here's the line before you mangled it. I've separated it into separate lines at
          the concatination operators "."

          $link = "<a href=\"news.php ?renew=0&mid=" .
          $message_info->tp_message_i d .
          "&sign=" .
          $sign .
          "\">";

          Every thing there from the opening \" (on the first line) to the closing
          \" (on the last line) is what's being assigned to the HREF attribute.

          When you edited it, you dropped code beginning with "onClick" right smack
          in the middle of the second operand. That's a PHP error.

          the beginning of the line you wound up with is:

          $link = '<a href="news.php? renew=0&mid="' .
          $message_info-onClick="javasc ript:window.ope n('http://"

          I'm guessing that you thought that the ">" marked the end of the
          <a> tag, but in this context, it was actually part of the "->" operator.
          So, in addition to breaking the "$message_i nfo->tp_message_i d" identifier,
          you've added a second "=" to an assignment statement. That's what the PHP
          compiler was complaining about.

          These are all PHP errors.

          Comment

          • Hywel Jenkins

            #6
            Re: window.open in a php script

            In article <35i1ioF4n1mc6U 1@individual.ne t>, sat_ring@hotmai l.com
            says...[color=blue]
            > Hi-I'm stuck again can anyone help me out here.
            > I'm trying to open a frame less window (popup) from within a PHP script
            > this is what it looks like before I had a play :((
            >
            > $link = "<a
            > href=\"news.php ?renew=0&mid=". $message_info->tp_message_id. "&sign=".$sign. "\
            > ">";
            >
            > My try:(
            >
            > $link = '<a href="news.php? renew=0&mid="'. $message_info-onClick="javasc ript:
            > window.open('ht tp://"news.php?renew =0&mid="'.$mess age_info-','rad','width= 25
            > 0,height=285,to p=200,left=300, screenX=200,scr eenY=300,scroll bars=no,resizab l
            > e=no');return false;" target="_self"> tp_message_id.' &sign='.$sign.' >';
            >
            > With my try the whole thing goes to pot.
            >[/color]

            That's because you're mucking around with the apostrophes. You start
            your string with ', then you have them in your window.open function,
            then you have them dotted through the code. Use \'.

            --
            Hywel http://kibo.org.uk/
            I do not eat quiche.

            Comment

            Working...