Generate QR code to special page - php

I have qr code that generate code to my website www.myweb.com. But I want to customize : If visitor website generate code from QR code use smartphone it will redirect to www.myweb.com/qr.php. This the algorithm scheme:
If visitor website -> QR code
redirect to www.myweb.com/qr.php
Else
redirect to www.myweb.com
Any trick for that on PHP language, without change my QR code because I have already print on all collateral, like sticker, card name, etc ? I have search but not find yet.

If the link from the QR code is simply www.myweb.com, I'm afraid you are out of luck. There is absolutely no difference between reading a QR code and accessing the link and manually typing in the address.
The only possibility is you may be able to catch certain visitors if they are using an app to read the QR code, subsequently view the target page in-app, and said app has something identifiable about it's User Agent string. I have not experimented with this, but I would suspect this is actually not the case.

Related

How to make a web page accessible only after scanning a QR code

Good day. I want to make a simple CRUD guest form system with Laravel. I want to make a web page containing a form that only can be accessed after scanning a QR code. Here is the flow:
User -> Scan QR code -> Access to web page -> Fill in the form -> Submit.
The problem is that after scanning a QR code the user will directed to that web page with a link shown to the public, making that the user can copy or save and access the link later without actually scanning the QR code again. This will let user to input their data even without being asked or scanning the QR, leading into a data redundancy in the database.
Is there any idea how can I make this to work? Or maybe another solution?
Thank you.
If you want to create a link with temporary lifetime and signed, you can create signed URL and use that. have a look at the documentation.
https://laravel.com/docs/9.x/urls#signed-urls

Restrict site access to QR scans only

I saw a few questions out there already about ensuring site access comes from QR code scans, but they seemed to be focused on analytics purposes (tracking where traffic was coming from), whereas my interest is in security/privacy.
I want to set up a site that can only be accessed when a provided QR code is scanned. In other words, I don't want the URL that the QR code possesses to be able to just be manually typed/pasted in for site access via other means.
I've been googling this issue for a bit with no luck whatsoever. I'm trying to think of a way with referring URLs or other means to ensure that a person arrived at the site by actually scanning the provided QR code.
EDIT: The solution would need to be scanner-independent as well (i.e. I cannot force users to download and use a specific QR scanner app) and cross-platform (Android + iOS + WinMo + BlackBerry, etc.).
Now I submit the issue to you wonderful folks.
We got something the same at our company. We provide a link like:
zxing://scan/?ret=http%3A%2F%2Ffoo.com%2Fproducts%2F%7BCODE%7D%2Fdescription&SCAN_FORMATS=UPC_A,EAN_13
Where {CODE} is the code which is returned in the QRCode. So what you can do is create an url like above (see more info for a link). And then put a encrypted data in the QRCode, so only if this url is clicked by the user and the data of the QRcode is correct. People can continue to go on your website. This way if the qrcode is leaked, they won't know the site. And if they know the site, the code is encrypted.
If people scan the barcode by clicking on your website. The zxing will open a new browser with the URL and the {CODE} filled with the scanned code.
But, people do need the barcode scanner from android or iphone.
More info:
zxing download / homepage
zXing scanning from w
You can't ensure that the URL came from scanning the QR code, that isn't possible. QR codes are just a method of encoding text, once the user knows the text they can do whatever they want with it.
You can, however, restrict the usefulness of the QR code so even if it is leaked it isn't useful. If possible, I would start by generating the QR codes on-demand with a random seed and have them expire shortly thereafter. This would make it so even if the QR code were leaked, it wouldn't be useful for very long.
About the best you can do is set a query string in your QR code. Something like:
http://www.example.com/myapp
Could be changed to something like:
http://www.example.com/myapp/?qrcode=1
This can then be handled in PHP with:
if(!isset($_GET['qrcode'])) die();
The problem with this, of course, though, is that anyone with the URL could simply navigate directly to that URL in their normal web browser.
This isn't something you can prevent, however.
You can also check whether $_SERVER['HTTP_USER_AGENT'] claims to be a mobile phone. Here's another question on the topic.
You could add parameters, but ultimately QR codes are just a method of encoding text, so whatever you encode can be typed into a browser if someone knows what's encoded.
If you are making post call to any web URL from QR code, then whatever body you are sending with it, will not be visible unless user went through QR scan mode.So by just entering Web URL user will not able to access web URL contents.

Determine unique phone attribute that scanned a QR code

All,
I'm allowing a user to scan a QR code and when they do I'd like to identify them by an attribute on their phone. Is there something that I can use or get from the mobile device (since they can use an iPad and not just a phone) to distinctly identify the user that scanned the QR and doesn't change like an IP address?
I'll know all my users who will be scanning the QR code so I'm trying to get a static and unique piece of information so I can identify them do they don't have to select their userid.
Please let me know if anyone has had any experience doing something like this.
Thanks!
If the QR content is a URL you can simply set a Google Analytics tag on that URL.
Although that won't give you information about the people who scan your code but the ones who scan your code AND follow the URL, that is usually an acceptable trade-of.

QR Code Location Check

I have been told to work out a means of calculating whether a user has accessed a website from scanning a QR code or by accessing through normal methods. The company are using Google Analytics. Ideally the system would calculate what country the user is in when the QR code was scanned, although I think Google analytics does most of this for me.
My initial idea was to have a blank redirect page in the middle of the QR code and the full site, and put some separate analytics code in to that. Alternatively I could perhaps throw in a PHP referrer script that alters the analytics code based on the response, but this would still require a landing redirect page.
I'm a bit of a newbie, and this is quite a big client, so I thought I'd ask on here before starting anything that might not be the best method!
That’s one good option. Another would be to use a query string parameter in the URL, like this:
http://example.com/page/?from=qrcode
If you have control over the QR codes, you can add a GET variable to the URL, and then in your index page, you merely test for the QR-code GET variable and {do magic} if it is set or has a certain value.
I would use an intermediate page, as it gives you one point of entry for all QR encoded URLs.
From the QR code:
http://yoursite.com/qr.php?url=http%3A%2F%2Fyoursite.com%2Ffoo.php
Anywhere else:
http://yoursite.com/foo.php
Then on qr.php, you would simply use a header() redirect to $_GET['url'] after you're done with whatever statistics you're going to record or analyze.
Well if you can change the QR code:
-change the info to something like www.client-site.com\landing.php?referer=qr
You can check then in your landing.php
If you can't (then it is messy):
-when accessing through QR code then the HTTP_REFERER is empty and the client is using a phone with a certain browser, you can use this info to determine if he is using a phone and accessed the page directly (90% of cases people use Google before goint directly to a site- in this case you have a HTTP_REFERER)
Hope this helps...
I would build your URL for the QR code using Google's Analytics URL builder.
That way, you don't have to create custom filters are anything. Also, if you ever create new QR codes in the future on any other marketing material, you can track which marketing concept worked easily, rather than just saying that it was just a QR code that brought them to the site. Good luck.

PHP server problem

I've build a web site that get source code of the link entered by the user using(HTML DOM), then checks the source depending on standards.
the problem is some web sites can't evaluate.
this is My Web Site link you can check from here.
when you enter google URL in the text-box, the web site functionality works successful, but when trying the example http://www.alwatan.com.sa/Default.aspx it doesn't work. no information appear.
can one help me?
The URL http://www.alwatan.com.sa/Default.aspx automatically redirects to http://www.alwatan.com.sa/Default.aspx?issueno=3902
If you enter the URL with the query string, your application works (presumably) as intended.
I imagine there is no content at http://www.alwatan.com.sa/Default.aspx, and the issueno is a required parameter.

Categories