PDA

View Full Version : PHP form on submit returns a 404


fopa
06-04-2009, 10:01 AM
I have had to work on a web form which is due to go live tomorrow and normally the results of the form would be mailed so i would as a rule just use HTML. However the requirement was for data to be stored to a flat file, in either CSV or txt. I dont really know much PHP but it was already conifgured on the server for a joomla installatiion.

I created my form and used php magic form to generate the php file, however on submit it takes me to a 404 page, both files are in the same directory and i am really at a loss as to what to do next i am desperate to get this resolved today, or im for the high jump http://www.dreamweaverclub.com/forum/./images/smilies/icon_eek.gif

I have attached the form code and the php code.

Any help would be greatly apprecaited, as will the offering of a rope!

edbr
06-04-2009, 10:27 AM
if you type index.php do you get a 404 also?

fopa
06-04-2009, 10:48 AM
Yes 404 for index.php also, php is working correctly as i can bring up the info file.

edbr
06-04-2009, 11:00 AM
i would rename the file and action to suit and try that
index2.php maybe

fopa
06-04-2009, 11:34 AM
renamed to index2.php and i still get the same problem

DWcourse
06-04-2009, 02:21 PM
does the file you want to write to exist? if there is a "thank you" page does that exist?

fopa
06-04-2009, 02:26 PM
Thanks for your reply, the file i want to write to does notr, th software form magic should create it for me. I have both an error page and a thankyou page

DWcourse
06-04-2009, 03:03 PM
I thought Magic was a pc application. If so, how can it make a file on your server?

Also, what is the url of the page that shows in the browser address bar when you get the 404 error?

fopa
06-04-2009, 03:05 PM
I have just got a very small test version working, i am just modifying the main form now, fingers crossed.

fopa
06-04-2009, 03:07 PM
I thought Magic was a pc application. If so, how can it make a file on your server?

Also, what is the url of the page that shows in the browser address bar when you get the 404 error?

It is a pc application, it ask you to specify where you want the generated output to be placed.

The 404 error in the address bar was http://web-dev011/index.php

fopa
06-04-2009, 03:45 PM
I have managed to get it working, and its writing to the data file. I simplified the radio input names, and created a text file instead of the app doing it, and it is working exactly as required. :)

DWcourse
06-04-2009, 07:03 PM
I have managed to get it working, and its writing to the data file. I simplified the radio input names, and created a text file instead of the app doing it, and it is working exactly as required. :)

Right, to create the script you have to tell the app where the text file will be. But you need to create it on the server yourself.

Congrats on getting it working.