can you embed javascript in php?

Discussion in 'PHP' started by whiteblue1942, Apr 15, 2008.

  1. #1
    can you embed javascript in php liek this....

    if (this is true){
    <javascript> send javascript alert box</javascript>
    }



    i know the syntax is wrong but u get the idea...is this possible?
     
    whiteblue1942, Apr 15, 2008 IP
  2. bartolay13

    bartolay13 Active Member

    Messages:
    735
    Likes Received:
    14
    Best Answers:
    1
    Trophy Points:
    98
    #2
    yep. its possible, anyways you already wrote the answer.
     
    bartolay13, Apr 15, 2008 IP
  3. bartolay13

    bartolay13 Active Member

    Messages:
    735
    Likes Received:
    14
    Best Answers:
    1
    Trophy Points:
    98
    #3
    whoa.. i didnt read inside the <script> tag...
    put your js into function.
     
    bartolay13, Apr 15, 2008 IP
  4. Sabbir

    Sabbir Banned

    Messages:
    210
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    58
    #4
    uh. i think you need to use "echo" or "print" to use javascript.
     
    Sabbir, Apr 15, 2008 IP