Home News Contact Us Forum About Us Demos Products F.A.Q.
Shopping Cart
You currently have 0 items in your cart.


Recent Events
  • 23/11/2024 Black Friday 2024

    BIG SALE, 30% discount for all our extensions. Use BF24 coupon code. Hurry up the discount is valid till 3 December.

  • 31/12/2023 New Year SALE

    We are glad to announce New Year SALE. 25% discount for all our extensions. Use NY24 coupon code. Hurry up the discount is valid till 7 January.


2Checkout.com, Inc. is an authorized retailer of goods and services provided by ARI Soft. 2CheckOut




Follow us on twitter



Welcome, Guest
Please Login or Register.    Lost Password?

How to get value input
(1 viewing) (1) Guest
ARI Quiz Lite
Go to bottomPage: 1
TOPIC: How to get value input
#61560
How to get value input 7 Years, 2 Months ago Karma: 0
I created input with name "usertest" in file quiz.html.php
Code:

<input type="text" name="usertest" />

How to get this value input in file question.html.php
Code:

$usertest = $_POST['usertest'];
is not working. if that is not working, I don't know what is. Help me!

File: Quiz.html.php
Code:

<?php
defined('ARI_FRAMEWORK_LOADED') or die('Direct Access to this location is not allowed.');
$quiz = $processPage->getVar('quiz');
$ticketId = $processPage->getVar('ticketId');
$arisI18N = $processPage->getVar('arisI18N');
$option = $processPage->getVar('option');
$task = $processPage->getVar('task');
$canTakeQuiz = $processPage->getVar('canTakeQuiz');
$Itemid = $processPage->getVar('Itemid');
?>

<div style="margin: 4px 4px 4px 4px;">
<form action="<?php echo JURI::root(true); ?>/index.php<?php if ($Itemid): ?>?Itemid=<?php echo $Itemid; ?><?php endif; ?>" method="post">
<h1 align="center"><?php AriQuizWebHelper::displayDbValue($quiz->QuizName); ?></h1><br />
<?php AriQuizWebHelper::displayDbValue($quiz->Description, false); ?>
<br /><br />
<?php
if ($canTakeQuiz)
{
?>
<input class="start-btn" type="submit" class="button" value="<?php AriQuizWebHelper::displayResValue('Label.Continue'); ?>" />
<?php
}
?>
[b]<input type="text" name="usertest" />[/b]
<input type="hidden" name="tmpl" value="<?php echo JRequest::getString('tmpl', ''); ?>" />
<input type="hidden" name="task" value="get_ticket" />
<input type="hidden" name="quizId" value="<?php echo $quiz->QuizId; ?>" />
<input type="hidden" name="option" value="<?php echo $option; ?>" />
</form>
</div>



File: Question.html.php
Code:

<?php
defined('ARI_FRAMEWORK_LOADED') or die('Direct Access to this location is not allowed.');

$arisI18N = $processPage->getVar('arisI18N');
$option = $processPage->getVar('option');
$ticketId = $processPage->getVar('ticketId');
$questionVersion = $processPage->getVar('questionVersion');
$questionVersionId = $processPage->getVar('questionVersionId');
$questionTime = $processPage->getVar('questionTime');
$quizInfo = $processPage->getVar('quizInfo');
$statistics = $processPage->getVar('statistics');
$questionData = $processPage->getVar('questionData');
$progressPercent = $processPage->getVar('progressPercent');
$completedCount = $processPage->getVar('completedCount');
$totalTime = $processPage->getVar('totalTime');
$hasSplitter = ($questionTime != null && $totalTime != null);
$itemId = $processPage->getVar('Itemid');
$tmpl = JRequest::getString('tmpl', '');
        [b]$usertest = $_POST['usertest'][/b]

$doc = JFactory::getDocument();
$doc->addScript(JURI::root(true) . '/administrator/components/' . $option . '/js/yui/yahoo-dom-event.js');
$doc->addScript(JURI::root(true) . '/administrator/components/' . $option . '/js/validators.js');
$doc->addScript(JURI::root(true) . '/administrator/components/' . $option . '/js/ari.dom.js');
?>

<form method="post" action="<?php echo JURI::root(true); ?>/index.php<?php if ($itemId): ?>?Itemid=<?php echo $itemId; ?><?php endif; ?>" name="formQue_<?php echo $questionVersionId; ?>" id="formQue_<?php echo $questionVersionId; ?>" style="margin: 5px 5px 5px 5px;">

[b]<?php echo 'Your name: '.$usertest; ?>[/b]

<h4><?php AriQuizWebHelper::displayDbValue($quizInfo->QuizName); ?></h4>

Last Edit: 2017/10/23 13:15 By Shamil.
The administrator has disabled public write access.
 
#61564
Re:How to get value input 7 Years, 2 Months ago Karma: 760
Hello,

Do you use the following code in frontend_pages/get_ticket.php file?

Code:


$usertest = $_POST['usertest'];



Regards,
ARI Soft
The administrator has disabled public write access.
 
#61568
Re:How to get value input 7 Years, 2 Months ago Karma: 0
admin wrote:

Do you use the following code in frontend_pages/get_ticket.php file?

No, I use this code in file question.html.php. I should use code in file get_ticket.php?
The administrator has disabled public write access.
 
#61574
Re:How to get value input 7 Years, 2 Months ago Karma: 760
Data are sent to get_ticket.php file from the form on quiz.html.php file.

Regards,
ARI Soft
The administrator has disabled public write access.
 
#61583
Re:How to get value input 7 Years, 2 Months ago Karma: 0
admin wrote:
Data are sent to get_ticket.php file from the form on quiz.html.php file.
Ok. I added this code to the file get_ticket.php
Code:

$usertest = JRequest::getVar('usertest');

How can I get the value of the variable $usertest in question.html.php?
The administrator has disabled public write access.
 
#61585
Re:How to get value input 7 Years, 2 Months ago Karma: 760
The extensions redirects to question.php file in get_ticket.php. You can add the variable to redirect URL or save it in session.

Regards,
ARI Soft
The administrator has disabled public write access.
 
Go to topPage: 1