# Processing JS, HTML and PHP issue

**URL:** <https://discourse.processing.org/t/processing-js-html-and-php-issue/18372>\
**Category:** Coding Questions\
**Created:** [March 4, 2020, 12:12am UTC](https://discourse.processing.org/t/processing-js-html-and-php-issue/18372 "2020-03-04T00:12:48Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vickydcl](https://avatars.discourse-cdn.com/v4/letter/v/f14d63/32.png) [@Vickydcl](https://discourse.processing.org/u/Vickydcl)\
**Post date:** [March 4, 2020, 12:12am UTC](https://discourse.processing.org/t/processing-js-html-and-php-issue/18372/1 "2020-03-04T00:12:48Z")

</div>

I’ve made a processing sketch that I had upload on my website (localhost). But the buttons that I programmed doesn’t work because i’m using the “selectInput” function that is not avaible in web. So, I guess I need to make that button in HTML, but i don’t know how to connect it with the processing sketch (I insert the sketch with echo script type etc.)

I have a second question, how do I connect that processing sketch with a data base? I need to save the last picture that a guy upload so the next guy that enters to the web can see it.

Thanks for reading!

---

<div class="post-metadata">

**Author:** ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)\
**Post date:** [March 5, 2020, 7:25pm UTC](https://discourse.processing.org/t/processing-js-html-and-php-issue/18372/2 "2020-03-05T19:25:19Z")

</div>

Have you considered using p5.js rather than processing.js? It has p5.DOM and the third party p5.blizzard, which might enable you to work with html elements of all kinds.

[https://p5js.org/examples/dom-modifying-the-dom.html](https://p5js.org/examples/dom-modifying-the-dom.html)

I believe that you can also mix p5.js with other javascript more easily than Processing.JS – although I’m not a Processing.JS expert.

---

<div class="post-metadata">

**Author:** ![GoToLoop](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/gotoloop/32/86_2.png) [@GoToLoop](https://discourse.processing.org/u/GoToLoop)\
**Post date:** [March 5, 2020, 9:53pm UTC](https://discourse.processing.org/t/processing-js-html-and-php-issue/18372/3 "2020-03-05T21:53:12Z")

</div>

> [@jeremydouglass](#):
>
> I believe that you can also mix p5.js with other javascript more easily than Processing.JS –

If we use Pjs as a JS library, we can use any vanilla JS libraries on it as well. 🥳

For example, this is a Pjs sketch written in CoffeeScript transpiled to JS: ☕

- [GitHub.com/GoSubRoutine/Ball-in-the-Chamber/tree/master/pjs-cs](http://GitHub.com/GoSubRoutine/Ball-in-the-Chamber/tree/master/pjs-cs)
- [GoSubRoutine.GitHub.io/Ball-in-the-Chamber/pjs-cs](http://GoSubRoutine.GitHub.io/Ball-in-the-Chamber/pjs-cs)

And now that same Pjs sketch written in Processing’s Java Mode: ☕

- [GitHub.com/GoSubRoutine/Ball-in-the-Chamber/tree/master/pjs-java](http://GitHub.com/GoSubRoutine/Ball-in-the-Chamber/tree/master/pjs-java)
- [GoSubRoutine.GitHub.io/Ball-in-the-Chamber/pjs-java](http://GoSubRoutine.GitHub.io/Ball-in-the-Chamber/pjs-java)

But if we end up converting a Java Mode sketch to use the JS syntax (or another JS transpilable language), there’s little reason to target the old Pjs instead of the current p5js library though. 🙄
