#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2001
    Posts
    2
    Rep Power
    0

    calling javascript function from PHP


    How can we call javascript function for example confirm() window from PHP.? Would be highly appreciated if anyone can shed light on it with example.

    Thanks
  2. #2
  3. /(bb|[^b]{2})/

    Join Date
    Nov 2001
    Location
    Somewhere in the great unknown
    Posts
    5,163
    Rep Power
    792
    echo '<script language="JavaScript">confirm</script>';

    The only thing with this is that, if you are trying to access a javascript function during the processing of the php script it will not happen. PHP is server side scripting and javascript is client side, so they do not see each other. PHP is completely done by the time that javascript is able to do anything.

IMN logo majestic logo threadwatch logo seochat tools logo