February 4, 2019 - Cloud Web Designs

React user info app with PHP.

By Karel Jordaan / On

I wanted to code an application that could take in a picture and store it to a database so that was pretty much the premise for the application.So I decided to code a little user profile application that stores the user picture and user info that can then be recalled and viewed from a database.No real practical use for it I supose but it was just how I felt like coding it to try make some sort of sense of it.

The front submit form is rendered out to the user as a React component but once it submits thats when all hell breaks loose ha ha!
So what does that mean, well once it submits PHP takes over in the back and it gets submitted to a little Mysql database I setup.
Thats actually still ok, its really when the display button is clicked when the hell part breaks loose.

The biggest problem I had was trying to figure out how to return the data from Mysql with PHP as a object to the front end react component so that it could then be rendered out to the DOM through the react component. Now as it looks that is kind of the case however the output of the info is actually recalled then its echoed out in PHP in the back and then what is echoed out is returned to the front end react component and then just displayed as the innerHTML value of a div tag.
Now I think technically that is actually completely wrong but I sat so long to try and figure it out that after a very long time I just decided stuff you you prick and I just settled on the fact that the way I have it now is working so Im not going to spend any more time on this.
So that is pretty much what happend. If you are brave enough and want to view the code then please click on my github icon on the bottom right of this page and you can go have a look at what mess I made. Maybe you can tell me where I went wrong and help me to improve the code.
The delete button just wipes all entries from the database so if you want to go ahead and try it feel free.

Thats all im going to say about that. It was fun.
Next im thinking of building something using the CSS-grid and CSS transition and animation properties.
Will see how thats gona pan out.
Ok thanks for reading,cheers!