Jambo
Member
Registered: 8th Sep 01
Location: Maidenhead, Drives: VXR Arctic
User status: Offline
|
Got to knock something up for work, I am not in any way shape or form fluent in any design language, I have briefly used HTML before on Google sites to do very, very basic things before like Hyperlinks etc...
Wondering if you guys know if this is possible?
We have a reg lookup system for use internally and require a slightly easier method of use.
Currently, we have a link that provides raw data in a messy format but it is legible. The problem is to access it we just have a URL, the URL contains a random registration and when you click on the URL/Link it takes you straight to the vehicle information for this random reg. It is simple to use, you just delete the random reg out of the URL, and input the one you are after information for, then press enter/go and it populates.
I was thinking of some sort of box, via Google sites that the end user simply inputs the Registration and presses "GO" and that function of go, uses the reg that was inputted in the text field to complete the URL and access the data. Thus avoiding messing around with the URL.
Im a n00b to these sort of things, is this even possible? If it makes a difference the reg is not at the end of the URL annoyingly, its mid way through.
Is what I am asking possible? Or do I need to be a jeans and tshirt wearing developer to do this.....
Halp.
[Edited on 02-04-2014 by Jambo]
|
Ian
Site Administrator
Registered: 28th Aug 99
Location: Liverpool
User status: Online
|
Piece of cake.
Any HTML form with a GET method can be adapted with your URL.
code:
<form action="http://www.regcheck.com/path/to/script.php" method="get">
Reg: <input type="text" name="reg"><br>
<input type="hidden" name="authcode" value="abc123">
<input type="submit" value="Submit">
</form>
Form tag - tells the script where to direct to.
First Input tag - asks for the reg
Hidden Input tag(s) - contain anything else you need on the URL that you don't want to have to ask for
|
Ian
Site Administrator
Registered: 28th Aug 99
Location: Liverpool
User status: Online
|
quote: Originally posted by Jambo
If it makes a difference the reg is not at the end of the URL annoyingly, its mid way through.
Doesn't make a difference
[Edited on 02-04-2014 by Ian]
|
Jambo
Member
Registered: 8th Sep 01
Location: Maidenhead, Drives: VXR Arctic
User status: Offline
|
Ooooo
Going to have a play, if this works, will personally kiss you.
|
Jambo
Member
Registered: 8th Sep 01
Location: Maidenhead, Drives: VXR Arctic
User status: Offline
|
The username and password to our account is contained within the URL, will this affect security with the GET function?
|
Ian
Site Administrator
Registered: 28th Aug 99
Location: Liverpool
User status: Online
|
You're only doing the same as you are now, just with a form.
The form is creating that URL for you.
So whatever problems you had in the past with user/pass being stored in browser history etc. are still present.
You can also host on your computer, doesn't need to be uploaded anywhere. Although the hosting server wouldn't see the user/pass as that goes straight from your browser to the server which is accepting the URL.
No different really. Just not manually populated.
But yeah, file can go on your desktop somewhere, just needs a .htm extension so it'll open in a browser. But it contains the complete path to the reg plate script - therefore can be called from anywhere else.
|
Ian
Site Administrator
Registered: 28th Aug 99
Location: Liverpool
User status: Online
|
In fact - you might want to store the user/pass as hidden input tags - in which case yeah - don't upload it anywhere you don't want those public.
Probably best to make the file and pass it round and have every save it locally unless its loads and loads of people.
|
Jambo
Member
Registered: 8th Sep 01
Location: Maidenhead, Drives: VXR Arctic
User status: Offline
|
Cheers Ian, just checking.
I have entered it into Google sites, it "works" but keep getting http status400 errors. The URL looks like half is missing. Trying to switch it around till it works. Exactly what I was looking for though Thanks
|
Ian
Site Administrator
Registered: 28th Aug 99
Location: Liverpool
User status: Online
|
Like this inside the form:
code: <input type="hidden" name="user" value="jambo1">
<input type="hidden" name="pass" value="kissme">
That one I probably wouldn't upload anywhere I didn't trust fully.
|
Ian
Site Administrator
Registered: 28th Aug 99
Location: Liverpool
User status: Online
|
quote: Originally posted by Jambo
The URL looks like half is missing.
Get a good URL and cut it up between the &, for example
http://www.regcheck.com/path/to/script.php?name=jambo1&pass=kissme®=AB53ABC&lang=en&page=1&name=value
Becomes
http://www.regcheck.com/path/to/script.php
?
name=jambo1
&
pass=kissme
&
reg=AB53ABC
&
lang=en
&
page=1
&
name=value
Each one of the name/value pairs needs to be either a input type=text or probably a hidden if it won't change
So
name=jambo1
pass=kissme
reg=AB53ABC
lang=en
page=1
name=value
Becomes
<input type="hidden" name="name" value="jambo1">
<input type="hidden" name="pass" value="kissme">
<input type="text" name="reg" value="">
<input type="hidden" name="lang" value="en">
<input type="hidden" name="page" value="1">
<input type="hidden" name="name" value="value">
The & gets discarded, they're just to separate the pairs in a completed URL
[Edited on 02-04-2014 by Ian]
|
Jambo
Member
Registered: 8th Sep 01
Location: Maidenhead, Drives: VXR Arctic
User status: Offline
|
Its hosted on a site that isn't publicly accessible so not too worried, just didn't want to external link flagging up. But as you say if we are accessing from a URL currently it makes no difference.
The begining of the URL is there, the username field which follows is missing (present in the first GET line of code) plus a bunch of other random words. Then it populates the reg as required, enters the password afterwords as instructed. But the username field is missing. Just trying to juggle it about to make it work, very confident it will.
|
Jambo
Member
Registered: 8th Sep 01
Location: Maidenhead, Drives: VXR Arctic
User status: Offline
|
Ah that makes a tad more sense, I am a n00b. didnt realise you broke it down via the ampersands. Trying v3.0...
|
Jambo
Member
Registered: 8th Sep 01
Location: Maidenhead, Drives: VXR Arctic
User status: Offline
|
I am struggling with this but enjoying this immensely. Thanks Ian,
99.9% there, struggling with a minor discrepancy! Kiss imminent
[Edited on 02-04-2014 by Jambo]
|
Jambo
Member
Registered: 8th Sep 01
Location: Maidenhead, Drives: VXR Arctic
User status: Offline
|
IT WORKS YOU BEAUTY
|
Ian
Site Administrator
Registered: 28th Aug 99
Location: Liverpool
User status: Online
|
|
JordyCarter
Member
Registered: 14th Mar 10
User status: Offline
|
wtf ians some sort of java guru?
|