Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Passing array variable with embedded URL link?

Mark StrijbosMark Strijbos Member Posts: 82
Need to build a pagelink that contains an array variable that has to be passed. how do i do this?

this code doesn't work:
[code]
$data[0]["name"] = "January";
$data[1]["name"] = "February";
$data[0]["value"] = "31";
$data[1]["value"] = "28";
echo "CLICK HERE";
[/code]

when this link gets clicked, the $mydata variable is shown in the URL box as [code]mydata=Array[/code] but i can't get to the values "inside"

This has got me really stumped, any help or ideas would be most welcome
and appreciated






Comments

  • jeskejeske Member Posts: 23
    : Need to build a pagelink that contains an array variable that has to be passed. how do i do this?
    :
    : this code doesn't work:
    : [code]
    : $data[0]["name"] = "January";
    : $data[1]["name"] = "February";
    : $data[0]["value"] = "31";
    : $data[1]["value"] = "28";
    : echo "CLICK HERE";
    : [/code]
    :
    : when this link gets clicked, the $mydata variable is shown in the URL box as [code]mydata=Array[/code] but i can't get to the values "inside"
    :
    : This has got me really stumped, any help or ideas would be most welcome
    : and appreciated
    :
    Hi,
    Your Months would be the element key, so you don't need the [0],[1], etc.
    Then, you will need to identify which element to include.
    [code]
    $data["January"] = "31";
    $data["February"] = "28";

    echo "CLICK HERE";
    [/code]

    Hope this helps.

    Jeff
  • Mk. IIMk. II Member Posts: 16
    : Your Months would be the element key, so you don't need the [0],[1],
    trust me, i do - not in this example perhaps but in my real world app

    : Then, you will need to identify which element to include.
    : [code]
    : echo "CLICK HERE";
    : [/code]
    sorry, not good enough; this is just passing 1 parameter...
    i want to pass the _entire_ array in one fell swoop and both the
    size & contents of this array are variable




  • Justin BibJustin Bib USAMember Posts: 0

    ___ | http://forcoder.org | free ebooks and video tutorials about [ PL/SQL Perl Visual Basic .NET R Assembly JavaScript PHP C Scratch Visual Basic Java Python Delphi Objective-C C# Ruby Swift C++ Go MATLAB Rust Bash Kotlin Erlang FoxPro Logo SAS Hack Lua Scala Apex LabVIEW Clojure F# VBScript Fortran Crystal ML Alice Ada ABAP Awk Dart D Scheme Prolog Julia Transact-SQL COBOL Lisp ] _____________

Sign In or Register to comment.