JavaScript Posting Leads from MSSQL database to another site using PHP

I looking to post leads from my MSSQL database to a third party site. I've created a page that queries the database and inserts values into form fields so that I can manually press a submit button. That code is at the bottom.

That's as far as I got before getting stuck on a few things.

1) I need to automate the process. I believe I got this covered using this

<script language="JavaScript">
document.frm.submit();
</script>

2) The biggest issue I'm facing is running this through a batch of leads. I believe I need a different way of querying the data and submitting it.

I believe I can achieve this by using something similar to this:

<?php
var actionForm = $('<form>', {'action': 'thirdpartypage.com', 'method': 'post'}).append($('<input>', {'name': 'action', 'value': 'delete', 'type': 'hidden'}), $('<input>', {'name': 'id', 'value': 'some_id', 'type': 'hidden'}));
actionForm.submit();
?>

Now here is what I currently have that query's the database and fills in the form for manual submission.

<?php

$myServer = 'someserver';
$myUser = 'someuser';
$myPass = 'somepassword';
$myDB = 'mydb';

//connection to the database
$dbhandle = mssql_connect($myServer, $myUser, $myPass)
  or die("Couldn't connect to SQL Server on $myServer"); 

//select a database to work with
$selected = mssql_select_db($myDB, $dbhandle)
  or die("Couldn't open database $myDB"); 

//declare the SQL statement that will query the database
$query = "Select * From MyTableName WHERE LeadSent=0";

//execute the SQL query and return records
$result = mssql_query($query);

$row = mssql_fetch_array($result)
//display the results

?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title></title>
</head>
<body>

<!-- form to display record from database -->
<form name="form" method="POST" action="https://thirdpartysite.com" onSubmit="return validate_form ( );">
<input type="text" name="FirstName" value="<?php echo $row[FirstName]?>"/> <br>
<input type="text" name="LastName" value="<?php echo $row[LastName]?>"/> <br>
<input type="submit"  value="submit">
</form>

</body>
</html>

I could really use some resources or help with this process. I've done what I could with searching through Google, but with my limited knowledge of PHP, I'm having a hard time with adapting examples that I've found into my code.

Answer:1

I've got this Electron app (using NodeJS, Bootstrap, AngularJS) with some text input fields that can be edited. I have a button that triggers a window.alert() After it has been triggered, the text ...

I've got this Electron app (using NodeJS, Bootstrap, AngularJS) with some text input fields that can be edited. I have a button that triggers a window.alert() After it has been triggered, the text ...

  1. canvas
  2. canada
  3. cancelled
  4. canceled vs cancelled
  5. cancun
  6. canada goose
  7. cane corso
  8. canes
  9. canadian prime minister
  10. cancun flights
  11. canker sore
  12. candy
  13. cancer
  14. canon
  15. canvas prints
  16. cancer sign
  17. candace owens
  18. canada news
  19. candytopia
  20. canlis

From the code underneath, I want to remove the previous instances of codemirror, that is both "hello" and "hii" before I can add another instance. The jQuery is not working. Also, if I console.log($('...

From the code underneath, I want to remove the previous instances of codemirror, that is both "hello" and "hii" before I can add another instance. The jQuery is not working. Also, if I console.log($('...

I have a folder in Google Drive and I need to embed it on my website. I used this code: <iframe src="https://drive.google.com/embeddedfolderview?id=0B-cjMH6T4IV5bzlkUmpTWkhQOTg#grid" width="700" ...

I have a folder in Google Drive and I need to embed it on my website. I used this code: <iframe src="https://drive.google.com/embeddedfolderview?id=0B-cjMH6T4IV5bzlkUmpTWkhQOTg#grid" width="700" ...

  1. embed google drive video
  2. embed google drive folder
  3. embed google drive pdf
  4. embed google drive image
  5. embed google drive video squarespace
  6. embed google drive video in powerpoint
  7. embed google drive file
  8. embed google drive audio
  9. embed google drive link
  10. embed google drive folder wordpress
  11. embed google drive video in gmail
  12. embed google drive wordpress
  13. embed google drive folder iframe
  14. embed google drive video in email
  15. embed google drive document
  16. embed google drive video in slides
  17. embed google drive document in website
  18. embed google drive video in canvas
  19. embed google drive search
  20. embed google drive video in wordpress

I have a set of values in an array where each value has an ID and LABEL. Once I have the value array and type console value[0] and value[1], the output is: value[0] Object {ID: 0, LABEL: turbo} ...

I have a set of values in an array where each value has an ID and LABEL. Once I have the value array and type console value[0] and value[1], the output is: value[0] Object {ID: 0, LABEL: turbo} ...

  1. javascript convert array to string
  2. javascript convert array to object
  3. javascript convert array to json
  4. javascript convert array to map
  5. javascript convert array to set
  6. javascript convert array of strings to numbers
  7. javascript convert array to csv
  8. javascript convert array to comma separated string
  9. javascript convert array to list
  10. javascript convert array of objects to array of strings
  11. javascript convert array to object keys
  12. javascript convert array to string with spaces
  13. javascript convert array into object
  14. javascript convert array to number
  15. javascript convert array to string without commas
  16. javascript convert array to arguments
  17. javascript convert array to nested object
  18. javascript convert array of objects to csv
  19. javascript convert array to query string
  20. javascript convert array buffer to string