Storing value of one HTML page and storing in database and using it again in another HTML page - html

I want to know that as I am using a number of HTML pages with different JavaScript codes and in one HTML page it shows total sales (the value will be entered by user) column which is multiplied by price (value will be entered by user) which will show the answer in next column. I want to use that answer in my next HTML page automatically or just by clicking one button by user.
How can I do that? Do I have to link .js file in script tag in another HTM page or I have to store the answer in database if I have to store. And if I have store answer in database how can I use it in another HTML page?

If you want to store data into a database. you need to use PHP and SQL. I recommend PDO and mysql.
Here is a w3c page on how to setup a connection:
connection to MYSQL with PHP

Related

VBA to create a form and load an attached image to it

Client has asked me to create a self contained tool in MS Access, versions 2007 and 2016. It needs to be self contained because it will be copied to and from various laptops at various times. The tool may not create, delete, or modify any file except the accdb database itself. When the tool is in use, the user is unlikely to have network or internet access.
One of the criteria is the creation of new forms each time it is run. I realize that Access is meant to have all the forms and their controls already built before deployment, but client doesn't want that. I have solved that problem, creating x number of forms upon certain conditions, and creating 30-40 controls on each form based upon certain conditions, each with their own events, etc.
Now, how do I load his logo into a control on each form? Remember, the accdb must be self contained, so I can't count on the logo being in a certain directory or even on the machine in use, and I can't write it to the file system myself.
I can and have loaded the logo (jpeg) into one of my tables in an attachment field. It will be the only attachment in that field. It would be just as easy for it to be its own table, if that helps.
I can create attachment controls with VBA, but I don't know how to set the ControlSource to the FileData inside the attachment with VBA.
I also have had poor success attempting to embed the picture in an image control in a hidden form and setting the .picture property to the image name. It only seems to be working on my machine.
So, how do I display an attached jpeg on a newly created form?
Just asked and answered in SO access-vba. Here's one solution.
Saving Image as OLE Object, in Access
Many others on google and SO search
EDIT: You must read the whole question to see the author's answer
Answer:
So, what I ended up doing was following this
https://support.microsoft.com/en-us/kb/210486
I use the readBLOB function to read the file and save it into the
database. Then, when I run a report or open a form that has the
picture, onload, I use the WriteBlob function to write the file to a
temp folder and then use that path to populate an Image object.

how to remove result set from html page

I have a MySQL database, and few perl scripts using which i am generating the webpages.
On Html page links are available,
For example-
Customer_link => (calls customers.pl) query executed - select * from customers.
Now there is one more link say Customer_in_mumbai => it should remove all the customers whose city is not mumbai.
How to achieve that?
do i need to execute the query once again with where clause or any other way is also possible so that i can simply remove the customers whose city is not mumbai?
Also if i need to execute the query again, do i need to write one more perl file, if not how can i use the same file?
You can use Javascript to manipulate on the client side of things after it's been loaded/displayed. There's nothing you can do on the server side to change a page once it's been downloaded without Javascript.
The rest of your questions indicate a lack of familiary with how dynamic web pages are generated. You can have a single page that does all that, using standard HTTP query variables to modify how the script operates. e.g.
http://example.com/yourscript.pl?remove=mumbai
then have Perl retrieve that remove value and use it to modify how the database query runs. But showing you that is beyond the scope of this site - we're not here to teach you, just help fix problems.
From your question, it seems you only want to remove it from the page temporarily for the user. You can achieve that simply by remove rows with mumbai as a value with Javascript. That should save you server side processing. Use a Library like JQuery to achieve it easily.

Rendering PDF without going back to server (wicked_pdf)

I am using wicked_pdf to render PDF. The app renders a table in HTML. This table is dynamic, in the sense that, the data in it changes every 30 seconds. When the user clicks on the "Download as PDF" link, the request goes back to the server and the HTML (slightly modified for PDF) is rendered.
But the issue is that since the request is back to the server, the data would have changed. This results in the PDF table showing values differing from the HTML table. The client doesn't want this.
Basically, they want a snapshot of the static table in PDF form, not the dynamic table. How can I do this using wicked_pdf?
Thanks,
Sridhar
Common Rails way here is to use timestamps.
You should pass your actual time to your controller, so it will fetch only supposed items, like.
# views
= link_to "pdf", orders_path(updated_at: DateTime.now, format: :pdf)
# controller
orders = Order.where(updated_at >= params[:updated_at])

Store web address in MySQL and display as link in HTML

I am a PHP newbie, but I'm making progress. I have made a small mysql database and PHP form that I am using to populate a web page that shows the upcoming gigs for a musician. It shows the date, venue, etc. and works fine.
What I'm trying to add is this: I want to be able to store the web address of the venue in the database and then use that address as the href for and anchor tag that says VENUE INFO. I've called the column maplink and set it up like all my other variables. When I insert the web address in my form it gets recorded to my database as text "maplink" (no quotes) instead of the web address that I entered.
Also the HTML I'm trying to use is
<p>VENUE INFO</p>
which I'm sure is terribly wrong.
I'm using PHP 5.3.8 and MySQL 5.5.16. Any help on how to go about this?
During insert into the database, you may have forgotten to append $ symbol to maplink to make it a variable.

using html forms in jsp file

I have a very simple question....I have multiple jsp files like login.jsp , Registration.jsp , forgetpassword.jsp each having their owm forms to take input from user. So, my question is.....Is it OK to have these many files or should I include all my html forms in a single file like user_auth.jsp and use javascript[Which i have no idea how to do] to display them individually......
All these files process the inputs taken by user against mysql database. I am using Struts 1.3.8 framework...
I don't think that anybody would argue that you should have all of those forms in a single file. Most web pages will have some sort of form on them, it's just how it goes. I would stick with your current model.