title: Passing a Javascript or PHP Variable to another page
body: <p>I have been trying to figure this out for two days and have had no luck.I am using PHP with Javascript and I am trying to access a Javascript variable on another Page.</p>
  
  <p>Here is my Javascript code which is only alerting the user what taskID is...</p>
  
  <pre><code>&lt;script&gt;
  function myFunction(taskID)
  {
  alert("Task #" + taskID);
  
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>Here is my PHP</p>
  
  <pre><code>//select all tasks for this report
              $tasks = mysqli_query($conn,"SELECT taskID, hoursSpent, workDone, plannedTasks FROM Tasks where reportID = $report_id AND projID = $proj_id");
              $task_count = 1;
              while($row1 = mysqli_fetch_array($tasks))
              {
                  $taskID = $row1['taskID'];
                  //display the task information
                  echo "&lt;strong id='tasks'&gt;Task #" . $task_count . "&lt;/strong&gt;";
                  echo " - &lt;a href = '#' onclick ='myFunction($taskID)'&gt;Edit&lt;/a&gt;&lt;br&gt;";
  
  
                  echo "Hours Spent: " . $row1['hoursSpent'] . "&lt;br&gt;&lt;br&gt;"; 
                  echo "Accomplished: &lt;br&gt;" . $row1['workDone'] . "&lt;br&gt;&lt;br&gt;";
                  echo "Planned for Next week: &lt;br&gt;" . $row1['plannedTasks'] . "&lt;br&gt;";
                  echo "&lt;br&gt;";
                  $task_count++;
              }
  </code></pre>
  
  <p>how can i pass that taskID to another page so i can edit the task information?</p>
  
  <p>Thanks!</p>