/    Sign up×
Community /Pin to ProfileBookmark

refresh problem

Hi everyone.
At the beginning i want to sorry for my english..
Ok so.. i have a problems with this ‘api’: [url]http://www.testy2k12.bugs3.com/[/url]
Firstly to have sure that everything is working right open this with Google Chrome. Enter login: janko and haslo(password): zaq123 then click “Rozpocznij test”
My problems is:
1st: this is the most important and i have no idea how to fix it, so if you refresh the page – timer (Czas: ) is reseting
2nd: timer is start counting down even if picture is still loading

I know that this ‘api’ is suck because of everything is doing in php and it would be much better if i do this in js but i’m new in webdeveloping and doing all that from the beginning in js would take me much much time which i dont have:/
I will be grateful for help.
Source code is:
in index.php when you just login as a ‘user’ :
if ($_SESSION[‘dostep’] == ‘user’)
{

$odpowiedzi[0]=0;
$_SESSION[‘odpowiedzi’]=$odpowiedzi;

$query = mysql_query(“SELECT id FROM pytania;”);
$i=0;

while ($rekord = mysql_fetch_assoc($query))
{
$zakres3[$i] = $rekord[‘id’];
$i++;
}
$query = mysql_query(“SELECT ilosc_pytan,ilosc_bledow FROM ustawienia WHERE id=’1′;”);

while ($rekord = mysql_fetch_assoc($query))
{
$ilosc_pytan = $rekord[‘ilosc_pytan’];
$ilosc_bledow = $rekord[‘ilosc_bledow’];
}
$ilosc_pytan_w_bazie=$i;
$tabelka=$zakres3;
shuffle($tabelka);
$tabelka = array_slice($tabelka, 0, $ilosc_pytan);
$_SESSION[‘tablica’]=$tabelka;
if ($ilosc_pytan_w_bazie < $ilosc_pytan)
{
$_SESSION[‘ilosc_pytan’]=$ilosc_pytan_w_bazie;
}
else
{
$_SESSION[‘ilosc_pytan’]=$ilosc_pytan;
}
$_SESSION[‘ilosc_bledow’]=$ilosc_bledow;
$i=0;

here i just preper session’s var which i will use in test.
And here you go file egzamin.php : [url]http://wrzucacz.pl/file/1171338838828/egzamin.php[/url]
I couldn’t post it here because of too long lenght

to post a comment
HTML

0Be the first to comment 😎

×

Success!

Help @REq888 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.21,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...