close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

set session variable using link

Thread began 9/01/2016 8:07 am by tony | Last modified 9/01/2016 10:54 am by Ray Borduin | 804 views | 2 replies |

tony

set session variable using link

Hi all,
I have a page with two links: link1 and link2.
When the user click link1, then the session FOO should be set to 1.
When the user click link2, then the session FOO should be set to 2.
Is there a way to do this with data assist?
And is there a way to set the session value without showing the session variable value in the address bar of the browser? (i.e.: using form instead of links)?
TIA for any help.

tony

Sign in to reply to this post

tony

Originally Said By: tony
  Hi all,
I have a page with two links: link1 and link2.
When the user click link1, then the session FOO should be set to 1.
When the user click link2, then the session FOO should be set to 2.
Is there a way to do this with data assist?
And is there a way to set the session value without showing the session variable value in the address bar of the browser? (i.e.: using form instead of links)?
TIA for any help.

tony  



Perhaps I found the solution (but I'm not sure WHY it works !!):
I changed the two links in the start page with two forms (each with only an image button to submit the form; the form action points to the "destination page").
Then, I added 2 "Set session variable" to the start page (using the "button.... pressed"):

===== "Set session variable"1
<?php
@session_start();
if(isset($_POST["img-1"]) || isset($_POST["img-1_x"])) {
$_SESSION["FOO"] = "1";
}
?>

===== "Set session variable"2
<?php
@session_start();
if(isset($_POST["img-2"]) || isset($_POST["img-2_x"])) {
$_SESSION["FOO"] = "2";
}
?>

Then I cut the code above from the start page and pasted it to the "destination page".

This way it seems to work.
But I cannot edit the SBs anymore because the form is not on the destination page.

Is there a better way to do this?
TIA

tony

Sign in to reply to this post

Ray BorduinWebAssist

You can open the destination page in dreamweaver and go to the bindings tab. Then click the plus button and add the "Form Data" from the form page so that it is available on the destination page.

Sign in to reply to this post
Did this help? Tips are appreciated...

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...