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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T19:18:15+00:00 2026-05-28T19:18:15+00:00

I am trying to submit a form to execute a php script. But the

  • 0

I am trying to submit a form to execute a php script. But the submit button is not working. It doesn’t seem like I’m missing any quotes or expressions. What may be the problem I am doing wrong?

<script type="text/javascript">

function doSubmit()
{

<?php
echo "Hello";
?>
var actions = document.frm.actions.value;
var tables = document.frm.tables.value;
var text0 = document.frm.text0.value;
var text1 = document.frm.text1.value;
var text2 = document.frm.text2.value;

/*var txtBox = document.getElementById("text3");

if (txtBox!=null){
var text3 = document.frm.text3.value;
var strURL = "devicesql.php?actions=" +actions+ "&tables=" +tables+ "&text0=" +text0+     "&text1=" +text1+ "&text2=" +text2+ "&text3=" +text3;
}

else
{*/
var strURL = "devicesql.php?actions=" +actions+ "&tables=" +tables+ "&text0=" +text0+ "&text1=" +text1+ "&text2=" +text2;
//}

var xmlhttp;

if (str=="")
  {
  document.getElementById("result").innerHTML="";
  return;
  }
if (window.XMLHttpRequest)
  {
  xmlhttp=new XMLHttpRequest();
  }
else
  {
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
xmlhttp.onreadystatechange=function()
  {
  if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById("result").innerHTML=xmlhttp.responseText;
}
  }

xmlhttp.open("GET",strURL,true);
xmlhttp.send(null);

}

</script>

<form name="frm" method="get" action="doSubmit();">


<?php

// Connect to server and select database.
 mysql_connect("127.0.0.1:3306", "root", "")or die("cannot connect"); 
 mysql_select_db("PushApplication")or die("cannot select DB");

$sql="SELECT * FROM Device";
 $result=mysql_query($sql);

$count=mysql_num_rows($result);

?>
 <table width="400" border="0" cellspacing="1" cellpadding="0">
 <tr>
 <td><form name="form1" method="post" action="">
 <table width="400" border="0" cellspacing="1" bgcolor="#CCCCCC">

 <tr>
 <td align="center" bgcolor="#FFFFFF">#</td>
 <td align="center" bgcolor="#FFFFFF"><strong>ID</strong></td>
 <td align="center" bgcolor="#FFFFFF"><strong>DeviceID</strong></td>
 <td align="center" bgcolor="#FFFFFF"><strong>DeviceType</strong></td>
 <td align="center" bgcolor="#FFFFFF"><strong>Description</strong></td>
 <td align="center" bgcolor="#FFFFFF"><strong>OS_Version</strong></td>
 <td align="center" bgcolor="#FFFFFF"><strong>Status</strong></td>

 </tr>
<?php
 while($rows=mysql_fetch_array($result)){
 ?>
 <tr>
 <td align="center" bgcolor="#FFFFFF"><input name="checkbox[]" type="checkbox" id="checkbox[]" value="<? echo $rows['ID']; ?>"></td>
 <td bgcolor="#FFFFFF"><? echo $rows['ID']; ?></td>
 <td bgcolor="#FFFFFF"><? echo $rows['DeviceID']; ?></td>
 <td bgcolor="#FFFFFF"><? echo $rows['DeviceType']; ?></td>
 <td bgcolor="#FFFFFF"><? echo $rows['Description']; ?></td>
 <td bgcolor="#FFFFFF"><? echo $rows['OS_Version']; ?></td>
 <td bgcolor="#FFFFFF"><? echo $rows['Status']; ?></td> 
 </tr>
<?php
 }
 ?>
 <tr>
 <td colspan="7" align="center" bgcolor="#FFFFFF"><input name="delete" type="submit" id="delete" value="Delete"></td>
 </tr>
<?php
// Check if delete button active, start this
 if($delete){
 for($i=0;$i<$count;$i++){
 $del_id = $checkbox[$i];
 $sql = "DELETE FROM Device WHERE ID='$del_id'";
 $result = mysql_query($sql);
 }

// if successful redirect to delete_multiple.php 
 if($result){
 echo "<meta http-equiv=\"refresh\" content=\"0;URL=delete_multiple.php\">";
 }
 }
 mysql_close();
 ?>
 </table>
 </form>
 </td>
 </tr>
 </table>

<br />
<br />


Action: <id="actions">
<select name="actions">
<option value="insert into ">Insert</option>
<option value="update">Update</option>
<option value="select">Display</option>
</select>

</br>
</br>

Database Table Name: <id="tables">
<select name="tables" onchange="addRows(this.value)">
<option>Select Table</option>
<option value="Applications">Application</option>
<option value="Device">Device</option>
</select>
</br>

<div id="addedRows"></div>

</br>

<input type="submit" value="Submit" onclick="doSubmit()">

</br>
</br>

Result: <div id="result"></div>

</form>
  • 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-28T19:18:17+00:00Added an answer on May 28, 2026 at 7:18 pm

    Try to create another form for the table displaying the database information. Your form might be confused with the 2 buttons.

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

Sidebar

Related Questions

I'm trying to submit a form on an .asp page but Mechanize does not
Well I am trying to submit a form by pressing enter but not displaying
I'm trying to submit a form with javascript. Firefox works fine but IE complains
I am trying to submit a form with method GET and action index.php?id=3. The
I know that may sound silly, but I'm trying to submit a form on
Im trying to submit a specific form programatically, but I allways get the initial
I'm trying to submit a form without a submit button. This form takes values
I'm trying to run an R script from php using the following: echo <form
I am trying to validate a form, but I can't get any code to
Here is the form that is inside index.php -- I'm trying to programmatically submit

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.