answersLogoWhite

0

Yes. This can be done by posting the data back to the server and outputting the results to the browser.

You would need to create your HTML form which submits the content you wish to manipulate

<form method="post" target="myproject.php">

<input type="text" name="usertext"/>

</form>

On the PHP side (in this case in "myproject.php"), you can read the post data and act accordingly.

<?php

if(array_key_exists('usertext', $_POST)){

$submittedValue = $_POST['usertext'];

}

The key item to note is that the posted data can be accessed as key values in the array $_POST. You can then do whatever you wish with the posted value.

If you want to maintain an ongoing list of items that the user is submitting, you could do it a couple of ways. To maintain it permanently, you'll probably want to open up a database (check out "mysqli" on the the documentation for PHP). If you only want it for that active user session, then you might want to consider another global array called $_SESSION. It is an array that gets stored on the server, retaining data for any user between page loads. The code above could be modified to use it like so:

<?php

session_start();

if(!array_key_exists('submittedValues', $_SESSION)){

$_SESSION['submittedValues'] = array();

}

if(array_key_exists('usertext', $_POST)){

$_SESSION['submittedValues'][] = $_POST['usertext'];

}

Now you can loop through the array $_SESSION['submittedValues'], dealing with every value the user has submitted in their current session.

User Avatar

Wiki User

9y ago

What else can I help you with?

Related Questions

Create an HTML page which pops up an alert message?

&lt;html&gt; &lt;head&gt; &lt;script type="text/javascript"&gt; function show_alert() { alert("I am an alert box!"); } &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;input type="button" onclick="show_alert()" value="Show alert box" /&gt; &lt;/body&gt; &lt;/html&gt;


Which HTML tag is used to indicate to the web browser that the HTML page contains a javascript program?

Easy one. &lt;script type="text/javascript"&gt;&lt;/script&gt;.


What is WPP in HTML?

It stands for the Web Preprocessor. It is a Perl script to preprocess HTML files. This helps speed things up when the page is working.


What element do you use to add JavaScript code to a web page and how is it structured?

To add javascript code in HTML, you have to include the script tag on top. It can be added as &lt;script src="source of script"&gt;&lt;/script&gt;


What is a page lock down for script writers?

You're probably referring to a shooting script -- a special condition of a script -- where the page is final: no more edits or rewrites. The term may be based on what happens with a camera once it is set up the way it will be used to shoot the scene: the camera is 'locked down'.


Calculations in HTML?

HTML is a static language, you cannot do any math using only HTML. To do math, you need a scripting language such as JavaScript. Try this code: &lt;script type="text/javascript"&gt; document.write((2+3)*2); &lt;/script&gt; put this in your HTML page and it should display as 10


What is embedding java script?

To embed JavaScript code is to include it in the HTML page. For example, this will embed the code to display an alert: &lt;script type="text/javascript"&gt; alert("Embedded alert!"); &lt;/script&gt;


How do you put java script into HTML?

Javascript inside html &lt;html&gt; &lt;head&gt; &lt;script type="text/javascript" language="javascript"&gt; // Java script code here &lt;/script&gt; &lt;body&gt; // html code here &lt;/body&gt; &lt;/html&gt; Via External Link: &lt;html&gt; &lt;head&gt; &lt;script type="text/javascript" language="javascript" src="location of js file"&gt; &lt;/script&gt; &lt;body&gt; // html code here &lt;/body&gt; &lt;/html&gt;


How do you connect HTML on MySpace?

Connect? Myspace supports HTML so you should be able to input HTML tags like &lt;h1&gt; and whatnot into your page, if not then I can only suggest using &lt;html&gt;&lt;/html&gt; tags at the beginning and end of your pages.


What is the difference between script and scriptlet?

"script" is an HTML tag used to include JavaScript on a web page. Example: &lt;HTML&gt; &lt;body&gt; &lt;script type="text/javascript"&gt; document.write("hi there"); // javascript interpreted by the browser &lt;/script&gt; &lt;/body&gt; &lt;/HTML&gt; "Scriptlet" is a JSP construct used to include Java in a JSP page. Example: &lt;HTML&gt; &lt;body&gt; &lt;% // this is a scriptlet response.getWriter().write("hi there"); // Java executed on the server %&gt; &lt;/body&gt; &lt;/HTML&gt; Here the result (an HTML document with the text "hi there") is the same in both cases, but the mechanisms are different - Javascript runs in the browser (any browser), while the JSP scriptlet is executed on the server and needs a server with JSP support. See related links.


What is cascading style script?

CSS (Cascading Style Sheet) is a proramming language that is used with HTML to create the layout of a page.


How do you write javascript codes for website on a mac?

You can write java script code on any platform be it mac, linux, solaris or windows. All you need is a mac version of notepad, some html page where you insert your java script code and a web browser where you view the html page. All major browsers support java script coding and all you need to do is enable the Java Script support in browsers if it is not enabled already.