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
Share on other sites

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.

Link to comment
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.