How can I handle PHP forms in Sololearn? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

How can I handle PHP forms in Sololearn?

So sololearn only had one page, so how can I get user input in php?

25th Mar 2021, 12:43 AM
UCYT5040
UCYT5040 - avatar
2 Answers
+ 5
You can't process form submissions using PHP that is on Sololearn. The very closest you can do is submit your forms to a PHP script hosted elsewhere like 000webhost.com. Your Web codes in Sololearn are shown in an iframe so submitting them will still appear like the results are from your code even though it isn't even the same website. If you don't actually need serverside processing of your form but just want a page to look like it submitted data and reported results back, consider using JavaScript in a Web code. JavaScript could manipulate the document model(DOM) to make it look like results you receive from PHP.
25th Mar 2021, 1:09 AM
Josh Greig
Josh Greig - avatar
0
Looks like some sololearn update had broken ability to use one-file to handle both page to get user data and page to read and format user data... this code should be worked by the past, but doesn't work today: https://code.sololearn.com/wM2472EL6zJN/?ref=app I don't know when the behavior had changed (and if php code to handle user data is right, as it's not mine -- just make a quick search), because I don't have practiced php since many years ^^
25th Mar 2021, 4:23 AM
visph
visph - avatar