SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Sep 2006
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Exclamation Pho form problems

    Hi all

    need someone to check out my form as i'm running into problems, i'm setting up a contact form page in php. however it seams out of pace what i want to do is add a countrycode in my form can someone help us out. been working on it for a couple of days now. new to the forum am hoping to learn some new tricks to the trade.

    this is the code i'm working on also would like to add two radio buttons to the form and a ticket number for my clients...

    PHP Code:
    <html>
    <head>
    <title>Contact Us</title>
    </head>
    <body>
    <?
    if(isset($submit)){
       
    $to "feedback@cyberdating.com.au"// 
       
    $subject "Feedback for the Website!";
       
    $body "A user has entered feedback on the site!\n";
       
    $body .= "Their feedback is:\n\n";
       
    $body .= $feedback;
       
    mail($to$subject$body);
       print(
    "<h2><p><b>Have you read</b> our <a href="/troubleShooting.php">Cyberdating Help</a> page?</p>
          <p>Please complete the following form ensuring you have selected the relevant enquiry type.</p></h2>"
    );
    } else {
     
    ?>
    Name:<input type="text" name="name" size="40" maxlength="50" > 
    E-mail Address:<input type="text" name="email address" size="35" maxlength="50" >
    Phone Number:<input type="text" name="phone number" size="35" maxlength="50" >
    Department:<input type="dropdownlist" name="Department" size="35" maxlength="50" >



    <form action="feedback.php" method="POST">
     <h2>Please Send us your Feedback</h2>
     <textarea cols=35 rows=15 name="feedback">
     </textarea>
     <br>

    <input type="submit" name="submit" value="Submit">

    </form>
     <?
     
    }
     
    ?>
    </body>
    </html>

  2. #2
    SitePoint Zealot
    Join Date
    Sep 2006
    Posts
    188
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi, Welcome to the forums!

    Ok, i'm (and I bet a few more are) not sure what you mean. What you say it look's out of place, do you mean the layout. If you want each from field on a new line then just add <br /> after the end code of each text field.

    You say you want a 'country code'. What do you mean by this? A dropdown list withh all the countrys on? That's fairly simple to do, a drop down list and add all the countries on.

    Radio buttons are easy.
    <input name="radiobutton" type="radio" value="radiobutton" unchecked>

    Ok, if you may (or may not) want this piece of code explaining as you said you were learning. Ok

    <input Must be contained within the <form></form> tags.
    This tells the browser that the following code is an input field, a field that the user fills in.

    name="radiobutton"Must be contained within the <input 'goes here'> tag.

    This defines the radio button's name.

    type="radio" Must be contained within the <input 'goes here'> tag.

    So far, You don't have an actual radio button. This is because you have defined what type of input field it is. Because you want the input field to be a radiobutton, we set the type to 'radio'. If you wanted a text field, you would set the type variable to 'textfield' and so on.

    unchecked
    Must be contained within the <input 'goes here' tag>

    This basically defines whether the radiobutton should be unchecked or checked, the default is set to unchecked.

    And you final request a 'ticket number' for your clients. I currently do not know how to do this (if it's possible) via simple PHP like this. However, if you wanted to create a database and store all your tickets in, then it's possible. If you wopuld like this doing just say, and I will post a tutorial on my website (or SitePoint depending on which I fell like) which you will be able to read. Please reply about the other things and I may be able to help with those as well.

    Hope this helped,
    ChrisGilmore.
    ChrisGilmore


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •