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 6923887
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T10:35:36+00:00 2026-05-27T10:35:36+00:00

Im doing a conditional form and as far as I can tell everything is

  • 0

Im doing a conditional form and as far as I can tell everything is correct except its just not working correctly. im trying to pass my values into a if statement and its just not getting them, it keeps echoing out my else statement.

This is what I have

    <form action="" method="post">
<select name="optionType" onChange="this.form.submit();">
<option value="Ben">Ben</option>
<option value="John">John</option>
<option value="Matt">Matt</option>
</select>
</form>

<table>

<? 
for($x=2; $x<=count($excel->sheets[0]["cells"]); $x++) {
    $date = $excel->sheets[0]["cells"][$x][1];
    $user = $excel->sheets[0]["cells"][$x][2];
    $type = $excel->sheets[0]["cells"][$x][3];
    $keywords = $excel->sheets[0]["cells"][$x][4];
    $keywordpage = $excel->sheets[0]["cells"][$x][5];
    $urls = $excel->sheets[0]["cells"][$x][6];
    $sitepr = $excel->sheets[0]["cells"][$x][7];

    echo "\t<tr>\n";
    if($user == $_POST['optionType']) {
        echo "<td>";
    echo $date = $excel->sheets[0]["cells"][$x][1];
    echo "</td>\n";

    echo "<td>";
    echo $user = $excel->sheets[0]["cells"][$x][2];
    echo "</td>\n";

    echo "<td>";
    echo $type = $excel->sheets[0]["cells"][$x][3];
    echo "</td>\n";

    echo "<td>";
    echo $keywords = $excel->sheets[0]["cells"][$x][4];
    echo "</td>\n";

    echo "<td>";
    echo $keywordpage = $excel->sheets[0]["cells"][$x][5];
    echo "</td>\n";

    echo "<td>";
    echo $urls = $excel->sheets[0]["cells"][$x][6];
    echo "</td>\n";

    echo "<td>";
    echo $sitepr = $excel->sheets[0]["cells"][$x][7];
    echo "</td>\n";
    }else{
    echo 'Nothing at this time';
    }
    echo "\t</tr>\n";
}

    ?>
    </table>

Any help is appreciated
thank you

  • 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-05-27T10:35:37+00:00Added an answer on May 27, 2026 at 10:35 am

    It looks like the issue is this $_POST['userinfo']. Your select box isn’t named userinfo. It’s named optionType. So you never get a user passed from your form.

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

Sidebar

Related Questions

having my first attempt at rounded corners in a login form. Just doing the
Doing my first tryouts with foreign keys in a mySQL database and are trying
I have a web app with a form that I am trying to pass
I'm trying to implement #field_prefix on a text field so I can add some
I have a form that you can add data to a database. It is
I am trying to submit data to a database. I have an update form
we are doing some weird handling of our form variables. Anyway I have managed
I am doing a multiple upload using the Multiple_upload library in codeigniter, and form
I am new in php and I am trying to do a contact form.
I am working on an online form. Before a user fills in this form,

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.