+ Reply to Thread
Results 1 to 5 of 5

Thread: Forms

  1. #1
    taekwondokid42 is offline x10 Lieutenant taekwondokid42 is an unknown quantity at this point
    Join Date
    Aug 2007
    Posts
    268

    Forms

    How to I create a forum that has a set value?

    Example: <input="<?$variable?>" name="variable">
    <input type="submit">

  2. #2
    eddysweb's Avatar
    eddysweb is offline x10Hosting Member eddysweb is an unknown quantity at this point
    Join Date
    Sep 2006
    Posts
    63

    Re: Forms

    hey,

    it would look something like:
    Code:
    Example: <input="<?PHP $var; ?>" name="var">
    <input type="submit">
    notice the ; after the $var, you must have this in there

  3. #3
    Slothie's Avatar
    Slothie is offline Lord Of The Keys Slothie is an unknown quantity at this point
    Join Date
    Sep 2007
    Location
    Singapore
    Posts
    1,432

    Re: Forms

    =/
    PHP Code:
    <input type="text" name="variable1" value="<?php echo $variable?>">
    <input type="submit">
    That's assuming its a text variable you want to output. Checkboxes/ radio boxes and text areas have it differently.
    Edit:
    Quote Originally Posted by eddysweb View Post
    hey,

    it would look something like:
    Code:
    Example: <input="<?PHP $var; ?>" name="var">
    <input type="submit">
    notice the ; after the $var, you must have this in there
    What do you expect PHP to do with the $var?
    Last edited by Slothie; 11-12-2007 at 03:14 AM. Reason: Automerged Doublepost

    Easiest 70 points you'll make on x10

    Feel free to add my reputation by clicking on the if you found my post helpful to you :P


    If I am not responding to your PMs, that means I am ignoring you. Take a hint.



    09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0


  4. #4
    Thewinator is offline x10 Lieutenant Thewinator is an unknown quantity at this point
    Join Date
    Oct 2007
    Location
    [NL]
    Posts
    256

    Re: Forms

    Slothie is right, if you want it to be a set value you don't need php for that.
    HTML Code:
    <input type="text" name="variable" value="yourSetValue" />
    Or if you want a textarea
    HTML Code:
    <textarea name="variable">yourSetValue</textarea>
    And last is a radio/checkbox
    HTML Code:
    <input type="radio" name="variable" value="theRadioValue" checked />
    Last edited by Thewinator; 11-12-2007 at 03:20 AM.



  5. #5
    Join Date
    Aug 2007
    Location
    Gangstas Paradise
    Posts
    4,143

    Re: Forms

    Quote Originally Posted by taekwondokid42 View Post
    How to I create a forum that has a set value?

    Example: <input="<?$variable?>" name="variable">
    <input type="submit">
    1stly you would create a Forum using forum software.
    2ndly to create a form you could do the following:

    FORM.php
    PHP Code:
    <html>
    <
    head>
    </
    head>
    <
    body>
    <
    form method="post" action=ENGINE.php">
    <select name="
    drop_down">
          <option value='' ="
    selected">Please Select A Option</option>
          <option value="
    opt_1">option 1</option>
    </select>
    <input type="
    text" size="50" maxlength="30" name="fullname" /> 
    <input type="
    submit" value="Submit" name="submit">
    </form>
    </body>
    </html> 
    ENGINE.php
    PHP Code:
    <html>
    <head>
    </head>
    <body>
    <?php
    if (!isset($_POST['drop_down'];))
    {
    echo 
    'The required field is empty, click back and retry.'?>
    <form>
    <input type ="button" name ="back" value="Go Back" onclick="history.go(-1)">
    </form>
    <?php
    } else
    {
    $drop_down $_POST['drop_down'];
    $fullname $_POST['fullname'];
    // do what ever you want with these varibles/scalars
    }
    ?>
    </body>
    </html>
    Last edited by DefecTalisman; 11-12-2007 at 03:47 AM.

    http://dev.x10hosting.com (this has nothing to do with x10hosting)

    ->All us helpful people here at x10hosting would like to reach our next user groups, "Community Paragon". Please click the +rep icon on the left hand side of a post if that post was helpfull.



+ Reply to Thread

Similar Threads

  1. Forms
    By Skyline4life in forum Scripts & 3rd Party Apps
    Replies: 32
    Last Post: 12-20-2007, 07:23 PM
  2. Frontpage forms
    By rentphuk in forum Free Hosting
    Replies: 1
    Last Post: 10-10-2007, 09:49 AM
  3. Pre Modded Forms to Include the x10 ads
    By Chris S in forum Scripts & 3rd Party Apps
    Replies: 13
    Last Post: 09-06-2007, 08:14 AM
  4. php forms
    By TarinC in forum Scripts & 3rd Party Apps
    Replies: 7
    Last Post: 01-14-2006, 11:00 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers