Loading...
Logo
Processing Forum
This is extremely basic, but I've searched everywhere and couldn't find an answer.

What I'm struggling to code is this (I'm just giving the principles of what I need):

one php site which has
a text box and a submit button and my processing sketch
on submitting the data, the sketch which is located on the same time, is updated - and, for example, displays the submitted text.

I think this is called forwarding a variable from php to processing(?). But I still can't find an answer nor code it myself being not educated in php. 

Replies(3)

I think you are mixing up a bit things...
If you have a (classical) submit button to a PHP site, the page will be reloaded (upon answer of the PHP script) and so will be the Processing sketch, restarting from scratch. Unless using tricks like submitting in a frame or using Ajax.
A more classical way to do what you describe is to use JavaScript code, inside the same page than the Processing sketch. By design, JavaScript and Java can communicate quite well in both directions (JS to J and back).
I suggest to do a little search on the (old) forum, this topic has been raised a few times.
Thanks for the reply!

If I would opt for the trick with submitting in an iframe, is Javascript <-> Java interaction what I should be looking for?
No need for an iframe with JavaScript...
And you can start looking on the Processing site itself.