d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > Survey On A Webpage In Html > Quick Question
Add Reply New Topic New Poll
Member
Posts: 23,510
Joined: Sep 22 2005
Gold: 35.00
Jun 23 2012 08:46am
Im debating using a link to a website for this survey, but i would rather it be on the page its self because links are kinda cheesy

I need to put 5 questions

True or false


And if the answer was right or wrong needs to be displayed


Is this possible to do with html, or would it be a huge pain and the cheesy link would be better

Member
Posts: 219
Joined: Jun 8 2012
Gold: 96.00
Jun 23 2012 09:06am
Well...you won't do that only with HTML. Isn't it better to do that with simple PHP?

Message box is full ;d If you already have HTML code, I can see it this way: you'll need to change a line or two in your HTML code, add one .php file, and put some code into it.
Then, after submitting your survey, you will be redirected to a site which will show its outcomes. That's the simplest way, if you also want to save the records from the survey (date, time, outcomes), I can add some MySQL to it, and the records will be inserted to the table, so that u can display all the outcomes u have ever submitted. If u dont have your server I can create a free one, or u do it if u want to ;d

Or of course I can do it on my own server and give u a link to the project (if it will not be needed for too long), and just send u a whole code. It will be simple code, so I hope your teacher will know it works as shown ;d

This post was edited by Perykles on Jun 23 2012 09:26am
Member
Posts: 32,925
Joined: Jul 23 2006
Gold: 3,804.50
Jun 23 2012 09:45am
Quote (tko400 @ Jun 23 2012 10:46am)
Im debating using a link to a website for this survey, but i would rather it be on the page its self because links are kinda cheesy

I need to put 5 questions

True or false


And if the answer was right or wrong needs to be displayed


Is this possible to do with html, or would it be a huge pain and the cheesy link would be better


html is not a programming language. you cannot have conditional logic like this.

you can show the questions and have the answers, but you can't display something like "wrong" or "right" because that requires conditional logic. you can use javascript or a server side code for that..
Member
Posts: 6,522
Joined: Jun 5 2008
Gold: 0.00
Jun 23 2012 09:48am
Javscript is your best bet, or jquery would work too.
Member
Posts: 219
Joined: Jun 8 2012
Gold: 96.00
Jun 23 2012 02:39pm
Already done, u don't need any servers, the code can be injected anywhere...pm me.
Member
Posts: 13,630
Joined: Dec 4 2009
Gold: 0.00
Jun 23 2012 02:51pm
It depends if you want to store the answers or not. If you do, you'll need to use a server side scripting language with database access.

Else, you can ask Perylkes to POST HIS CODE so everyone else can see it and make sure you're not getting some shit code. No offense Perykles.
Member
Posts: 219
Joined: Jun 8 2012
Gold: 96.00
Jun 23 2012 03:07pm
Oh, sure. He said it's a school project so I guessed he doesn't have any server to do it. Else, because of too much free time I'm creating another project php+mysql, but that's much more complicated (saving, displaying records, deleting them, changing the survey...). Anyways, being PHP programmer I know only basics of js but that's just one function:

http://khernik.boo.pl/

So give me an opinion if that's a shit function, but looks fine for me ;d

This post was edited by Perykles on Jun 23 2012 03:08pm
Member
Posts: 13,630
Joined: Dec 4 2009
Gold: 0.00
Jun 23 2012 04:24pm
Quote (Perykles @ Jun 23 2012 02:07pm)
Oh, sure. He said it's a school project so I guessed he doesn't have any server to do it. Else, because of too much free time I'm creating another project php+mysql, but that's much more complicated (saving, displaying records, deleting them, changing the survey...). Anyways, being PHP programmer I know only basics of js but that's just one function:

http://khernik.boo.pl/

So give me an opinion if that's a shit function, but looks fine for me ;d


Erm, depends. If the goal is to just print out what the values are, then yeah, that's fine.

But judging from the OP, the code needs to check the answers the client gets with the correct answers (stored in code or database).

We need more info about the survey's requirements, tko400.
Member
Posts: 219
Joined: Jun 8 2012
Gold: 96.00
Jun 23 2012 04:30pm
Pm'ed him, waiting for the answer ;d But maybe I didn't understand him properly, though that's just a few changes:

http://khernik.boo.pl/survey/

This post was edited by Perykles on Jun 23 2012 04:56pm
Member
Posts: 71
Joined: Jun 27 2012
Gold: 70.00
Jun 27 2012 06:07pm
Quote (DeadShell @ Jun 23 2012 05:48pm)
Javscript is your best bet, or jquery would work too.


^this.
Go Back To Programming & Development Topic List
Add Reply New Topic New Poll