4

Define the session by clicking on the html link?

 2 years ago
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?

advertisements

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

I want to delete files after a click on an HTML link in a jsp page. The following is my jsp code: <% File f=new File("c:\\Folder\\1.jpg"); f.delete(); %> What href should I use in the HTML code? <a href......>Delete me </a> For

The HTML link works incorrectly and appears invisible

I am trying to add a simple HTML link to my code, however it is not showing up. The links for the navigation bar show up just fine,however regular links are only showing up as invisible, meaning I can only see it by mousing over it and it does nothin

shows the infowindow on the google map by clicking on the html link

Is there a way to activate the info window on google map from the external link? The html and js code is below. I would like to have a simple external link to activate infowindow of markers. Any help would be gratefully appreciated Sajja :) <!DOCTYPE

How to define the HTML header using Mustache

I'm using Mustache.java and I did not find a simple way to set the HTML header. I want to set content="text/html for example. My Java code for rendering a mustache file is: @Path("/home") @GET public static String getIndexPage(){ MustacheFa

JSP to define the HTML BASE tag

I am running an application using jsp (gsp actually) under Tomcat. All URLs are absolute. That is, every href begins with a "/". For example: <a href="/mytool/role/index" class="menulink">Role</a> Every request wi

How do you define the html / body tag attributes in Meteor.js?

I need to set attributes on the html tag or alternatively the body tag of the document in a Meteor.js application. Specifically I want to have <html dir="rtl"> or <body dir="rtl">.. Trying the latter, I receive the console

Redirecting the html link to the IOS application

I am new to IOS development.I want to know there is any way to redirect from normal html link(safari browser) eg <a href="my sdk link">click here to download the awesome app</a> to my SDK (here I want to find out IDFA for user tracki

Position of the cursor in the html link mailto

When using the additional parameters in a mailto:// hyperlink, the cursor is placed at the start of the message. Is it possible to set the starting position of the cursor to another location in the body text? For example, consider the following HTML:

php function in the html link

I am attempting to call a website root by using a PHP function within a HTML link. I have created the function bloginfo() below and the correct link output is http://www.example.com/subdirectory/file.php. The two methods of calling the function are s

How to correctly send the HTML Link tag to the database as an entry?

I have a a multifile upload script that converts uploaded files to zip. It works flawlessly.Only problem that I have is uploading data to the database. I tried everything and the databse still doesn't get any of the data. Two things: 1: I want to sen

How to add 2 different OnClick methods in the HTML link

I don't know how to add this 2 action for onclick html link, someone can help me? the first: onclick="myFunction()" the second: onclick='document.cookie="firstname=John;expires=Wed, 18 Dec 2023 12:00:00 GMT"' I want someting like this:

Creating an elisp function to convert the URL to the HTML link?

I'd like to create some sort of elisp function and bind it to a key that takes a URL, in one of two formats, and generate an HTML link element. Here are the two input formats: http://developer.apple.com/safaridemos/ http://developer.apple.com/safarid

Replace the HTML link with the Javascript link

I would like to change URL link of one of buttons in my navbar of my site to a javascript link. The following is what I have now: `<a href='http://www.oldlink.com' rel='nofollow' class='deals' target='_blank'> </a>` I would like to replace htt

Extract the title from the html link

I have the following HTML string: <a href="/tothepage" title="the page">The Link</a>. How can I extract title from the HTML snippet with ease? Either a regex or other VB.NET solution is preferred but C# is ok. I want 'the p

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK