www.webdeveloper.com
Results 1 to 4 of 4

Thread: Form submission help and other question

  1. #1
    Join Date
    Feb 2014
    Posts
    2

    Question Form submission help and other question

    Hello, i'm working on a "cms" for my website and its supposed to be individual dashboards. Its 3 ranks, admin, partner and trainee. This is for my youtube network and i'm trying to create a form so they can submit videos from there dashboards and then it sends it to my admin panel so I can check it out. I want to have a table display and I want just there submissions they've done displayed and I want it to display like all the fields they have entered and like a status section where i'll like be able to change the status through the admin dashboard. I have no idea how to do the table and have them see just there submissions and me be able to edit it through the admin panel. If any help on that, that would be great. Now i've been working on the form and getting it to submit, but for some reason it won't submit. If any of you can help me out with this it would be great. I'm pretty sure its the query, but not quiet positive. I'm new to php so any help is appreciated.



    php:



    Code:
    <?php
        if(isset($_POST['submit']))
        {
          $c_name = $_POST['channel_username'];
          $v_link = $_POST['video_link'];
          $v_title = $_POST['video_title'];
          $v_desc = $_POST['vido_description'];
          $v_tags = $_POST['video_tags'];
          $m_sources = $_POST['music_sources'];
          $s_requests = $_POST['special_requests'];
        
          if(empty($c_name) or empty($v_link) or empty($v_title) or empty($v_title) or empty($v_desc) or empty($v_tags))
          {
            echo 'You must fill in the first 5 fields.';
          }
          else
          {
            $getRank = $db->query("SELECT * FROM users WHERE username = '".$_SESSION['username']."'");
            while ($row = $getRank->fetch_assoc())
            {
              $usename = $row['username'];
              $rank = $row['rank'];
            }
           $db->query("INSERT INTO submitted_forms (username, rank, channel_username, video_link, video_title, video_description, video_tags, music_sources, special_requests) VALUES ('$username', '$rank', '$c_name', '$v_link', '$v_title', '$v_desc', '$v_tags', '$m_sources', '$s_requests')");
            echo 'Form submitted successfully.';
            }
          }
        ?>

    Html:

    Code:
    <form method="POST">
          <p>Channel name <input type="text" name="channel_name" required>*</p>
          <p>Video Link   <input type="text" name="video_link" required>*</p>
          <p>Video Title  <input type="text" name="video_title" required>*</p>
          <p>Video Description <input type="text" name="video_description" required>*</p>
          <p>Video Tags   <input type="text" name="video_tags" required>*</p>
          <p>Music Sources <input type="text" name="music_sources"></p>
          <p>Special Requests <input type="text" name="special_requests"></p>
          <br></br>
          <p><input type="submit" name="submit" value="Submit"></p>
        </form>

  2. #2
    Join Date
    Feb 2014
    Location
    Viet Nam
    Posts
    32
    replace this:
    $c_name = $_POST['channel_username'];
    $v_desc = $_POST['vido_description'];
    with this:

    $c_name = $_POST['channel_name'];
    $v_desc = $_POST['video_description'];

    Then it can submit well.

  3. #3
    Join Date
    Feb 2014
    Posts
    2
    Quote Originally Posted by aubenefit View Post
    replace this:
    $c_name = $_POST['channel_username'];
    $v_desc = $_POST['vido_description'];
    with this:

    $c_name = $_POST['channel_name'];
    $v_desc = $_POST['video_description'];

    Then it can submit well.
    Nope, didn't help

  4. #4
    Join Date
    Feb 2014
    Location
    Viet Nam
    Posts
    32
    Did you check more on that?
    After replace that line, you can go to the query for database. If don't change that line, you can not go to the query line.
    You use: $db->query
    did you define for "$db"?
    Do you include class and then you use that object?
    You must check that where is that object and require.....
    OK?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles