Jump to content

XHTML, Javascript, or both?


SmokingMan

Recommended Posts

Just a general question. If I wanted to make a form where the user could input information from drop down lists and such, how would I convert that form input to a page that has been formatted for printing? Can this be done through the XHTML code, or would you need to use JS to take the info from the form and format a new page for printing?

Link to comment
Share on other sites

If you're going to take the info and format a completely new page for printing, then it's best to use a server side scripting language. Not only it's faster and leaner, but it would also allow you to validate the data before creating the page if needed.

Link to comment
Share on other sites

I'm going to want to create a page from the form input, so it can be printed out for faxing. The customer would use the form to input their order, and then I want to be able to format a printable page so it can be faxed in to the restaurant with their order. Would PHP do what I want? Of course now that means I've got something else to learn :) WIll it never end? :)

Link to comment
Share on other sites

Faxed automatically by the server? Damn... you're making it VERY hard.In order to fax something with PHP, you'll need some sort of fax extension (not built in PHP that is) or write your own one (with C(++)). Or use PHP to execute a premade application (again: made with C(++)) for doing that task. For both of those, you'll need to have full control of the server, but if you do, you might be better off simply putting the server in the restaurant, attach a printer to it, and print the page, instead of faxing it. I mean, printing a page might be easier, scince every computer has built in facilities for printing. You'll only need to execute an application that will "press" the print button.

Link to comment
Share on other sites

I guess I wasn't too clear :) . I want the customer to be able to input their order into a form, then have the site format the input into a printable page so they can print it out and then use their fax machine to fax it to the restaurant. My brother bought a restaurant and he wants a basic web site with the capability for the customer to fax their order in so it will be ready for pickup when they get there. I volunteered to do it for him and I thought this would be an easy way to do it.I've just coded as a hobby up to this point. This will be my first foray into an actual site that really does something :)

Link to comment
Share on other sites

Well, in that case, as I said, look no further then PHP. Simply take the input of the form, validate it (where needed) and create a new XHTML printer friendly page from it. PHP can do that with ease.

Link to comment
Share on other sites

Well, in that case, as I said, look no further then PHP. Simply take the input of the form, validate it (where needed) and create a new XHTML printer friendly page from it. PHP can do that with ease.
You can, perhaps, also use stylesheets to format the page specifically for printing. Just create a new stylesheet and link to it on your page with something like this:
<link rel="stylesheet" type"text/css" href="print.css" media="print" />

I use this method often. If there is some content in a container on the page that I don't want printed, I simply set the display for that container to "none". This way you only have to maintain two stylesheets rather than two PHP or HTML pages.

Link to comment
Share on other sites

The extra step for the customer to print and fax their own order might lose some business though. It would be better to have the thing totally automated so that the customer doesn't need a printer and a fax machine to use the site. If nothing else, you can have the server send an email to someone's cell phone telling them a new order has come in, and they log in and print it themselves.

Link to comment
Share on other sites

The extra step for the customer to print and fax their own order might lose some business though. It would be better to have the thing totally automated so that the customer doesn't need a printer and a fax machine to use the site. If nothing else, you can have the server send an email to someone's cell phone telling them a new order has come in, and they log in and print it themselves.
That was my first suggestion. But he wants the orders faxed, not e-mailed. Even though I am his older brother, it doesn't mean he actually listens to me :)
Link to comment
Share on other sites

The order itself wouldn't get emailed, just a notification that an order has been placed, and then someone at the restaurant logs on (or hits refresh) and prints the new order. I have email alerts coming to my cell phone, and that type of thing works pretty well.Or, if you have control of the server, you can install a fax program on the server itself and have the server send the fax.Either way, if the customer is responsible for printing and faxing, I can almost guarantee he's going to lose a certain amount of business. How much business I'm not sure, but he will lose some.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...