Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. How to embed javascript into php

How to embed javascript into php

Scheduled Pinned Locked Moved Web Development
javascriptphpdatabasetutorialquestion
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    georgiek50
    wrote on last edited by
    #1

    I am trying to embed some javascript into a php document w/ no success. Basically I want a confirmation messagebox to pop up when I am attempting to delete a record from a database and I need the PHP code to executed depending on the response (OK or Cancel). Can someone give me a small template as to how to put the two pieces of code together? Thanks in advance.

    A L 2 Replies Last reply
    0
    • G georgiek50

      I am trying to embed some javascript into a php document w/ no success. Basically I want a confirmation messagebox to pop up when I am attempting to delete a record from a database and I need the PHP code to executed depending on the response (OK or Cancel). Can someone give me a small template as to how to put the two pieces of code together? Thanks in advance.

      A Offline
      A Offline
      alex barylski
      wrote on last edited by
      #2

      try something like: "; else echo ""; // Normal no message ?> The word of the day is legs, let's go back to my house and spread the word ;P

      1 Reply Last reply
      0
      • G georgiek50

        I am trying to embed some javascript into a php document w/ no success. Basically I want a confirmation messagebox to pop up when I am attempting to delete a record from a database and I need the PHP code to executed depending on the response (OK or Cancel). Can someone give me a small template as to how to put the two pieces of code together? Thanks in advance.

        L Offline
        L Offline
        l a u r e n
        wrote on last edited by
        #3

        what u want is this:

        <a href='del_record.php?id=" . $row['id'] . "' onclick='if (confirm(\"DELETE RECORD - Are you sure?\") == false) return false'>[Del]</a>

        :)


        "there is no spoon"
        biz stuff   about me

        G 1 Reply Last reply
        0
        • L l a u r e n

          what u want is this:

          <a href='del_record.php?id=" . $row['id'] . "' onclick='if (confirm(\"DELETE RECORD - Are you sure?\") == false) return false'>[Del]</a>

          :)


          "there is no spoon"
          biz stuff   about me

          G Offline
          G Offline
          georgiek50
          wrote on last edited by
          #4

          Thanks

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups