how to generate an url  link to a specific record.

Hi there,

for customers (not users, they don’t have any login) i want to send a link trough mail so that the can alter a record in a form and save the result.

I already understand how to mail a customer i’m not sure how to generate an url link to a specific record.

The situation is as follows

A user (logged in) makes a record in the record is also the email for the costumer.
next i wan’t to mail that costumer so that he receives a link to the record in the database. the costumer is not a user and has therefor no login credentials.

The question is how to build a url link to a record so i can give that link in an email?

any suggestions?

Hi rotrax,

let’s say:
your project uses the domain named mydomain.com
and you have a table with records having a field id
and you want the customer to edit the record with the id=3

Generate a new form with NO security and name it customer_edit for example
go to Form settings > SQL > Where clause
and add there: id = [id_in_url]

[ATTACH=JSON]{“data-align”:“center”,“data-size”:“custom”,“height”:“280”,“title”:“temp.png”,“width”:“919”,“data-attachmentid”:85073}[/ATTACH]

Generate the form …

Then your url would be: [INDENT]http://mydomain.com/customer_edit/customer_edit.php?id_in_url=3[/INDENT]

When calling the url, the form will show the record with id=3 and let the customer edit the record.

Hope this helps.

temp.jpg

He GunterEibl,

I will try and let you know. thanks for the response!

He GunterEibl,

Wel that did work quite well. thanks! for a little security i would like to pas multiple vars through the url. only question… how do you do that with php?

i have this in my php script

https://www.keuzedelen.com/brixx/ond...tek?bpv_id_in_url={bpv_id}&st_id={st_id}”;

but after the & the url in the mail stops (works still though) been seen as url. i tried

https://www.keuzedelen.com/brixx/ond...tek?bpv_id_in_url={bpv_id} . & . st_id={st_id}”;

also not working

any suggestion

has anyone and idea how you can parse multiple vars though an url?

Hi rotrax,
It’s hard to say where the problem is. I assume it depends in the values in {bpv_id} or {st_id}

Usually I would code it like:

$link = “https://www.keuzedelen.com/brixx/ond...tek?bpv_id_in_url=” . urlencode({bpv_id}) . “&st_id=” . urlencode({st_id});

urlencode is a php function to make sure that the string is encoded for URLs.

Maybe better;
But you can also use step 1 in the following sample on my homepage:

https://asdw.de/en/place-button-at-a…ase-form-grid/

This uses an integrated macro of Scriptcase to generate the link and will make sure you’re following all of Scriptcase’s rules.

Hope this will help you.

Best regards

Gunter Eibl
email@GunterEibl.de

asdw.de - Scriptcase & Open Source projects (German/English)
scriptcase.coach - professional coaching for Scriptcase users (German)

1 Like

$_GET[‘varname’] with plain PHP (http://php.net/manual/en/reserved.variables.get.php)

[varname] with SC.

great it works like a charm. thx