making a php form?

Discussion in 'PHP' started by jaxterpromotions, Sep 27, 2009.

  1. #1
    Hi all,

    I was wondering if someone could help me. I am still learning php but the part that gets me is making a form that can add an entry to a database.

    For example, adding a testimonial.

    I have the following fields:

    name
    city
    state
    message
    rating

    what would be the easiest way to make a form? and making all of them required before sending.

    Any help would be appreciated. Thank you!!!
     
    jaxterpromotions, Sep 27, 2009 IP
  2. prasanthmj

    prasanthmj Member

    Messages:
    62
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    45
    #2
    prasanthmj, Sep 27, 2009 IP
  3. hanushh

    hanushh Peon

    Messages:
    198
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I recommend you use coffeecup form builder..........its damm easy!!!
     
    hanushh, Sep 28, 2009 IP
  4. PoPSiCLe

    PoPSiCLe Illustrious Member

    Messages:
    4,623
    Likes Received:
    725
    Best Answers:
    152
    Trophy Points:
    470
    #4
    And, unless they've revamped their code, frickin' ugly code as a result... (The coffeecup-thing)
     
    PoPSiCLe, Sep 29, 2009 IP
  5. califmerchant

    califmerchant Active Member

    Messages:
    112
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    63
    #5
    the form is in html then posts to a PHP file via <form method=post action=formreceive.php> then u work the $_REQUEST header...
     
    califmerchant, Sep 29, 2009 IP
  6. califmerchant

    califmerchant Active Member

    Messages:
    112
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    63
    #6
    so if its <input type=text name=firstname>

    then $_REQUEST[firstname] will have it
     
    califmerchant, Sep 29, 2009 IP
  7. bhavatmaj

    bhavatmaj Well-Known Member

    Messages:
    319
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    103
    #7
    If you can post the code where you are having problem ,
    we can help better and quickly
     
    bhavatmaj, Sep 29, 2009 IP
  8. renownedmedia

    renownedmedia Well-Known Member

    Messages:
    65
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    100
    #8
    $_POST['firstname'] would be better, REQUEST is getting phased out :p
     
    renownedmedia, Sep 29, 2009 IP
  9. jaxterpromotions

    jaxterpromotions Guest

    Messages:
    20
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Hey I checked out this tutorial. I think its close to what I need but I need it to add to a table in my database. Is there a generic form I could look at and be whats able to see going on scripting wise? I can modify it fine I have have a hard time making it from scratch.

    Thanks!
     
    jaxterpromotions, Oct 1, 2009 IP