Jump to content
Killersites Forums

php coding to complete buttons setup


Recommended Posts

I have just created a website about myself and my public speaking work. I have created some buttons on my website that are contact page submit buttons. Even though I learned about php coding during my web design course I have forgotten how to apply it to my buttons to make them functional. So that when someone uses my contact form to contact me they will receive a thank you we have received your message box . I also do not remember how to set up my buttons to link it so that I receive thier questions and or comments. can someone give me the php coding for how i would set this up?

Link to comment
Share on other sites

  • 1 year later...

To show the values within the input fields after the user hits the submit button, we add a bit PHP script inside the worth attribute of the subsequent input fields: name, email, and website. within the comment Textarea field, we put the script between the <textarea> and </textarea> tags. the tiny script outputs the worth of the $name, $email, $website, and $comment variables.

Then, we also must show which radio button that was checked. For this, we must manipulate the checked attribute (not the worth attribute for radio buttons)

Name: <input type="text" name="name" value="<?php echo $name;?>">

E-mail: <input type="text" name="email" value="<?php echo $email;?>">

Website: <input type="text" name="website" value="<?php echo $website;?>">

Comment: <textarea name="comment" rows="5" cols="40"><?php echo $comment;?></textarea>

<input type="radio" name="gender"
<?php if (isset($gender) && $gender=="female") echo "checked";?>
<input type="radio" name="gender"
<?php if (isset($gender) && $gender=="male") echo "checked";?>
<input type="radio" name="gender"
<?php if (isset($gender) && $gender=="other") echo "checked";?>

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

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