Jump to content

Recommended Posts

Posted

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?

  • 1 year later...
Posted

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>

Gender:
<input type="radio" name="gender"
<?php if (isset($gender) && $gender=="female") echo "checked";?>
value="female">Female
<input type="radio" name="gender"
<?php if (isset($gender) && $gender=="male") echo "checked";?>
value="male">Male
<input type="radio" name="gender"
<?php if (isset($gender) && $gender=="other") echo "checked";?>
value="other">Other

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...