• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Very easy PHP question, can anyone help me?

Art Vandelay

Senior member
Well not me, but my friend has a website for his extended family. He wants family members to sign his website. In other terms, he wants 4 text fields:

First Name: Required
Last Name: Required
Email: Optional
Relationship: Optional

Lets say the page is sign.php, he wants to have the form on top, and as soon as someone hits submit button, the page will refresh and add the name to the list below... a table I guess?

Can anyone help?

Thanks!
 
He'll need to store the information somewhere, like in a database or in a text file.

When he creates the form, he'll need to set <form method="post" action="sign.php"> and the form will submit the information to itself when you click submit. At the top of the form, you can write something like:

<?php
if($_POST["mySubmitButton"]) {
//store stuff into the db
}
?>

"mySubmitButton" is the name of your Submit button: <input type="submit" name="mySubmitButton" value="Submit">
The code to store the data is only executed when somebody clicks Submit so loading the page to view the list of people won't do anything.

Farther down in the page, he'll need code to read from his database or text file to show the names.
 
Back
Top