Hi,
I have a general knowledge of html, php, and coding logic concepts themselves. I've used other CMS platforms and Modx Revo really shines.
Having generalized concepts, I'm missing a good chunk of connective understanding, mainly, how to write a php script where the variables are not determined within the script, but are modified by user input.
Seems like a fairly obvious question, however several hours of internet searches (passing in to the next day) leaves me dead.
The best information I can find that touches on this plainly, and concisely is:
http://www.webmonkey.com/2010/02/php_tutorial_for_beginners/
Here's the quote, because you more than likely won't need to read the link:
"HTML Forms and PHP
In our examples so far, we have set variables and then used them all in the same code. This doesn’t make much sense because in those instances, we could have just hard-coded the values instead of using variables."
Yup.
Anyway, I've gathered the idea is to line the html up to submit the information to a php script (or file) and then tailor this file to properly read the information that has been submitted to it, but I'm stumped on Modx Revo's version of this.
The best I can seem to manage is that with syntax such as ||!theSnippet? &variable='whatever is put in here'|| the browser will read that syntax, process the variable through the 'theSnippet' script, and in place of that ||the syntax|| box on the page, the browser will display:
whatever is put in here (or whatever the php script does to the variable defined in the syntax)
?? How can I have the user determine that information? My intuitive guess.. Use form html syntax in a Chunk? call the chunk and then have the Snippet get the input somehow?? whaaaaa?
What is the most simplest and direct link between an
input box (written with html?) and passing
that input into a snippet?
If you could help me, thanks.
(edit: I'm aware that the input data would probably need to be pushed to a 'separate holding spot' then the php code itself, I'm just looking for the clean standard and I'm clueless as to what that 'spot' is supposed to be. by the link above, I'm writing the html to push the data to a php file and then writing the script to read the info put in the file. Modx has me stumped.)
[ed. note: lazerblue last edited this post 11 years, 6 months ago.]