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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T08:08:39+00:00 2026-05-23T08:08:39+00:00

I am new to php and JS and I have this code I have

  • 0

I am new to php and JS and I have this code I have been stuck on that I cant get to work:

my something.php just has $variable= $_POST['SUBMIT']
echo $variable

<?php
$list=$_POST['added'];
?>

<html> 
<head> 
  <meta http-equiv="content-type" content="text/html; charset=UTF-8"> 

  <script type='text/javascript' src='http://code.jquery.com/jquery-1.6.js'></script> 

  <link rel="stylesheet" type="text/css" href="/css/normalize.css"> 
  <link rel="stylesheet" type="text/css" href="/css/result-light.css"> 

  <style type='text/css'> 


#display{
    width: 500px;
    height: 250px;
    overflow: scroll;
    background-color:white;
}

#display div {
    clear: both;
}
#display div span{
    float: left;
    padding: 10px;
}

.edit {
    color: blue;
}

.delete {
    color: red;
}



   body {background-color:orange;}
p {color:orange;
   size=3;
}

  body {

  background-image: url("http://dev.icalapp.rogersdigitalmedia.com.rogers-test.com/rogers_blackberry_8900.jpg");

  background-position: 50% 50%;

  background-repeat: repeat;

}

  </style> 

  <script type='text/javascript'> 
  //<![CDATA[ 
  $(window).load(function(){
  $('#add').click(function() {
    this.innerHTML = 'Add';
    var input = $('#addInput');
    var display = $('#display');
    var form = $('#addForm');
    if ($.trim(input.val()).length > 0) { //is there input?
        var div = $('<div>').append($('<span>', {
            text: input.val()
        }), $('<span>', {
            text: 'delete',
            class: 'delete'
        }), $('<span>', {
            text: 'edit',
            class: 'edit'
        }))
        display.append(div);
        form.append($('<input>', {
            value: input.val(),
            type: 'hidden',
            name: 'added[]'
        }));
        input.val('');
        }
    })



    $('.edit').live('click', function(){
        $('#add').html('Edit');
        var input = $('#addInput');
        var index = $(this).parent().index() + 1;
        input.val($(this).parent().children().get(0).innerHTML); //show value
        $(this).parent().remove(); //remove it from the list
        $('#addForm').children().eq(index).remove();
    });

    $('.delete').live('click', function(){
        var index = $(this).parent().index() + 1;
        $('#addForm').children().eq(index).remove();
        $(this).parent().remove(); //remove it from the list
    });




  });


  //]]> 
  </script> 

  <title>Admin Phone Setup</title>
</head> 
<body> 

<STYLE>H2 {FONT-SIZE: 21pt; COLOR: #ff3399}; </STYLE>
<CENTER>
<H2>Twilio Admin Setup</H2>
</CENTER>


<p id="demo">Enter Phone Numbers</p>
  <input id="addInput"/> <button id="add">Add</button> 
<div id='display'></div> 
<form action="something.php" id="addForm"> 
    <input type="submit" value="SUBMIT"/> 
</form>   
</body> 
</html>

What I am trying to do is once a person adds a bunch of numbers into that list and clicks submit it should send those values to something.php so I can use those values…I am really stuck and dont know what I am doing wrong…I think it might be the variable or some issue with my display list.

  • 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-23T08:08:40+00:00Added an answer on May 23, 2026 at 8:08 am

    1) Your button is unnamed. To get the buttons value, you must assing a name attribute, e.g.

    <input type="submit" name="mysubmitbutton" value="SUBMIT" />

    2) In your something.php you are using the POST-array, but your form is submitted with GET-data, because there is no ‘method’ attribute on your form tag. Also it seems that you try to access the buttons value by using its value as index (that does not word 😉 ). You have the choice (after nameing the button)
    a) use $_GET[‘mysubmitbutton’] in your PHP-Script
    b) change your form tag to

    <form ... method="post" ... >

    and use $_POST[‘mysubmitbutton’].

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

Sidebar

Related Questions

I have been stuck with this problem for a while now, and I just
I have a php application that has about 50-55 code files. The file that
I have been trying everything I can to get this script to work and
Hallo I have this script: <? require(lib2/config.inc.php); require(lib2/tpl.class.php); require(lib2/db.class.php); require(lib2/um.class.php); $tpl = new template(templates,
I am new to php. I want to have a form such as this:
I'm quite new to php and have been reading Larry Ullman book to develop
Hi I am quite new to php but i have been following some tutorials
I'm new to DOM parsing in PHP: I have a HTML file that I'm
I'm new to PHP and trying to get my head around security. I have
I have this code I been working on but I'm having a hard time

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.