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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T05:04:25+00:00 2026-06-16T05:04:25+00:00

I have an array in javascript that I want to post to php to

  • 0

I have an array in javascript that I want to post to php to store into oracle varchar2. I would like to know how to fetch this array in php. For now I always have a string [object Object] instead of the array in oracle. Im using JQuery $.post to send the variable to php like this:

function savePolygons(){
    $.get('oracle_deletePolygons.php');
    for (var i = 0; i < createdShapes.length; i++){
        var nom_zone  = escape(document.getElementById('nom_zone_' + createdShapes[i].id).value);
        var couleur = escape(createdShapes[i].fillColor);
        var code_cs = escape('711');
        var shapeid_export = escape(createdShapes[i].id);
        var geometry = createdShapes[i].getPath();
        alert(geometry)
        var url1 = "oracle_savePolygons.php?nom_zone=" + nom_zone + "&couleur=" + couleur + "&code_cs=" + code_cs + "&shapeid_export=" + shapeid_export + "&geometry=" + geometry;
        $.get(url1);
    }
}

in php:

<?php
require("oracle_dbinfo.php");
sleep(5);
$nom_zone =$_GET['nom_zone'];
$shapeid_export = $_GET['shapeid_export'];
$code_cs = $_GET['code_cs'];
$couleur = $_GET['couleur'];
$geometry = $_GET['geometry'];

$conn = oci_connect($username, $password, $database);
$query = oci_parse($conn, 'INSERT INTO test1 (nom_zone, shapeid, code_cs, couleur, geometry) VALUES (:nom_zone, :shapeid_export, :code_cs, :couleur, :geometry)');

oci_bind_by_name($query, ":nom_zone", $nom_zone);
oci_bind_by_name($query, ":shapeid_export", $shapeid_export);
oci_bind_by_name($query, ":code_cs", $code_cs);
oci_bind_by_name($query, ":couleur", $couleur);
oci_bind_by_name($query, ":geometry", $geometry);

oci_execute($query);
oci_commit($conn);
?>

the var geometry is an array of coordinates of each vertices of the polygon.

  • 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-16T05:04:28+00:00Added an answer on June 16, 2026 at 5:04 am

    Just use $.get() if your not posting any data to the url:

    $.get('oracle_deletePolygons.php');
    

    Please refer to jQuery.get()

    Also note this should most likely be using $.get() because your just sending querystrings:

    var url1 = "oracle_savePolygons.php?nom_zone=" + nom_zone + "&couleur=" + couleur + "&code_cs=" + code_cs + "&shapeid_export=" + shapeid_export + "&geometry=" + geometry;
    $.post(url1);
    

    Try this instead:

    var url1 = "oracle_savePolygons.php?nom_zone=" + nom_zone + "&couleur=" + couleur + "&code_cs=" + code_cs + "&shapeid_export=" + shapeid_export + "&geometry=" + geometry;
    $.get(url1);
    

    Example of posting data using $.get():

    $.get('oracle_savePolygons.php', {
        'num_zone' : nom_zone,
        'couleur' : couleur,
        'code_cs' : code_cs,
        'shapeid_export' : shapeid_export,
        'geometry' : geometry
    }, function (data) {
      //Success callback if you need it
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this array, that I want to parse into javascript. $offerText[] = (
i have a jquery post like that <script type = text/javascript > $(document).ready(function() {
i want to send a javascript array to php using jquery ajax. $.post(controllers/ajaxcalls/users.php, {
i want to send a javascript array to php using jquery ajax. $.post(controllers/ajaxcalls/users.php, {
I have an array in javascript that I need to join and send through
I have a variable length array of strings declared in javascript that contains Dungeons
I have a Knockout observable array that I wish to edit from within Javascript
I am currently trying to pass an array that I have created in Javascript
I have a javascript function that gathers two arrays, imagepaths and captions. I want
I have a series of data that I want to put inside an array

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.