Custom Form Mod

Started by live627, July 09, 2008, 10:24:44 PM

Previous topic - Next topic

SpeedHighway

#260
Two things...
One, when I make a form, I cannot get it to "run."
I have made a test forum with a single selection box and when I click "Submit Form" I get this:

QuoteYou have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 's main character name here...', 1, 255), SUBSTRING('My primary game is: Warhamme' at line 4
File: ~/public_html/SMF/Sources/Subs-Post.php
Line: 1542

Note: It appears that your database may require an upgrade. Your forum's files are currently at version SMF 1.1.5, while your database is at version 1.1.2. The above error might possibly go away if you execute the latest version of upgrade.php.

I know that the error about the database files are not accurate and I'm not sure what's wrong with the SQL.  It's just the straight code in that spot for making a post, nothing that this mod changed and making posts everywhere else is perfectly fine when done by hand.

Secondly:
Would it be possible to add a multi-checkbox feature.
This way I can give someone options and they can check multiple items.  Then when it is listed in the post, it lists them, "Item1, Item2, Item4, Item7, Item10", etc. 
Thank you, very much, LHVWB!

Nathaniel

Does it work without putting any quotes ' into the field?

Ouch, that is an aweful bug. I don't even sanitize those fields properly...... :(

I really have to make a new version of this mod, its absolutely terrible for security at the moment. I will have to fix that. ;)
SMF Friend (Former Support Specialist) | SimplePortal Developer
My SMF Mods | SimplePortal

"Quis custodiet ipsos custodes?" - Who will Guard the Guards?

Please don't send me ANY support related PMs. I will just delete them.

SpeedHighway

#262
I actually did not have any quotes in the field.  Adding them into the field, now, as a test, has added them to the list's entries and completely confused the application.  Now when I click Submit Post, it simply turns *Required red and does nothing.  (Mind you, I have no required questions).

Allow me to attach a screenshot of the setup.

First 2 screens are my normal settings.

3rd screen is the reaction when I add quotes into the mix.

EDIT:
As a side note, what username is used to make the post.  Perhaps that's the info missing causing the "POST" to fail?
And on your demo page, you may want to mention that you changed the username/password to testing/testing =D

rizhii

I can not log in as an admin to try the demo, if I create an account I do not get the admin tab?  assistance anyone?

Nathaniel

@SpeedHighway,
Am I right in saying that you had some quotes in the output for the form? Because that first error is definetly related to having an unescaped comma in the sql query. I am not sure about the second error, although there are some major flaws with the required field code that I have to fix. ;)

@rizhii,
The test account does not have admin privilages, I setup the demo so that you can see what the mod looks like when you are using it as a user. I am not going to allow people to use the admin area, because of moderation/security concerns. ;)
SMF Friend (Former Support Specialist) | SimplePortal Developer
My SMF Mods | SimplePortal

"Quis custodiet ipsos custodes?" - Who will Guard the Guards?

Please don't send me ANY support related PMs. I will just delete them.

rizhii

Thanks.... I know I am a complete noob with SMF but I do know what a form looks like.... I don't see any on the demo forum.  The posts that I see are support test posts.  the form action takes me to a page... I finally got it I am slow.
Can I use this as a Q&A for surveys ex. I want to ask the users about 15 questions and each question will have possible 3 answers each.
Also can I post this in a section of the board that user will have to enter a specific code (invitaion only kinda thing) in order to view and fill out the form?


Thanks

SpeedHighway

#266
Quote from: LHVWB on September 18, 2008, 03:49:19 AM
@SpeedHighway,
Am I right in saying that you had some quotes in the output for the form? Because that first error is definetly related to having an unescaped comma in the sql query. I am not sure about the second error, although there are some major flaws with the required field code that I have to fix. ;)

Actually no.
My output contained only this:

My main game is: {GameTypes}

EDIT: Although the subject said: Will be the user's main character name
Because I had not added the question for that yet

EDIT2:  I removed that ' in the word users's and it works.  Unfortunately, I guess required still does not work?  (It simply comes back with the red "required" when I make anything required. 

And is there any chance of that suggestion or would it be okay if I tried to implement that myself?

Thanks, LHVWB!

learjet45

Is there going to be a version for 1.1.5? Or is there something that I can do to get the 1.1.5 version to work with 1.1.6 because it is telling me that the package isnt compatible with my version of SMF/

Nathaniel

@rizhii,
1) Yes, you should be able to use the 'Selection Box' type.
2) Yes, you can post the forms output into any board.

@SpeedHighway,
If you are referring to the multiline checkbox then that is already on the list of things to add to the next version.

@learjet45,
Try the attached copy, I haven't tested it but it should work. I just changed the versions that the package will allow itself to be installed for. ;)
SMF Friend (Former Support Specialist) | SimplePortal Developer
My SMF Mods | SimplePortal

"Quis custodiet ipsos custodes?" - Who will Guard the Guards?

Please don't send me ANY support related PMs. I will just delete them.

4b11l

Just curious, are you still testing and planning on a next release on this? Don't mean to sound mean or anything, but just curious. :)

Nathaniel

@4b11l,
At the moment No. I am very busy with another project that I am working on (SimplePortal), so I don't really have any time to update this mod. I am hoping that I will find some time next week, but its unlikely that it will get finished until after my exams (~6weeks).
SMF Friend (Former Support Specialist) | SimplePortal Developer
My SMF Mods | SimplePortal

"Quis custodiet ipsos custodes?" - Who will Guard the Guards?

Please don't send me ANY support related PMs. I will just delete them.

4b11l

Cool, thanks for the updates. I've seen you released many other mods but didn't get time for this one. Anticipating the next release; cheers.

learjet45

#272
Thanks. I'll test it out right now and let you know.


Edit: It installed just fine on 1.1.6 although I dont have time to set up a page right now to test it out. I really need to get off to bed. Thanks :)

GaminGarage

@LHVWB:

i installed the version you just attached and it installs fine to 1.1.6, the only problem is when i try and click on the form i get this:

Not Acceptable

An appropriate representation of the requested resource /index.php could not be found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
Apache/2.2.9 (Unix) mod_ssl/2.2.9 OpenSSL/0.9.8b mod_auth_passthrough/2.1 mod_bwlimited/1.4 FrontPage/5.0.2.2635 PHP/5.2.6 mod_perl/2.0.4 Perl/v5.8.8 Server at www.gamingarage.com [nofollow] Port 80


can anyone help?

Gamez

@LHVWB: I did a lot of testing to narrow down the cause of the 'hacking attempt' message and I figured it out. I was using an {keyword} in the for the subject field with a single quote to denote ownership. I.e. {Name}'s Thread . Once I removed the ' everything works fine(with of course the fix for the required fields a page or so back.)

Nathaniel

@4b11l,
I know I have been negleting this mod, thats for sure, but I just haven't managed to get around to updating it yet. Thats the truth. ;)

@GaminGarage,
Which pages is that happening for?

@Gamez,
I know that there are some bad errors with 'variable sanity' in the code, thats on the 'to do' list of things that I need to fix.
SMF Friend (Former Support Specialist) | SimplePortal Developer
My SMF Mods | SimplePortal

"Quis custodiet ipsos custodes?" - Who will Guard the Guards?

Please don't send me ANY support related PMs. I will just delete them.

SpeedHighway

Quote from: LHVWB on September 23, 2008, 08:37:03 PM
@SpeedHighway,
If you are referring to the multiline checkbox then that is already on the list of things to add to the next version.

Ah, okay.  Can I just verify, then, that the 'required' function is fully inoperable at this time?  If I make ANYTHING 'required' then the user cannot click the finish button at the end.

Nathaniel

@SpeedHighway,
Yes, I believe that you can. It seems to be totally random in what it does (although nothing in computers is actually random). It doesn't seem to be very useful at the moment which is unfortunate.
SMF Friend (Former Support Specialist) | SimplePortal Developer
My SMF Mods | SimplePortal

"Quis custodiet ipsos custodes?" - Who will Guard the Guards?

Please don't send me ANY support related PMs. I will just delete them.

GaminGarage

well the link that leads from the action=form page to this: http://www.gamingarage.com/index.php?action=form;id=2 [nofollow]

Nathaniel

@GaminGarage,
I'm not sure about that error, do you get any errors in your Forum Error Log at the same time?

Also, what input did you put into the options in the admin panel for that form?
SMF Friend (Former Support Specialist) | SimplePortal Developer
My SMF Mods | SimplePortal

"Quis custodiet ipsos custodes?" - Who will Guard the Guards?

Please don't send me ANY support related PMs. I will just delete them.

Advertisement: