Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Aug 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question posting without a form?

    I have about 100+ input values that I want to store in mysql. Not all of them are in a form. All the examples I see on the internet are for inputs only in forms. What do I need to add to these inputs to post them without putting them in a form? I will have a submit button at the bottom that gathers all the inputs and posts them on another page. Is it possible to post without a form even?

    <input id="blogcolor>
    <textarea id"=aboutmeblog">some text</textarea>
    <Select id="textalignselect">
    <Option value="left">left</Option>
    <Option value="center" selected="selected">center</Option>
    <Option value="right" >right</Option>
    </Select>

  • #2
    Senior Coder Len Whistler's Avatar
    Join Date
    Jul 2002
    Location
    Vancouver, BC Canada
    Posts
    1,323
    Thanks
    26
    Thanked 100 Times in 100 Posts
    You must have a form to go with your submit button, some fields can be hidden with a set value or value from a database. Study the code below, it should give you an idea of what to do.


    index.php
    PHP Code:
    <html>
    <body>
    <?php
    $first_name 
    $_POST["first_name"];
    $last_name $_POST["last_name"];
    $hidden_value $_POST["hidden_value"];
    echo 
    "Thanks for applying $first_name $last_name $hidden_value";
    ?>
    <br />
    </table><br />
    <form method="post" action="<?php echo $PHP_SELF;?>">
    First Name: <input type="text" size="30" maxlength="30" name="first_name" /><br /><br />
    Last Name: <input type="text" size="30" maxlength="30" name="last_name" /><br /><br />
    <input type="hidden" size="30" maxlength="30" value="secret word" name="hidden_value">
    <input type="submit" value="submit" name="submit" /><input type="reset" value="clear" />
    </form>
    </body>
    </html>
    Leonard Whistler


  •  

    Posting Permissions

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