php variabele gebruiken binnen js
Alvast bedankt!
<html>
<head>
<META name="description" content="Dienstverlingscentrum Heilig Hart (DVC) - Dienstverleningscentrum voor personen met verstandelijke beperkingen VZW">
<META name="keywords" content="DVC, MPI, dvc, mpi, dienstverleningscentrum, heilig hart, Deinze, Nieuws, Handicap, jobs, vrijwilligers, Personeel, vzw">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="StyleSheet" href="../css/algstyle.css" type="text/css">
<link rel="stylesheet" href="../css/titelbalk.css" type="text/css">
<title>Dienstverleningscentrum Heilig Hart</title>
</head>
<body class="body">
<h2 id="fly">Thanks for visiting$Dynamic Drive!</h2>
<script type="text/javascript">
//Flying Letters script- by Matthias ([email protected])
// Modified by Twey for efficiency and compatibility
//For this script and more, visit Dynamic Drive: http://www.dynamicdrive.com
//Configure message to display. Use "$" for linebreak
//By default, set to just grab the text from element with ID="fly"
message = document.getElementById("fly").innerHTML; // $ = taking a new line
distance = 50; // pixel(s)
speed = 200; // milliseconds
var txt="",
num=0,
num4=0,
flyofle="",
flyofwi="",
flyofto="",
fly=document.getElementById("fly");
function stfly() {
for(i=0;i != message.length;i++) {
if(message.charAt(i) != "$")
txt += "<span style='position:relative;visibility:hidden;' id='n"+i+"'>"+message.charAt(i)+"<\/span>";
else
txt += "<br>";
}
fly.innerHTML = txt;
txt = "";
flyofle = fly.offsetLeft;
flyofwi = fly.offsetWidth;
flyofto = fly.offsetTop;
fly2b();
}
function fly2b() {
if(num4 != message.length) {
if(message.charAt(num4) != "$") {
var then = document.getElementById("n" + num4);
then.style.left = flyofle - then.offsetLeft + flyofwi / 2;
then.style.top = flyofto - then.offsetTop + distance;
fly3(then.id, parseInt(then.style.left), parseInt(then.style.left) / 5, parseInt(then.style.top), parseInt(then.style.top) / 5);
}
num4++;
setTimeout("fly2b()", speed);
}
}
function fly3(target,lef2,num2,top2,num3) {
if((Math.floor(top2) != 0 && Math.floor(top2) != -1) || (Math.floor(lef2) != 0 && Math.floor(lef2) != -1)) {
if(lef2 >= 0)
lef2 -= num2;
else
lef2 += num2 * -1;
if(Math.floor(lef2) != -1) {
document.getElementById(target).style.visibility = "visible";
document.getElementById(target).style.left = Math.floor(lef2);
} else {
document.getElementById(target).style.visibility = "visible";
document.getElementById(target).style.left = Math.floor(lef2 + 1);
}
if(lef2 >= 0)
top2 -= num3
else
top2 += num3 * -1;
if(Math.floor(top2) != -1)
document.getElementById(target).style.top = Math.floor(top2);
else
document.getElementById(target).style.top = Math.floor(top2 + 1);
setTimeout("fly3('"+target+"',"+lef2+","+num2+","+top2+","+num3+")",50)
}
}
stfly()
</script>
<table class="Hoofdtabel01" width="100%" height="100%" cellpadding="0" cellspacing="5">
<tr>
<td align="center">
<table border="0" class="Hoofdtabel02" bgcolor="#FFFFFF" cellpadding="0" cellspacing="5" width="759px" height="100%">
<tr bgcolor="#f6fcb7"><td valign="top" height="175" width="180"><img src="agnes.jpg" width="167" height="149"></td>
<td valign="middle" width="399"><center><h1>Eindexamen Agnes</h1></center></td>
<td valign="top" width="180"><img src="agnes.jpg" width="167" height="149"></td>
</tr>
<tr>
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<?php
$vraag=$_GET['vraag'];
$sqlv='SELECT * FROM tblagnes
WHERE agnes_id="'.$vraag.'"';
$queryv=mysql_query($sqlv)or die(mysql_error());
$resultv=mysql_fetch_array($queryv);
$tip=$resultv['vraag'];
$antwoord=$resultv['antwoord'];
$nr=$resultv['agnes_id'];
if($vraag==17)
{
echo "<td> </td><td>Hier is dat feestje</td><td> </td>";
}
else
{
echo "<td> </td><td>Vraag $nr</td><td> </td>";
}
?>
$vraag=$_GET['vraag'];
$sqlv='SELECT * FROM tblagnes
WHERE agnes_id="'.$vraag.'"';
$queryv=mysql_query($sqlv)or die(mysql_error());
$resultv=mysql_fetch_array($queryv);
$tip=$resultv['vraag'];
$antwoord=$resultv['antwoord'];
$nr=$resultv['agnes_id'];
if($vraag==17)
{
echo "<td> </td><td>Hier is dat feestje</td><td> </td>";
}
else
{
echo "<td> </td><td>Vraag $nr</td><td> </td>";
}
?>
</tr>
<tr>
<td> </td>
<td>
</td>
<td> </td>
</tr>
<tr>
<td> </td>
Code (php)
1
2
3
4
2
3
4
<?php
$vraag=$vraag+1;
echo "<td><center><form><input type=\"button\" OnClick=\"self.location='quiz.php?vraag=$vraag'\" value=\"volgende vraag\"></form></td>";
?>
$vraag=$vraag+1;
echo "<td><center><form><input type=\"button\" OnClick=\"self.location='quiz.php?vraag=$vraag'\" value=\"volgende vraag\"></form></td>";
?>
<td> </td>
</tr>
<tr>
<td> </td><td> </td><td> </td>
</tr>
<tr>
<td> </td><td> </td><td> </td>
</tr>
</table>
</body>
</html>
Jij bedoeld denk ik AJAX?
Zou je je code tussen [code][/code] willen zetten?