RahulS96 Posted May 28, 2013 Share Posted May 28, 2013 I am creating a button on an admin site. When a user clicks that button, a box will open and text added inside that will be saved in a MySQL database. During the client screen it should be shown on the home page. This needs to be done with PHP. I am new to PHP so any idea or example can help me to understand and to create this. Thanks. Quote Link to comment Share on other sites More sharing options...
Jessica Posted May 28, 2013 Share Posted May 28, 2013 Google "CRUD" and PHP/MySQL. What you're describing is super basic. I have a tutorial on my blog, see my signature. If you need more specific help, post your code and describe your problem. Quote Link to comment Share on other sites More sharing options...
ginerjm Posted May 29, 2013 Share Posted May 29, 2013 1 You show the user a screen. 2 When he/she clicks a certain button you want a box to open up on that screen. 3 User puts data into box. 4 User clicks submit button and everything gets written to DB. Correct? Your request that item 2 has to happen with php makes your whole process a bit cumbersome for the user. Why not use JS to popup the box and avoid having to go to the server the extra time? If you insist, then you need to add code to your script to handle the first button's submit to redisplay the page with an additional html element on it. Then you need to have your script handle the second submit button properly. Pretty basic but not until you've done it once. Sample: <? if submit = "show popup" then get all the current input data fields from POST redisplay the page including popup box exit endif if submit = "Save" then get all the current data fields from post post the data redisplay screen without data(?) and msg indicating success exit endif Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.