Hi,

I have a drupal page that has a global rapper page (so I do not feel comfortable putting my custom code into it).

However, I am trying to have the named anchor link that is clicked direct to a PHP page that holds Javascript switch statement that would determine which link was clicked (by it's name) and match the name to the same name in an array list. If the match is true, it should serve up a vCard.

So far I have the file structure in place (7 different vCard and php files for each entry) but that was not feasible and I decided to try my hand at a switch statement to handle serving the appropriate vCard when the link from a previous drupal page is clicked. (yes I am still learning javascript and have tried it several different ways to no avail).

Is this even possible?

Here is the code in the new single stand alone PHP page that contains the switch statement. I am not sure how to make the Javascript remember from what link (name) of the drupal page was clicked. (am I making sense?)



PHP Code:
  <script type="text/javascript">
  
 
var 
vCard = new Array();

vCard[0] = "firstPerson";
vCard[1] = "secondPerson";
vCard[2] = "thirdPerson";
vCard[3] = "fourthPerson";
vCard[4] = "fifthPerson";
vCard[5] = "sixthPerson";
vCard[6] = "seventhPerson";
vCard[7] = "eighthPerson";
vCard[8] = "test";



    for (var 
j=0j<=anchors.lengthj++)
      {
           
      var 
empName anchors[j];
      var 
empCard empName.name;

    switch(
vCards)
            {
      case (
empName == "firstPerson"):
        
alert("show yourself");
      break;

      case (if 
== 1):
       
// some code here
      
break;

      case (if 
== 2):
       
// some code here
      
break;

      case (if 
== 3):
       
// some code here
      
break;

      case (if 
== 4):
       
// some code here
      
break;

      case (if 
== 5):
       
// some code here
      
break;

      case (if 
== 6):
       
// some code here
      
break;

      case (if 
empName == "seventhPerson"):
       
// some code here
      
break;
    
    default:
      
alert("Choose a Vcard by scanning or clicking on it");

            }

      */            

        }
    

   
</script>