|
Posted by Jerry Stuckle on 11/24/07 04:39
Jim Michaels wrote:
> Jerry Stuckle wrote:
>> Oliver Grätz wrote:
>>> Rik Wasmus schrieb:
>>>>> Win64,
>>>>> PHP 5.2.4 (cli) (built: Aug 30 2007 07:06:31),
>>>>> Parse error: syntax error, unexpected '}' in quiztaker.php on line 648
>>>>>
>>>>> Weird....
>>>> md5_file() => f0fa03b6e3479c5f45ff6f0174ad378d
>>>> Yours?
>>>
>>>> php -r "echo md5_file('quiztaker.php')";
>>> f0fa03b6e3479c5f45ff6f0174ad378d
>>>
>>> Nope, we're shoveling the same coals into the engine...
>>>
>>> And I can even get some HTML output from the script after changing the
>>> top of the file to
>>>
>>> <?php
>>> function getconfigvar() {return '';}
>>> $_SESSION['minutes']=(int)(ini_get("session.gc_maxlifetime")/60);
>>> ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
>>> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
>>> // now the rest follows...
>>>
>>> so this is no fake OK message. It reallys seems to have something to do
>>> with some very subtle differences in the PHP version or configuration.
>>> Hard to catch, giving up...
>>>
>>> OLLi
>>>
>>
>> Remember, when you include the file, it's effectively the same as
>> copying/pasting the source into the file. IOW, a syntax error (i.e.
>> an unmatched '"'( can be carried over into the included file.
>>
>
> it is possible it is choking on line 661.
> $q2=mysql_query("SELECT quiz_id,title,released FROM
> quiz_quizzes WHERE
> battery_id=".$_SESSION['battery_id'][$_SESSION['test_admin_id']][$i],
> $link) or die(mysql_error());
>
> specifically, on $_SESSION['battery_id'][$_SESSION['test_admin_id']][$i]
>
> I was trying to access a multidimensional array.
>
> when I remove this section of code I get a different error.
>
Should be OK, as long as your $_SESSION elements are OK. I suspect
something else is wrong and this is just leading you astray. Look at the
code preceding this statement.
> you can essentially boil this down to 2 if statements:
>
> <?php
> include 'header.php';
> $_SESSION['minutes']=(int)(ini_get("session.gc_maxlifetime")/60);
> ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
> "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
> <html xmlns="http://www.w3.org/1999/xhtml">
> <head>
> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
> ...blah...</head>
>
> <body>
> <div class="heading">Quiz</div>
> <?php
> //must have just typed in the URL.
> if (!isset($_SESSION['uid']) && !isset($_SESSION['battery_id'])) {
> ?>
> <br /><!--needed because of padding in span -->
> <span class="needaccount">You need to register before you can take a
> test.</span><br />
> <br />
> <a href="userlogin.php">Login</a><br />
> <a href="ucreateacct.php">Register</a><br />
> <?
> //test admin provided the test taker with a URL that had quiz id and
> battery id. specific test.
> } elseif (isset($_SESSION['quiz_id'])) {
> //battery title
> $qb=mysql_query("SELECT title FROM quiz_batteries WHERE
> battery_id=".$_SESSION['battery_id'], $link) or die(mysql_error());
> $rowb=mysql_fetch_assoc($qb);//to be used later
> mysql_free_result($qb);
>
> //quiz title
> $qq=mysql_query("SELECT * FROM quiz_quizzes WHERE
> quiz_id=".$_SESSION['quiz_id'], $link) or die(mysql_error());
> $rowq=mysql_fetch_assoc($qq);
> mysql_free_result($qq);
> //battery_id provided only by test admin to test taker. let them see the
> list of tests they can take.
> } else { //elseif (isset($_SESSION['quiz_id']))
> //battery title
> $q=mysql_query("SELECT battery_id,title FROM quiz_batteries WHERE
> battery_id=".$_SESSION['battery_id'][$_SESSION['test_admin_id']][$i],
> $link) or die(mysql_error());
> if ($row=mysql_fetch_assoc($q)) {
> ?>
> <div class="batterytitle"><?php echo $row['title']; ?></div>
> <div>List of Tests you can take</div>
> <?php
> mysql_free_result($q);
> mysql_free_result($q1);
> mysql_free_result($q2);
> ?>
> <a href="<?php echo getconfigvar("basepath"); ?>userreports.php">Look at
> your reports</a><br />
> <?php
> } //if ($row=mysql_fetch_assoc($q))
> } //elseif (isset($_SESSION['quiz_id']))
> ?>
> <br />
> </body>
> </html>
>
>
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
Navigation:
[Reply to this message]
|