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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T21:29:21+00:00 2026-06-04T21:29:21+00:00

I have Two forms in my index.php and am trying to get them to

  • 0

I have Two forms in my index.php and am trying to get them to submit and POST their data seperatly

Form 1

echo '<form action="process.php?type=news" method="post">';
echo '<table cellspacing="0"><tr><th>';
echo 'Add News to News Feed';
echo '</th></tr><tr><td>';
echo 'Title:<br /><input name="newstitle" type="text" id="add" style="height:16px;width:525px;" size="80" maxlength="186" /><br />';
echo 'Main Body Text:<br /><textarea name="newsfeed" id="add" style="width:525px;height:78px;" maxlength="2000" ></textarea>';
echo '<input style="float:right;margin-top:5px;" id="button" type="submit" value="Submit" />';
echo '</td></tr></table></from>';

And Form 2

echo '<form action="process.php?type=suggest" method="post">';
echo '<table cellspacing="0"><tr><th>';
echo 'Suggest Additions to the Intranet';
echo '</th></tr><tr><td>';
echo '<textarea name="suggest" id="add" style="width:330px;height:60px;" maxlength="800" ></textarea>';
echo '<input style="float:right;margin-top:5px;" id="button" type="submit" value="Submit" />';
echo '</td></tr></table></from>';

I want these both to post and do the action after pressing the submit button, but currently the second form submit to the first forms action

How can i fix this???

EDIT: Also i am using .PHP for both the index and process page then using it to echo the forms onto the page

Also here is the process.php data

$type=$_REQUEST['type'];
$suggest=$_POST['suggest'];
$newstitle=$_POST['newstitle'];
$news=mysql_real_escape_string($_POST['newsfeed']);

if ($type == "news")
{
  $sql=mysql_query("SELECT * FROM newsfeed WHERE title = ('$newstitle')");
  $number_of_rows = mysql_num_rows($sql);
  if ($number_of_rows > 0)
  {
    echo 'This Title is Already Taken';
  }
  else
  {
    $sql="INSERT INTO newsfeed (title, news) VALUES ('$newstitle','$news')";    
    if (!mysql_query($sql,$con))
    {
      die('Error: ' . mysql_error());
    }
    header('Location: index.php');
    exit;
  }
}
elseif ($type == "suggest")
{
  $sql="INSERT INTO suggestions VALUES ('$suggest')";
  if (!mysql_query($sql,$con))
  {
    die('Error: ' . mysql_error());
  }
  header('Location: index.php');
  exit;
}
  • 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-04T21:29:22+00:00Added an answer on June 4, 2026 at 9:29 pm

    Could it be that you are not closing the form with </form>, but with </from>, so the code of the second form is in fact still inside the first form since the tags are never closed?

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

Sidebar

Related Questions

I have form with two buttons submit. The code is: <form action=index.php method=get> <table
I have two files: index.php /lib/user.php Index contains the form: <div class=<? echo $msgclass;
I have two forms on my website, and I use jQuery to submit them,
I have just a basic html form within index.php which contains two text fields:
I have two forms. The first form is the mainForm, this never goes anywhere.
I have created two forms in my Windows Application. One Form acts as a
<form action=index.php?page=checkin method=post name=regForm> Fullständiga namn: <input name=full_name type=text id=full_name class=required> <br > Email:
I have a form. This form will submit data to 2 different pages. After
I have two problems. problem one: I am trying to create a registeration form
I am using a autocomplete http://bassistance.de/jquery-plugins/jquery-plugin-autocomplete/ And below i have two pages index.php and

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.