Jump to content

PHP Pause


canadabeeau

Recommended Posts

Is there a way to only let PHP run a piece of code if another variable has a value. Now I know about if but I need it to loop, so it continues to check

 

while ($variable) { 
  //Do somehting
}

 

That's better. Use '!$variable' if you want to run something when it's empty

Link to comment
https://forums.phpfreaks.com/topic/185166-php-pause/#findComment-977456
Share on other sites

It is in relation to the fact that I have AJAX sending a JavaScript variable to process.php

process.php then echos that JS variable as a PHP variable

except its not, so I was wandering if it is becuase the JavaScript has not finished and got a result yet so I should make a loop untill it does and then echo

Link to comment
https://forums.phpfreaks.com/topic/185166-php-pause/#findComment-977459
Share on other sites

It is in relation to the fact that I have AJAX sending a JavaScript variable to process.php

process.php then echos that JS variable as a PHP variable

except its not, so I was wandering if it is becuase the JavaScript has not finished and got a result yet so I should make a loop untill it does and then echo

 

I read on your other thread you were requiring? That's not really what you're supposed to do, use the AJAX handler to get the response (i.e. ajax.response) and place it into what you wish the result to be:

 

document.lblmacaddress.value=ajax.response; ,placing the result of your php file when it is DONE, into your code. See how easy ajax is?

Link to comment
https://forums.phpfreaks.com/topic/185166-php-pause/#findComment-977463
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.