DIGIT-ARC read-only archive · snapshot: July 23, 2026

How to run php through javascript

2 posts · originally from https://geek.digit.in/community/threads/how-to-run-php-through-javascript.102862/

Sreekuttan
Sreekuttan Original post #1
Nov 25, 2008 at 11:15 AM
hi,,

i want to execute php codes through javascript. is it possible?

thanks in advace..
QwertyManiac
Nov 25, 2008 at 4:10 PM
Eh?

PHP scripts run on the server (Pre-serve). JS runs on the client(Post-serve). You can't do that. Just re-think your approach, whatever it is that you're trying to do, instead of ugly-thinking your way through.

But what you can do is, call an alternative .php page with some arguments via JS. You can not, in any way, run PHP code in-line within JS.