Re: Array Javascript
| From: | Marek Kilimajer | Date: | Thu, 05 Sep 2002 12:00:11 +0000 |
| Subject: | Re: Array Javascript | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-115296@lists.php.net to get a copy of this message | ||
You have a JavaSript array on the client side, so you want to provide some "click here" link or button.
The whole thing will look like this:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Untitled</title>
<script language="JavaScript">
<!--
var myArray;
var tmp,url,separator;
myArray = new Array('one','two','three');
function sendArray(){
url = 'http://site/script.php?';
while(tmp = myArray.shift()) {
url += separator + 'phparray[]' + escape(tmp);
separator = '&';} document.location.href = url; return false; } //--> </script> </head> <body> <a href="" onClick="return sendArray()">Click Here</a> </body> </html> kale wrote:
This is a javascript? Where must I put this lines? Thanks for help. Kale. -----Original Message----- From: Marek Kilimajer [mailto:kilimajer@webglobe.sk] Sent: Thursday, September 05, 2002 2:31 PM To: PHP Subject: Re: [PHP] Array Javascript var tmp,url; url = 'http://site/script.php?'; while(tmp = myArray.shift()) { url += 'phparray[]' + escape(tmp); } document.location.href = url; In script.php, you'll find array named phparray kale wrote:Hy, I have an array make with a javascript. How can I read values with PHP from it? Kale.