Jump to content

Save to File and Email Notification...


BoB3rt
 Share

Recommended Posts

Hello to all.I am in the early stages of coding and hoping i can get some help or pointers. First off i am a newbie when it comes to php and from reading up it seems to be what i will need.I am creating a form that upon completion will:

  • save to an Excel (.csv) Document - Preferably to a desired Tab within the .csv file indicated using a drop down box.
  • Emails a specific person again depending on the drop down box.

I have firstly done the Design which was quick and simple and am now working on the Emailing. However i have found it is not possible to have 2 actions from the one submit button so this is also an obstacle i am going to have to over come and hoping for some advice with this.Many thanksRobert P.S. will post up what code i have once i have put it all together.

Link to comment
Share on other sites

CSV files don't have tabs by the way, they are just text files. Native Excel XLS/XLSX files have multiple spreadsheets in the same document, but plain CSV files do not.
Yeah i just found this out for myself today, i have only ever used the csv. file for a basic result in the past.Is there a possible way to save the results in an XLS/XLSX file and assign them to specific 'tabs'?
The form can perform as many actions as you want it to. Just make the server-side page that the form links to do all of it.
I am pretty much a newbie at this but i am assuming it is better to have the php(server-side) code on a separate document, upon clicking submit it reffers to the page and runs the actions required? What would you reccomend the first step / tutorial i should take to get this started. I have been through pages upon pages of other peoples Questions on the internet and got myself a few text books, but putting the pieces together can be rather difficult. Edit: i have decided to begin with setting up a form that just emails the information to a desired recipitent using a drop down box. how do i define the server and connection properties in php, does this need to be done with a php.ini file? thanks Edited by BoB3rt
Link to comment
Share on other sites

There are several libraries available to use PHP to write Excel documents. http://www.google.co...channel=suggest Keep in mind that Excel will only load 256 columns and 65536 rows per worksheet, so if your data can get arbitrarily large then you'll need to find a workaround, like detecting when the maximum number of rows has been reached and starting another worksheet. Creating Excel documents can also be fairly memory-intensive. For help getting started with the forms, look at the PHP form tutorials on the site and check this thread also: http://w3schools.inv...showtopic=12509 That will give you general information about processing forms, you can learn how to do the specific things you want individually and then combine them in your form handler. In the thread I linked to, notice how the form handlers start basic with nothing except the logic to start processing the form, and then the actual actions get filled in later. The actions can be anything you want.

i have decided to begin with setting up a form that just emails the information to a desired recipitent using a drop down box. how do i define the server and connection properties in php, does this need to be done with a php.ini file?
How do you intend to send the email? Do you want to use a remote mail server that you have access to?
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
 Share

×
×
  • Create New...