Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8161171
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T18:26:28+00:00 2026-06-06T18:26:28+00:00

<form action = settings.php method = post> Student ID*: <input type = text name

  • 0
<form action = "settings.php" method  = "post">
Student ID*:
<input type = "text" name = "std_id" value = "<?php echo $user_data['std_id'];?>"><br>
Firstname*:
<input type = "text" name = "name" value = "<?php echo $user_data['name'];?>"><br>
Surname*:
<input type = "text" name = "surname" value = "<?php echo $user_data['surname'];?>"><br>
Group*:
<select name = "group" id = "group">
    <option value="0"><-- Please Select Item --></option>
    <?php 
    $show=mysql_query("SELECT * FROM room_group_options ORDER BY op_id");
    while ($array = mysql_fetch_array($show))
    {
        $id = $array['id'];
        $group = $array['group'];
        echo "<option value = '$id'> $group </option>";
    }?>
</select><br>
Email*:
<input type = "text" name = "email" value = "<?php echo $user_data['email'];?>"><br>
<input type = "submit" name "update" value = "update">
</form>

This above code is update form that query from database. All variable are ok except group

   if(empty($_POST) === false && empty($error) === true)
    {
        $update_data = array(
            'std_id' => $_POST['std_id'],
            'name' => $_POST['name'],
            'surname' => $_POST['surname'],
            'group' => (int)$_POST['group'],
            'email' => $_POST['email'],
        );

        print_r($_POST);
                    print_r($update_data);

        die();
    }

This is use for get data from submit button. I try to use print_r to get all value in each array. They all have except group. Can I fix this issue?

    Array ( [std_id] => 52211001 [name] => testname2 [surname] => testsurname1 [group] => [email] => tes21@test.com ) 
    Array ( [std_id] => 52211001 [name] => testname2 [surname] => testsurname1 [group] => 0 [email] => tes21@test.com )

This is an output

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T18:26:29+00:00Added an answer on June 6, 2026 at 6:26 pm

    Why do you cast to int? And the line:

    echo "<option value = '$id'> $group </option>";

    should be:

    echo '<option value = "'.$id.'">'. $group .'</option>';

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

<form action=test.php method=post> Name: <input type=text name=fname /> <input type=hidden name=fname value=test /> Age:
<form method=post action=load_statements.php?action=load id=loadForm enctype=multipart/form-data> that is my form, which looks fine to me.
I have a page with a form like so: <form method=POST action=scripts/save-settings2.php> <div id=posts>
Here's my HTML code although I think it's irrelevant: <form enctype=multipart/form-data action=../developers/submit.php method=post> <input
i.e. - <form action=http://192.168.1.20/form_action.asp method=get> vs. ( without a specific handler, still valid html?
I have a problem in PHP. I am using <input type=file> to get the
This is where i put a popup box into echo <tr><td>.$set['Name'].</td><td>.$set['Position'].</td><td><select name='aaa'><option value='default'>Not Share</option><option
My PHP book gives a template HTML form for uploading a file: <form action=upload.php
The html form accepts textarea input, and I am using $_POST value to put
I have the following code to create a form in my app: <?php echo

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.