Jump to content

Welcome message


RahulS96

Recommended Posts

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.

Link to comment
https://forums.phpfreaks.com/topic/278485-welcome-message/
Share on other sites

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

Link to comment
https://forums.phpfreaks.com/topic/278485-welcome-message/#findComment-1432975
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.