masterjiraya -3

Both of all you need has security processes and they are all good. Look for the costs now

masterjiraya -3

Hi it's been a couple of hours

kindly lrtme know where your print_r($_POST['questions']) was coded and run it once more.

masterjiraya -3

don't use string position function. use explode function.
this will count all the characters including special cahracters on the type char, string, double, float and int.
so in this case the syntax should be.

$array_of_str=explode('',$string);
//converts the $string into an array element per character
print_r($array_of_str)
$i=0;
foreach($array_of_str as $array_of_chars){
//read the position of the preferred character
if($array_of_chars[i]==$char){
echo " the position of 3 is in position number ".$i;
}
$i++;
}

masterjiraya -3

@dhani09 you made a wrong move, very confusing syntax on the last post.

try to loearn about SELECT * INTO FROM where.
this was another query technique of copying data from one table to another without fetching before insertint it to another.
make sure your parameters are defined and the indexes are the same.

masterjiraya -3

I'm sorry I havent got back as what I've said yesterday. Dont use label on your previous page because it will not pass down the content.

first on your previous page ( before the process.php )

place this css tag down below the opening head tag

<style>
#text_disabled{
border:none;
font-size:10pt;
color:black;
}
</style>

now after placing the style replace the label tag with
Last name: <input id='text_disabled' type='text' value='".$v['question']."' name='questions[]' disabled>
you see there was 'disabled' on the part of the text box, meaning cannot be edited. so in this manner value attribute is the one that automates to insert the question to the question[] you dont have to enter the values anymore.

then on your process.php you can now proceed by print_r($_POST['questions']); and now you can be able to pass it on

masterjiraya -3

ohh so I got it. there's no error on that but label tag does not support on passing down it's content. Kindly stay tuned for about 2 hours. because I'm off now at work and see you later after 2 hrs

masterjiraya -3

after what I had mentioned before this.
do the same thing of printing the array using print_r and check again if there's no error just like what you did in print_r($_POST['selected_answers']);
now do this also
print_r($_POST['questions_array']);
trigger it and see if the correct questions are also passed down to processor.php

masterjiraya -3

go back to previous page where you loop the select tag for answers, right now back track the loops of questions and place inside the label tag with the name="questions_array[]" and the value='".$v['questions']."'
so it will look like this
echo "<label name='questions_array[]' value='".$v['questions']."'>".$v['questions']."</br/>";

masterjiraya -3

do you have a database or file of the correct answers (answer sheet of the certain questionnaire)

masterjiraya -3

so I didn't think of that you want an online examination system.

masterjiraya -3

upon what you said earlier this post you mentioned this

the array elelents will be the answers, and how will I be able to differentiate each answer of each question for the submitted values. Thank you.

you mean you want to display like this?

for example

In my Question Number 1 your answer is... Choice number 2
In my Question Number 2 your answer is... Choice number 1

is that right?

masterjiraya -3

good. Job well done. then that is how you look for it. now since we are able to get the values correctly as what you want then this part. elaborate to me right now what will the process.php will do? will it save to the database? what will be it's task?

masterjiraya -3

okay lets test this.
does the submit button working to you processor.php?

if it is then on the beggining of you processor.php's php code, initialize this variable and print the array using print_r function it

print_r($_POST['selected_answers']);

by using this function we have to verify that there are values inserted to selected_answers array name.
kindly tell me if an error ascends to this code.

masterjiraya -3

in difference with $_SERVER['PHP_SELF'] with a predefined file. $_SERVER['PHP_SELF'] is used only for self page call refresh which is working only one form per html. unlike your predefined file, you can cast multiple forms in one HTML.

Please remove your "<" in your action attribute. what was inside the action attribute will be considered a character part of the filename if and only if it is not $_SERVER['PHP_SELF']

masterjiraya -3

FYI in using form action which $_SERVER['PHP_SELF'], you dont need to create a new page file unless this web page has multiple forms on one page.

masterjiraya -3

every on call of select tag's selected_answers[] it will have a value in an array.

masterjiraya -3

since you have processor.php, kindly replace the form tag into
<form action="processor.php" method="POST">

masterjiraya -3

now next turn is to how do we make the selected answers pass down to array.

the answers is the name attribure of the select tag.
second rename your select tag's name for selecting answers in to <select name="selected_answers[]">
in this manner it will be in a form of an array.

masterjiraya -3

oh so you do have now processor.php for getting all the values of your selected answers.

masterjiraya -3

before your closing form place this
<input type="submit" value="Submit Answers">&nbsp <input type="reset" value ="Clear Answers">

masterjiraya -3

this part on was based on displaying your text file to HTML

modifying your HTML by inserting
after opening body tag place this:
<form action="<?php htmlspecialchars($_SERVER['PHP_SELF']);?>" method="POST">

look for your code block which has foreach($qas as $k=>$v)
block and edit it into this:

foreach($qas as $k=>$v){
echo "<label>".$v['question']."</label><br/>";
echo "<select name='selected_answers'>";
foreach($v['answers'] as $answer){
echo "<option value='".$answer."'>".$answer."</option>";
}
echo "</select>";
echo "<br/><br/>";
}

before your body closes, place this:
</form>

masterjiraya -3

I am now at the answers portion to proceed but an obstacle was on my mind so loet me hear from you what will be done in the array of selected answers.

masterjiraya -3

as I can see from your text file. I wanna ask a a question is this array of ansswers that was selected like was in the form of...
your answer sheet's answers are
question 1. your answer is 2
question 2. your answer is 4

is this right or not?

masterjiraya -3

wait for a little moment. I am now coding what you want. Just for now. because I just finished my Satellite programming stuff here at SMART Communications Philippines

masterjiraya -3

like...
Display to HTML from text file:

1.) Question number 1
Choices A.) answer 1 B.) Answer 2
2.) Question number 2
Choices A.) answer 1 B.) Answer 2

and if once an answer is selected, it will be in a form of an array. only the answers are provided in the array right?

masterjiraya -3

hmm are you saying about multiple choices?

masterjiraya -3

since I gave you the hint. you can do some googling for jQuery chatbox and forums. and please do not hesitate to ask us. but please close this forum and mark this thread as solved.

masterjiraya -3

or maybe I think that the text file is a questionnaire. hmm which is which?

masterjiraya -3

I can't understand the whole stuff. but just a part of it... are you saying to separate the list of answers which was in your text file and display then select each of these answers and it insert it to an array?

masterjiraya -3

as based on facebook. a jQuery is needed. I dont know how to post a diagram here (jpeg) but Let me explain it to you.
First you need to have a little background stuff on...
1.)jQuery
2.)Javascript <-- this is mainly needed for Ajax and jQuery scripting
3.)HTML's form behaviors <--- meta file and and such more
4.)CSS <--- needed in your jQuery
5.)Database
6.)PHP <--- since aJax is included, it is a form of cloud computing.

for interface, and dynamism take the first 4 I had mentioned.
jQuery is used for interactivity of the forms, Ajax for dynamism anf automization of data, Javascript is the form HTML's trigerring event (onClick, onKeyUp, onMouseOver, etc...) CSS in this manner is not only focused on HTML now it is also a prerequisite for jQuery. HTML's form behaviors is also a must to learn if it includes file uploadable or not.

chatbox:
so now In every event of the chat box like onKeyUp or onClick it will trigger an Ajax function. once jQuery has done it's part, jQuery must call an ajax function to pass it to PHP. in this manner, you created a chatbox.

for cloud computing, take the last 2.
Notification Pop-Ups:
once it passed down to PHP, do some saving stuff to the database and then once the database has succesfully saved the data, then it will pass back to PHP to throw the message back to the Ajax stuff to create dynamism of data back to jQuery once again. ...