| Topic: | Contact Us form not working properly |
|---|---|
|
maw
Noob
Posts: 5 Posted: |
I'm hoping someone can help me. I'm a newbie with PostNuke and not a programmer. I'm using the ContactUs module. By default three fields are given; name, email, message. I need to add four more fields (address, city, state, zip) which I did in the global.php file. I copied the line of code for "Your Name" and then edited the "name part" to be "Your Address" etc. It displays as I like it to on the web site: http://www.gerrirussell.com Click the Contact Us link at the bottom of the page. When I fill in the fields and click the submit button, an error comes up telling me I need to fill in the Zip Code field. And the zip field is filled in. Needless to say, I can't get past this page and no Thank you message is given. I've gone back to the global.php file and reentered the code but it still isn't working properly. Any help would be appreciated.Here's the code from the global.php file and below that the code from my index.php file. Here's the code from the index.php file |
|
Chestnut
Site Admin Posts: 1320 Posted: |
Hi Maw... First, this module looks so old I find it quite incredible that it work on today's PostNuke. My first suggestion would be to try Formicula http://noc.postnuke.com/projects/formicula/ If you still want to use this one, you should contact the author about the issue you are having. From what I can see, the send_zip is checked to see if it is empty but is never filled before being checked. A very quick fix (and very temporary I'd say) would be to add after (or almost anywhere in the top of the file) this line : This line : That should fix your zip problem... but not necessarily the other potential problems (mostly security). That is why I strongly suggest using formicula instead. Have fun ! Chestnut ! ![]() Site Admin |
|
maw
Noob
Posts: 5 Posted: |
I put this in the global.php but I was told it wasn't supposed to be there because it was already on line 44 of index.php. include("header.php"); __________________________________ $sender_zip = pnVarCleanFromInput('sender_zip'); I wasn't sure where to put this line of code so this is where I put it. } if ($sender_zip == "") $sender_zip = pnVarCleanFromInput('sender_zip'); { When I checked it on the site and filled in the fields and hit submit, I still received the error that I needed to fill in the zip field. Hopefully, it you tell me where it should be positioned in the code, that will be the answer. I must have it in the wrong place in the code. Your helping me is greatly appreciated. Mary Ann |
|
Chestnut
Site Admin Posts: 1320 Posted: |
Hi Mary Ann Well... I must be completly blind because I don't anything at line 44 or even around that is telling the $sender_zip to get its value from the form. In fact, what I can see is that this module won't work anymore in many actual PHP environments because it relies on catching the values that are not necessarily set. If you still want to use this particular module instead of Formicular, don't be too surprise about what I will tell you to do... First, revert back your change on the sender_zip to what it was before, you can check your first post to see how it was before. Next: Remove all this part: It's kind of dangerous anyway. (Watch out not to remove more than this). The part you just remove, replace it with this: Best would still be to try Formicula. Hope it helps... Chestnut ! ![]() Site Admin |
|
maw
Noob
Posts: 5 Posted: |
Chestnut, It still is saying no zip has been input into the field. I was asked to take over the maintenance of this site because the original programmer didn't have time to work on it. Site was built in 2002. I went out to Formicula and started to download but then got a little scared. Since I don't know anything about this PostNuke, I didn't know how Formicula would react with PostNuke and would I be in more trouble than I'm in now. I use Dreamweaver MX 2004 for my other web sites. I did make a Contact Us form in DWMX and thought about uploading it but not into the Modules folder and use a CGI script from Matt's Archives. Sorry about giving the incorrect info on the line for //header include("header.php"); It's on line 34 - not 44. So now, I'm in a quandry and not sure how to proceed. Mary Ann |
|
Chestnut
Site Admin Posts: 1320 Posted: |
That line won't give the zip anyway... Houla... went to your site and I can see that formicula wouldn't work anyway. Your PostNuke is very very old and I also can understand why the zip is always empty even with the modifications I gave you... Well, one possible last change could be to replace the part I gave you last time by this : It might work... But one priority would be to upgrade PostNuke as soon as you are familiar with it. Official site where you'll probably get more help than I can give you. http://www.postnuke.com http://community.postnuke.com (Support forum) P.S. : The site reminds me of something, it's not the first time I've seen it. Chestnut ! ![]() Site Admin |
|
maw
Noob
Posts: 5 Posted: |
I'm sorry but that didn't work either. I'll paste my code just to make sure I haven't corrupted the code. Thank you for letting me know that Formulica isn't compatible with this archaic version of PostNuke. If I've corrupted the code, could you please direct me how to correct it. Do you think I need to paste the code for global.php? I don't believe that code is controlling the zip field. It looks to me as if it's controlling the look of the form and the sending of the form and telling me my errors. I've taken too much of your time and I do appreciate the direction you've given me. If this doesn't work with the current code, then I've decided to just use the Dreamweaver MX04 code and say I've given up with PostNuke. Here's the code for index.php |