0

Can I insert a php code in an html compiler?

Or can I do it the other way around? Especially with this code! https://code.sololearn.com/wDCO4TEzQ3Q9/?ref=app I suck at java so I am trying to use a php code instead. Now if I make a text area and insert the php code will it interpret everything with this script or is there more to be done (aside from the letters)

17th May 2020, 4:31 AM
Honest Thomas
Honest Thomas - avatar
9 ответов
+ 1
Yes , u can use the php code where u want but u should open the php tag and then write codes then close its tag
18th May 2020, 10:47 PM
Amir Hossein mahdioun
Amir Hossein mahdioun - avatar
+ 3
Yes but your file extension should be .php and also to run PHP file you need server like xampp, wampp or ampp But on Sololearn you can't do.
17th May 2020, 4:57 AM
A͢J
A͢J - avatar
+ 3
AJ #Infinity Love I think you meant XAMPP, not ZAMMP. Honest Thomas It's not clear what you're asking or attempting to accomplish. What do you mean by HTML compiler? Such a thing doesn't exist. Are you referring to the web based code? If so, as mentioned by AJ, this isn't possible on SoloLearn. The textarea would need to render in the web page first so you can enter the PHP code. That part would work. But then, to run that PHP code, it would need to post back to a PHP server where the content of the textarea can be loaded and executed using the eval() function for PHP. This is the part that won't work on SoloLearn. The Code Playground doesn't support the ability to post to a PHP endpoint from another code where you can handle this request. You'll need to find another online REPL or run it locally.
17th May 2020, 5:37 AM
David Carroll
David Carroll - avatar
+ 3
David Carroll Yes XAMPP 😁
17th May 2020, 5:41 AM
A͢J
A͢J - avatar
+ 2
Yes. It interprets everything. For a working example see https://code.sololearn.com/wZ8RE6oxrm5Q/?ref=app
17th May 2020, 10:22 AM
Ore
Ore - avatar
+ 2
Honest Thomas In case of next time, you might want to include your IQ number in the question so that people will answer appropriately. Just saying.
17th May 2020, 8:49 PM
Ore
Ore - avatar
+ 2
Yes but the file extension should be . Php file.
18th May 2020, 1:40 PM
Md. Sharoar Hossain
Md. Sharoar Hossain - avatar
+ 1
Yes, ofcourse
17th May 2020, 2:47 PM
Jace
Jace - avatar
+ 1
wow all of you are useless! except for the last two. I know it’s not your fault but when replying to a guy with an IQ of 62 about coding keep it simple! But then again... I guess i didn’t explain myself properly. Thanks anyway!
17th May 2020, 6:15 PM
Honest Thomas
Honest Thomas - avatar