Looking for solution for web development

You have two problems basically:

  1. web mode and php are diametrically opposed. by which I mean the xml and semicolon delimited php code can't reconciled into a context free grammar. therefore, the highlighting would have to be in one mode in one section and another in the others, making it a context sensitive grammar. Not saying this can't be done in emacs, but it doesn't exist to my knowledge.

  2. you're doing it wrong. like /u/bakuretsu says your php files should be able to read any static pages you host, so don't include html or javascript in your php files, presumably on a server on the interwebs.

Suppose you have an html "form" or any other markup you want to host. That should exist as a static html page somewhere for anyone to fetch. On that page the form links to its post controller. When this controller returns some error code is probably when you want to replace the username... with javascript, for code you want to run in the browser, just use javascript; as it runs in all modern browsers, whereas php does not. One might also argue that it is best to validate the input before sending to the controller, something like weak password could be prevented from being submitted at all with form validation.

/r/emacs Thread Parent