I have a form on my webpage, Its not inputing the data to the text file and when i click submit there is an error page. What should I do?

Recommended Answers

All 10 Replies

Sorry, I don' fully understand what you are saying. Perhaps a little more info would be helpful.

What is your form trying to submit?
What text file are you talking about, do you mean text field?
What error are you getting?
What does your form do when submit?

I wanna help ;-)

Sorry, I don' fully understand what you are saying. Perhaps a little more info would be helpful.

What is your form trying to submit?
What text file are you talking about, do you mean text field?
What error are you getting?
What does your form do when submit?

I wanna help ;-)

Well my problem is that I have a form on my webpage, I am trying to get contact information from clients. I am having trouble having the data saved. I was wondering what I should do.

OK,

How are you trying to save the data?

I expect you will have a DB, text file or e-mail integration on the server to handle this...

What is the error? Is the data being submit to the server correctly and the server script is throwing an error, or is the web page is throwing an error prior to submit....


Peace,

OK,

How are you trying to save the data?

I expect you will have a DB, text file or e-mail integration on the server to handle this...

What is the error? Is the data being submit to the server correctly and the server script is throwing an error, or is the web page is throwing an error prior to submit....


Peace,

Yes there is a textfile on my server. I have also tried to use dreamweaver and frontpage both to edit. But both still come back that its not saving. And still kicks an error at me.


Cheers

And what are you using to write to the text file on the server? Java, PHP, etc...

Remember two very important things, 1) you must have write access to the folder and file on the server for the account the script doing the writting is running under... this is a common error... 2) you must open the file in either append or write mode depending on your needs before you can write to it... if your opening the file in read mode, which is often the default, then you will get an error when you try to write to it...

And what are you using to write to the text file on the server? Java, PHP, etc...

Remember two very important things, 1) you must have write access to the folder and file on the server for the account the script doing the writting is running under... this is a common error... 2) you must open the file in either append or write mode depending on your needs before you can write to it... if your opening the file in read mode, which is often the default, then you will get an error when you try to write to it...

Everything right now is in HTML. The script is all set I even checked in dreamweaver. The text file properties are also set to archieve.

You need to write some kind of program to run on the server; that accepts the data submitted in the form and outputs it to the text file. Such a program might only be a couple of lines long; but it needs to be there.

This program needs to be stored on your server in a publicly accessible folder with execute permissions ( I can't give any specific tips without knowing your server OS, and what lang you'd want to write the program in; but putting the program in the cgi-bin folder if you have one is usually a good way to give it execute permissions implicitly ). You then set the form's action attribute to the URL for your program.

For writing the program; if you use a scripting language like Perl, PHP ( or ASP if you have a windows server ); then you won't need any special tools other than a text editor and an FTP client.

Do some research into CGI ( the common gateway interface, which is a part of the means by which form submissions are sent to programs ), the languages PHP, Perl, and/or ASP, and file access in those languages.

Air is a drug, and we're all addicted to it ;-)

OK, thanks, that is where I was trying to go here... I suspected that you didn't have anything running on the server to write the data to the file...

Javascript and HTML only run on the client machine, that means in the browser of ther person who is viewing the site... we'll not get into server side Javascript just now, but basically he's right, something on the server has to process the form data otherwise it is like throwing it out into the abyss and expecting to know where it went...

No browser can write files to your server for you, the server must do that itself...

By the way, you can run ASP files in Apache if you load the ASP library... the question is... "Why would you...?" ;-) You can also run PHP, Perl, etc. on a Windows server, but the questions is again... "Why would you...?".....

Peace,

I'd be more inclined to run Perl on Windows than I would be to run ASP on *nix ^_-

Java is a good bet for sure-fire compatibility; but, to the original poster, you'll need to know and understand the difference between compiled programs and source code. I suppose, the main advantage ( and strangely the main disadvantage ) with PHP/Perl etc, is that the source code is the program.

Unfortunately, I've never found a good "beginners tutorial" to CGI, that isn't focussed on a specific language, too complicated, or too empty of substance; The best advice I have is to Google "CGI" or "form handling", and follow links until you have enough information to do what it is that you need to do.

I totally agree on all points above, running Perl on Windows would be better even than running ASP on Windows in my opinion ;-)

I learned Perl & CGI back in about 94 or 95... A good friend, who was an Engineer at Boeing, raved about it. See, they had a great deal of technical data which had to be formated into reports quarterly for the management. They spent almost as much time on the reports as they did generating the data... His team learned Perl so they could automate the report generation based on template designs and then they could focus on the Engineering... It was a huge success, they got perfect, upto the minute reports anytime they wanted...

Then 1/2 of them got fired because they could now do twice the work as before.... no just kidding there... ;-)

Anyway, When I learned CGI, it was ALL about Perl..... Java, JSP, etc. were not even blips on the screen... I found Perl a good way to start, but I quickly ran into Perls problems back then. It was designed for "text manipulation" not application development... so generating reports, reading and writing files, etc. was so easy it was great, but trying to automate matmatical calculations or manipulate data in an Excel document... forget it....

I tried to use C/C++ for the CGI, but I found hundereds of people out there asking "how" C/C++ could be used for CGI, and no one answering.... I eventually figured it out myself and selfishly guarded the knowledge... I wish, now, I had been more open with it... I built C/C++ CGI applications, very powerful but not easy for most people to handle...

Then I started using Java/JSP to do the same things... but back then, Java/JSP were young and slow...

Another friend said "PHP", I said what is that... he said it stands for "PHP Hypertext Protocol"... I said but then what is the PHP in that title mean.... and so on.... my first experience with "recusive names"....

I bought a book on PHP and began using it... then PHP got better and then better again... it still has a way to go before it is quality enough to be used for the type of projects I do mostly, but it is GREAT for most beginners to use for learning CGI... it makes it all quite easy...

AND, most ISP and Web Hosting that I am aware of will alllow PHP to be used for your site at no extra charge....

So, since there are few generic CGI references available that will be of use to a beginner, I recommend checking out Perl and PHP references, they will get you a long, long way ;-)

Or you can communicate with me directly, tell me what language you use, would like to use, and what your server will support and I can help you get started off line ;-)

Peace,

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.