Jump to content

php and javascript


Dathremar

Recommended Posts

Once again I need your help guys and girls.

 

I was wandering if there is a way to call a javascript confirm popup within a php code and use that confirmation info (yes/no-> true/false w/e) to continue with the php functions.

 

Example

 

if ($variable == 0)

{

  call confirm;

          if (yes)

          {

          some code;

          }

}

 

Thanks in advance

Link to comment
https://forums.phpfreaks.com/topic/97989-php-and-javascript/
Share on other sites

You would need to use Ajax (or some other javascript method of making a http request to the php page to pass the data.)

 

When the javascript/popup executes in the browser, the php code on the page has long since ended as the php code was executed when the page was requested and sent to the browser.

Link to comment
https://forums.phpfreaks.com/topic/97989-php-and-javascript/#findComment-501359
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.