NetTalk Central

Author Topic: I want to send a link via email to view a netwebform ?  (Read 3774 times)

MikeR

  • Sr. Member
  • ****
  • Posts: 265
    • View Profile
    • Email
I want to send a link via email to view a netwebform ?
« on: June 10, 2013, 12:52:45 AM »
I want to send a customer a link to view a particular record on a netwebform.
I generated a link like this:

http://localhost:66/Showattachment?change_btn=change&_bidv_=Cq5gIpri

I get the bdiv from the p_web.addbrowsevalue function.

This link works fine when i'm logged on , but doesn't include the unique id for anyone else.
I don't want to send something like

http://localhost:66/Showattachment?change_btn=change&record_id=12334

Help

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11251
    • View Profile
Re: I want to send a link via email to view a netwebform ?
« Reply #1 on: June 10, 2013, 01:25:40 AM »
Hi Mike,

>> http://localhost:66/Showattachment?change_btn=change&record_id=12334

why not? I think I know why not, but it's helpful if you articulate why not. My next answer becomes clearer depending on what you say.

(no, bidv is related to your session, so is not the solution here.)

cheers
Bruce

MikeR

  • Sr. Member
  • ****
  • Posts: 265
    • View Profile
    • Email
Re: I want to send a link via email to view a netwebform ?
« Reply #2 on: June 11, 2013, 03:03:14 AM »
Because I don't want to reveal the IDNo (unique ID) to the world ?

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11251
    • View Profile
Re: I want to send a link via email to view a netwebform ?
« Reply #3 on: June 11, 2013, 03:58:48 AM »
>> Because I don't want to reveal the IDNo (unique ID) to the world ?

ok. so what you need is a table with a "one time code". In other words, you have a table with 2 columns - one contains some randomly generated string id, and the other the actual id field. When you send out the email you use the "random" field as the parameter.

then when the link is clicked you can read the table, do a fetch on the random value, and prime the "real value" from there. (You coulf then delete the record at the same time makeing the link a "one time only" link. Or you could have a timeout field(s) in the table so it gets deleted after 3 days or something.

Incidentally it's a good idea with web apps to use a random string id field for your tables if you can. This prevents a user "guessing" a valid id.

This whole approach is similar to what bidv is doing, but that's a very short-term link, which is in Ram, and is bound to a specific session.

cheers
Bruce

JohanR

  • Sr. Member
  • ****
  • Posts: 376
    • View Profile
    • Email
Re: I want to send a link via email to view a netwebform ?
« Reply #4 on: June 11, 2013, 10:49:13 AM »

Hi

I recently implemented this and used the following method..

Created a function that creates an encoded string , it contained the record id and expiry date, plus some arb data just for padding.
This string is then used in the mail link.

I like the idea of a one time link and might add this to the encoded string later.

On form load I collect the string from the url, and then call a function to retrieve the bits of data that I need.
record id or expiry date



Johan