Define the session by clicking on the html link?
source link: https://www.codesd.com/item/define-the-session-by-clicking-on-the-html-link.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Define the session by clicking on the html link?
I have searched and tested different solutions all day without luck. In the below code I want (when clicked) to set a session on the "open" links I echo in the foreach loop. I tried using AJAX but I am new to AJAX and could not make it work. I know how to do it using GET but it is too risky, so i welcome your suggestion and preferably examples.
$task_array = array_combine($task_id_unique, $task_status);
foreach ($task_array as $card_nr => $card_status) {
?>
<table>
<tr>
<th>card nr.</th>
<th>Status</th>
</tr>
<td><?php
echo $card_nr;?></td>
<td>
<?php
if ($card_status == true) {
echo "<a href=workcard.php>Open</a>";
}
else echo "Done ". $card_nr;?></td>
</table>
What have you tried and what doesn't work, because this looks like what you need...
HTML:
<a href="home.php?a=register">Register Now!</a>
if(isset($_GET['a'])){
$_SESSION['link']= 'whatever';
}
And if you need to do it without a page refresh, then use AJAX.
Related Articles
jsp: Delete the file when you click the html link
The HTML link works incorrectly and appears invisible
shows the infowindow on the google map by clicking on the html link
How to define the HTML header using Mustache
JSP to define the HTML BASE tag
How do you define the html / body tag attributes in Meteor.js?
Redirecting the html link to the IOS application
Position of the cursor in the html link mailto
php function in the html link
How to correctly send the HTML Link tag to the database as an entry?
How to add 2 different OnClick methods in the HTML link
Creating an elisp function to convert the URL to the HTML link?
Replace the HTML link with the Javascript link
Extract the title from the html link
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK