- This topic is empty.
-
AuthorPosts
-
June 12, 2013 at 10:34 am #45472BaerspectiveParticipant
I need help, desperately. I don’t know PHP to save my life. Dabbled in it but just don’t get it :-(.
Anyway, I have a tiny contact us form. I made the HTML/CSS. Found the php online and modified it a tad bit, ie in my form “comment” is not a required field, since folks who contact the company do so in order to ask a question.
When I submit the form i get error messages which were put into the php form as a function (not by me). Have no idea what to do how to correct this.
Here is the form URL:http://baerspective.com/northstarfencing/contactus.html
Try to fill out the diminutive form and see, plz.
I wanted to make a pen, but I don’t see where to place the php, see only HTML, css, js option. ApologiesJune 12, 2013 at 11:01 pm #138536BaerspectiveParticipantmcjohnst, i pasted link in my first post just now. but maybe should paste it in this second one as well
http://codepen.io/seraphzz/pen/xwomI
sorry for delay getting back with both you and FragaGeddon and mcjohnst.
thanks so much for helpingJune 12, 2013 at 11:13 pm #138537AlenParticipantSpelling mistake, line 7, should be `die(“string”);` not `died();`.
This could be your issue.
June 12, 2013 at 11:17 pm #138538BaerspectiveParticipantAlenAbdula do i need to change all died() to die()?
June 12, 2013 at 11:22 pm #138540AlenParticipantYes. There is no such thing as died() in PHP.
June 12, 2013 at 11:30 pm #138542BaerspectiveParticipanti’ve been able to resolve my troubles with the php form
June 12, 2013 at 11:50 pm #138551BaerspectiveParticipanti got it figured out. thanks for everyones input and help
June 13, 2013 at 12:28 am #138543__Participant>is it possible that i messed things up when i removed the ! before the isset($_POST)) ?
quite possibly. `!` means “not”, therefore `if( ! isset( $_POST ) )` means “if POST index ‘comments’ do _not_ exist.” By changing it to `if( isset( $_POST ) )`, you change the meaning to “if POST index ‘comments’ _do_ exist.” You changed it from **requiring** the field to be filled out to requiring that it **not** be filled out.
>i did not make the comments field a required field as i figured folks would be contacting the company with questions and hence would be filling out the comment section anyway.
I don’t follow: if you want/expect them to fill out the comment section, why do you _not_ want to make it _required_?
June 13, 2013 at 12:44 am #138544BaerspectiveParticipantomg traq. my head is spinning. i changed php script to where ” comments” is a required field. as i figured that i had changed the script significantly enough by removing the “is not set”.
i did not have the comment section as a required field before, as i figured folks would be automatically filling that text area out….but maybe that was just a wrong assumption.
thanks so much for taking your time to explain it to me.
script seems to work now after i corrected the : died() to die() as AlenAbdula pointed out, made the comment field a required field and also, just while changing things up renamed function died($error) to function error_msg() .again, thanks to all who took their time to help me.
June 13, 2013 at 12:54 am #138545AlenParticipant@traq +1, also why even check if something exists if it’s not required… wouldn’t just passing the data be enough. If it’s there it’s there, if not well it’s not required in which case you’re left with empty string.
Humans might not be the only ones submitting to your form.
Plus, since the comment field provides you/company with relevant and important information make it required. Any optional fields can be !required.
June 13, 2013 at 12:58 am #138547AlenParticipant@Baerspective, I’m glad everythings working.
-
AuthorPosts
- The forum ‘Back End’ is closed to new topics and replies.