I have an internal form that is web-based. Clients insert their information (Name and such) and sign using a signing pad (This is more than an image. It's the speed, pressure, ect of the signature).
I've got this working as PDF's, but the forms NOW need to be web based, and when the clients hit "save" the information they input is converted to PDF. This must be done server side.
Is there a way to program using HTML, JavaScript, or something else to do this?
Or is there a service that will do it automatically on the server?
Nothing can be saved locally.
(Short summary: information fields on local website, client inserts information to fields, signs using signing pad, and all information is sent to server and converted to PDF)
I'm not too familiar with PHP, but could PHP be used to do this? If so, how?
The reason i can't have it client side, is because we're trying to get the whole system to work on Ipads as well as desktop office computers
There are library to build PDF in PHP, for instance fpdf.
In fact there are many libraries out there which allow you to build pdf, you just have to learn their respective APIĀ a little.
Check out TCPDF. It's the PHP library to generate PDFs automatically.
I used FPDF, it's easy to download and the site contains useful tutorials. Good luck
use dompdf. check this link
From here check my answer on this question. You can download dompdf from here
Related
I have an excel file that contains around 3000 unique ids. I am creating a HTML form where the user will select a code from one of these ids. Similar to something where they click on the code field, which takes them to a new web page where they can either search a specific code or just select to show all and then manually select one code.
I am assuming that I need to use JavaScript or something similar over here to connect the excel file to the form, but I cannot find a specific answer to the question. I have seen a lot of websites like job application websites where they have you search for the university do something similar. But I am not sure where to begin. It would be great if someone pushed me into the right direction.
Javascript on the frontend (in a web browser) does not have access to the filesystem. You should use NodeJS (Javascript Runtime) which does run on the server side, and therefore has access to the filesystem.
Your specific issues can be solved with a simple HTTP GET or POST request to a small NodeJS server which will take the code as a query parameter and proceed according to the requirements you have.
I hope this helps.
I need to make a dead simple web application. Users hit a static HTML page and enter some basic info (name, and comment). When they hit submit, I want to store this info in either a CSV file or a sqlite on the hosting server. I know all of this is possible with django/python or ror/ruby but is there anyway to do this with just JavaScript?
Thanks in advance..
There's few ways to handle this, using just javascript. Which is to use a hosted Backend-as-a-Service.
You would need to make API calls on the client end, and will be able to connect to it without having to rely on a backend technology.
Most of these technologies are built for mobile, but you can still use it to build it on your static HTML pages. (cross browser issues may vary).
Here are some:
Firebase (https://www.firebase.com/docs/web-quickstart.html)
Parse (https://parse.com/docs/js_guide)
There's more out there if you google Backend as a service.
If you are looking for something more simple, just need to take information and store it (like a form), then I would suggest looking at these services:
Wufoo (http://www.wufoo.com/)
jotform (http://www.jotform.com/)
Hope it helps!
I'd like to present an idea to you that I think might help the privacy of the average user. I would appreciate any comment or suggestion on this.
I've been struggling for quite some time now with the need for a simple tool that I could share and use with my contacts who are only average users and not familiar at all with any cryptographic technology or the current tools available.
I'm planning to create a solution where one can easily encrypt a text message or a file with a single password and send it in email or chat or through whatever channel to somebody else. The solution should be entirely platform independent and usable without the need to install any extra softwares.
There are some text encryption websites out there that run client side encryption from JavaScript entirely. I find this approach currently the only possible solution. Also, there are libs for JS that already implement encryption:
http://crypto.stanford.edu/sjcl/
http://code.google.com/p/crypto-js/
Though the mentioned approaches store the message on their server, requiring you and your contact to trust it entirely. Because the server might present a different JS code to the user when visiting it after he gets the message by steeling the password and so revealing the secret.
While many think that it's not a good idea to do anything regarding cryptographic tasks in JS, I believe there is a need for a tool that is really platform independent (can be used on any tablet or PC) and still incredibly easy to use. The idea behind this is that I believe something is better than nothing. Sending information in plain text in email for decades with our current technology is wrong in most cases. There are times when we do need to share sensitive info via email and the other side might have any kind of system.
I intend to avoid the use of public key cryptography for the following reasons:
- it is very complicated to setup including the signing of each others' keys
- complicated to use it
- the user can loose his keys
- most of the time it needs and external software to be used and installed too
- a single password can be easily shared personally one time with my contact and he or she can keep it written on a paper wherever
The solution I came up with could be the following:
First of all, the browser and the operating system under it should be considered trusted.
There would be a static index.html page with embedded JavaScript. The page shows a textarea for the message and a textbox for the password. When hitting enter, the JS code generates a URL that itself will contain the encrypted message in base64 encoding. After digging I figured that 2000 bytes can be used for URLs just fine in every cases, so 1600 or 800 characters could be enough for short messages. This still needs planning.
So the encrypted message would travel with the URL. The website serving the index.html would of course use SSL with a valid certificate. While it seems an easy taks, of course it is not. The JS implementation should be carefully created to avoid easy attacks on it.
(URL shortener services could be used for it too).
Also, the question stands: How can I make sure that my contact can be certain about the origin of my message?
Well, the other side has to check if the domain is correct. Beside this, the implementation must avoid the rest of the attacks. If the URL gets changed during the travel of the email, then maximum the other side won't be able to decode the message with the password. That's what I believe. That it can be implemented this way.
About the file sharing. The solution should have a possibility to browse for a file, then encrypt it, then put it out for download to the user. This is just for him to be able to create the encrypted form of the file without the need for external tools. Then he could upload it to the cloud of his choice wherever (Google drive, Skydrive etc) and use that link in the URL of the JS solution to send it to his contact.
So if another link travels with the link, then the file from the remote host gets downloaded, decrypted and sent for download. All in his browser. If it's an encrypted message in base64 form, then it gets printed on the page after decryption (by the user providing his password of course).
Pros compared to other solutions:
- no need to implement a storage because no message nor file will be stored on the server, so the big players' services could be used
- therefore no need to reimplement the wheel regarding the storage question
- no need to trust a 3rd party because the server could easily be ours because it would be extremely easy to set up and serve it
- easy with even a free provider to host the static index.html
- because of its simplicity, the server can be hardened much better
- easy to encrypt with it in practice
- if one needs it, he could use the index.html by clicking on it from his desktop too, but that's not part of the original idea
My questions to you all are:
Do you find any flaw in my theory above? Could this really serve the average people by providing a usable tool for them that is more than nothing in times when they do need to send sensitive info to others?
Or does anything like that exist yet? Are there any better approaches? Different technology maybe?
Thank You.
I have a website that allows users to select a date range from a data set. At least, that's the goal.
What I would like to have happen: the user selects a date range, presses the submit button, and a script generates a JSON file which MATLAB reads to generate the graphs.
Any thoughts on resources to help accomplish this?
You'll need the script that fires off to be server side. JavaScript is client side and can not, in any way, access, modify, or otherwise create files on the client. You'll have to use a language like PHP to create the file.
Example using PHP:
Once the file is created, force a request on the client side to fire asking for the file. Set the PHP header to Content-Disposition: attachment; filename="< Place file name here>".
This will prompt the browser to launch a download prompt allowing the user to download the file.
Hope this helps.
You can use Downloadify, a small Flash component with a Javascript interface that allows you to create files on the client that a user can download. That's what I used in a similar situation.
You could also try and use Data URI but they are a quite limited and browser specific so some issues may arise.
These may be alternative solutions to the previous answer that suggested using server side code to generate the file.
Hii,
I want to retrieve data from sql database and display dynamically in div using javascript can anyone please help me on this...
Thanks...
You can not do that using only javascript, as sql queries should be done using server-side technology.
First, you have to find out what kind of web hosting do you have or can afford:
Web Hosting. Usually allows you to use PHP and MySQL.
Virtual Private Server, Dedicated Server. Lets you install anything you want on the host. But, it's usually 5-10 time more expensive.
I suppose you will take simple PHP Web Hosting, as it is cheaper and more avialable.
Here you go with a detailed beginner manual on getting data from MySQL with PHP and providing it to your page: http://www.freewebmasterhelp.com/tutorials/phpmysql
Generally, I can't give you more information than this, as it will same as writing a book on using PHP and MySQL. So I suppose you read that link I gave you, and open separate questions if you have some other specific questions.
If, by any means, you do not want PHP, then you should search for relative documentation.