ey mensen ik heb een scripje inelkaargeflanst maar hij doet het niet goed...

<?php

if ( $keuze == taank.php) { 
$ding = "http://www.mijnsite.nl/aank.php"; 
}elseif ( $keuze == tacc.php ) {
$ding = "http://www.mijnsite.nl/acc.php"; 
}elseif ( $keuze == angelique ) {
$ding = "http://www.mijnsite.nl/aank.php"; 
}elseif ( $keuze == astrid ) {
$ding = "http://www.mijnsite.nl/aank.php"; 
}elseif ( $keuze == bart ) {
$ding = "http://www.mijnsite.nl/aank.php"; 
}elseif ( $keuze == bas ) {
$ding = "http://www.mijnsite.nl/aank.php"; 
}elseif ( $keuze == bennie ) {
$ding = "http://www.mijnsite.nl/aank.php"; 
}elseif ( $keuze == bob ) {
$ding = "http://www.mijnsite.nl/aank.php"; 
}elseif ( $keuze == cees ) {
$ding = "http://www.mijnsite.nl/aank.php"; 
}elseif ( $keuze == cobie ) {
$ding = "http://www.mijnsite.nl/aank.php"; 
}elseif ( $keuze == coen ) {
$ding = "http://www.mijnsite.nl/aank.php"; 
}elseif ( $keuze == elly ) {
$ding = "http://www.mijnsite.nl/aank.php"; 
}elseif ( $keuze == freek ) {
$ding = "http://www.mijnsite.nl/aank.php"; 
}elseif ( $keuze == ivon ) {
$ding = "http://www.mijnsite.nl/aank.php"; 
}elseif ( $keuze == jeannet ) {
$ding = "http://www.mijnsite.nl/aank.php"; 
}elseif ( $keuze == kjeld ) {
$ding = "http://www.mijnsite.nl/aank.php"; 
}elseif ( $keuze == klaasjr ) {
$ding = "http://www.mijnsite.nl/aank.php"; 
}elseif ( $keuze == klaassr ) {
$ding = "http://www.mijnsite.nl/aank.php"; 
}elseif ( $keuze == lea ) {
$ding = "http://www.mijnsite.nl/aank.php"; 
}elseif ( $keuze == leny ) {
$ding = "http://www.mijnsite.nl/aank.php"; 
}elseif ( $keuze == leo ) {
$ding = "http://www.mijnsite.nl/aank.php"; 
}elseif ( $keuze == lisa ) {
$ding = "http://www.mijnsite.nl/aank.php"; 
}elseif ( $keuze == marc ) {
$ding = "http://www.mijnsite.nl/aank.php"; 
}elseif ( $keuze == pim ) {
$ding = "http://www.mijnsite.nl/aank.php"; 
}elseif ( $keuze == richard ) {
$ding = "http://www.mijnsite.nl/aank.php"; 
}elseif ( $keuze == simone ) {
$ding = "http://www.mijnsite.nl/aank.php"; 
}elseif ( $keuze == sven ) {
$ding = "http://www.mijnsite.nl/aank.php"; 
}

 if ($gbr == jan2943) {

$file = "$keuze"; 
$fopenr = fopen ($file, "r"); 


$msgs = fread ($fopenr, filesize ($file)); 

$fopenw = fopen($file, "w+");

fwrite($fopenw, "$Bericht"); 

fclose($fopenw);


echo "<SCRIPT LANGUAGE=\"javascript\" TYPE=\"text/javascript\">window.location='$ding'</SCRIPT>\n";

mail ("[email protected], [email protected]", "Site aangepast ($keuze)", "
$keuze is aangepast door $gbr \n
De nieuwe text is:\n
$Bericht

Ik stuur dit automatisch naar jou.

© Jaapestaartjes CMS 1.0 (JCMS)
", "From: [email protected]"); 
}else{echo "Foutief wachtwoord en/of gebruikersnaam<br>©Jaapestaartje's CMS (JCMS)";}

        

?> 


hij zegt fout op lijn 79 maar als ik het bovenste gedeelte weglaat(voor de pagina waar het heen moet)
dit script is een copie van het script van Fout: doet het niet.... (omdat ik om een of andere domme rede mijn eigen post niet kan bekijken)
Beide topictitels zijn zeer ondduidelijk. Titels als:
[li]fout[/li]
[li]foutmelding[/li]
[li]help[/li]
[li]doet het niet[/li]
zeggen mij in ieder geval niets en nodigen niet uit om te reageren.
Gebruik voortaan error_reporting(E_ALL); bovenaan je script.
Mijn editor (eclipse met php-plug-in, linux) geeft met debuggen devolgende lijst met fouten:
PHP Notice:  Use of undefined constant taank - assumed 'taank' in /home/wjzijderveld/workspace/PHPhulp/CodeView.php on line 2
PHP Notice:  Use of undefined constant php - assumed 'php' in /home/wjzijderveld/workspace/PHPhulp/CodeView.php on line 2
PHP Notice:  Undefined variable: keuze in /home/wjzijderveld/workspace/PHPhulp/CodeView.php on line 2
PHP Notice:  Use of undefined constant tacc - assumed 'tacc' in /home/wjzijderveld/workspace/PHPhulp/CodeView.php on line 5
PHP Notice:  Use of undefined constant php - assumed 'php' in /home/wjzijderveld/workspace/PHPhulp/CodeView.php on line 5
PHP Notice:  Undefined variable: keuze in /home/wjzijderveld/workspace/PHPhulp/CodeView.php on line 5
PHP Notice:  Use of undefined constant angelique - assumed 'angelique' in /home/wjzijderveld/workspace/PHPhulp/CodeView.php on line 8
PHP Notice:  Undefined variable: keuze in /home/wjzijderveld/workspace/PHPhulp/CodeView.php on line 8
PHP Notice:  Use of undefined constant astrid - assumed 'astrid' in /home/wjzijderveld/workspace/PHPhulp/CodeView.php on line 11
PHP Notice:  Undefined variable: keuze in /home/wjzijderveld/workspace/PHPhulp/CodeView.php on line 11
PHP Notice:  Use of undefined constant bart - assumed 'bart' in /home/wjzijderveld/workspace/PHPhulp/CodeView.php on line 14
PHP Notice:  Undefined variable: keuze in /home/wjzijderveld/workspace/PHPhulp/CodeView.php on line 14
PHP Notice:  Use of undefined constant bas - assumed 'bas' in /home/wjzijderveld/workspace/PHPhulp/CodeView.php on line 17
PHP Notice:  Undefined variable: keuze in /home/wjzijderveld/workspace/PHPhulp/CodeView.php on line 17
PHP Notice:  Use of undefined constant bennie - assumed 'bennie' in /home/wjzijderveld/workspace/PHPhulp/CodeView.php on line 20
PHP Notice:  Undefined variable: keuze in /home/wjzijderveld/workspace/PHPhulp/CodeView.php on line 20
PHP Notice:  Use of undefined constant bob - assumed 'bob' in /home/wjzijderveld/workspace/PHPhulp/CodeView.php on line 23
PHP Notice:  Undefined variable: keuze in /home/wjzijderveld/workspace/PHPhulp/CodeView.php on line 23
PHP Notice:  Use of undefined constant cees - assumed 'cees' in /home/wjzijderveld/workspace/PHPhulp/CodeView.php on line 26
PHP Notice:  Undefined variable: keuze in /home/wjzijderveld/workspace/PHPhulp/CodeView.php on line 26
PHP Notice:  Use of undefined constant cobie - assumed 'cobie' in /home/wjzijderveld/workspace/PHPhulp/CodeView.php on line 29
PHP Notice:  Undefined variable: keuze in /home/wjzijderveld/workspace/PHPhulp/CodeView.php on line 29
PHP Notice:  Use of undefined constant coen - assumed 'coen' in /home/wjzijderveld/workspace/PHPhulp/CodeView.php on line 32
PHP Notice:  Undefined variable: keuze in /home/wjzijderveld/workspace/PHPhulp/CodeView.php on line 32
PHP Notice:  Use of undefined constant elly - assumed 'elly' in /home/wjzijderveld/workspace/PHPhulp/CodeView.php on line 35
PHP Notice:  Undefined variable: keuze in /home/wjzijderveld/workspace/PHPhulp/CodeView.php on line 35
PHP Notice:  Use of undefined constant freek - assumed 'freek' in /home/wjzijderveld/workspace/PHPhulp/CodeView.php on line 38
PHP Notice:  Undefined variable: keuze in /home/wjzijderveld/workspace/PHPhulp/CodeView.php on line 38
PHP Notice:  Use of undefined constant ivon - assumed 'ivon' in /home/wjzijderveld/workspace/PHPhulp/CodeView.php on line 41
PHP Notice:  Undefined variable: keuze in /home/wjzijderveld/workspace/PHPhulp/CodeView.php on line 41
PHP Notice:  Use of undefined constant jeannet - assumed 'jeannet' in /home/wjzijderveld/workspace/PHPhulp/CodeView.php on line 44
PHP Notice:  Undefined variable: keuze in /home/wjzijderveld/workspace/PHPhulp/CodeView.php on line 44
PHP Notice:  Use of undefined constant kjeld - assumed 'kjeld' in /home/wjzijderveld/workspace/PHPhulp/CodeView.php on line 47
PHP Notice:  Undefined variable: keuze in /home/wjzijderveld/workspace/PHPhulp/CodeView.php on line 47
PHP Notice:  Use of undefined constant klaasjr - assumed 'klaasjr' in /home/wjzijderveld/workspace/PHPhulp/CodeView.php on line 50
PHP Notice:  Undefined variable: keuze in /home/wjzijderveld/workspace/PHPhulp/CodeView.php on line 50
PHP Notice:  Use of undefined constant klaassr - assumed 'klaassr' in /home/wjzijderveld/workspace/PHPhulp/CodeView.php on line 53
PHP Notice:  Undefined variable: keuze in /home/wjzijderveld/workspace/PHPhulp/CodeView.php on line 53
PHP Notice:  Use of undefined constant lea - assumed 'lea' in /home/wjzijderveld/workspace/PHPhulp/CodeView.php on line 56
PHP Notice:  Undefined variable: keuze in /home/wjzijderveld/workspace/PHPhulp/CodeView.php on line 56
PHP Notice:  Use of undefined constant leny - assumed 'leny' in /home/wjzijderveld/workspace/PHPhulp/CodeView.php on line 59
PHP Notice:  Undefined variable: keuze in /home/wjzijderveld/workspace/PHPhulp/CodeView.php on line 59
PHP Notice:  Use of undefined constant leo - assumed 'leo' in /home/wjzijderveld/workspace/PHPhulp/CodeView.php on line 62
PHP Notice:  Undefined variable: keuze in /home/wjzijderveld/workspace/PHPhulp/CodeView.php on line 62
PHP Notice:  Use of undefined constant lisa - assumed 'lisa' in /home/wjzijderveld/workspace/PHPhulp/CodeView.php on line 65
PHP Notice:  Undefined variable: keuze in /home/wjzijderveld/workspace/PHPhulp/CodeView.php on line 65
PHP Notice:  Use of undefined constant marc - assumed 'marc' in /home/wjzijderveld/workspace/PHPhulp/CodeView.php on line 68
PHP Notice:  Undefined variable: keuze in /home/wjzijderveld/workspace/PHPhulp/CodeView.php on line 68
PHP Notice:  Use of undefined constant pim - assumed 'pim' in /home/wjzijderveld/workspace/PHPhulp/CodeView.php on line 71
PHP Notice:  Undefined variable: keuze in /home/wjzijderveld/workspace/PHPhulp/CodeView.php on line 71
PHP Notice:  Use of undefined constant richard - assumed 'richard' in /home/wjzijderveld/workspace/PHPhulp/CodeView.php on line 74
PHP Notice:  Undefined variable: keuze in /home/wjzijderveld/workspace/PHPhulp/CodeView.php on line 74
PHP Notice:  Use of undefined constant simone - assumed 'simone' in /home/wjzijderveld/workspace/PHPhulp/CodeView.php on line 77
PHP Notice:  Undefined variable: keuze in /home/wjzijderveld/workspace/PHPhulp/CodeView.php on line 77
PHP Notice:  Use of undefined constant sven - assumed 'sven' in /home/wjzijderveld/workspace/PHPhulp/CodeView.php on line 80
PHP Notice:  Undefined variable: keuze in /home/wjzijderveld/workspace/PHPhulp/CodeView.php on line 80
PHP Notice:  Use of undefined constant jan2943 - assumed 'jan2943' in /home/wjzijderveld/workspace/PHPhulp/CodeView.php on line 84
PHP Notice:  Undefined variable: gbr in /home/wjzijderveld/workspace/PHPhulp/CodeView.php on line 84



Kijk daar eerst eens naar. Want ookal gaat de error weg, je script zal niet werken.

Edit: Ook is het handig de foutmelding erbij te zetten. Meteen een tip voor je topictitel.
bij dit script is het volgens mij handiger om met switch te werken.

Quote:
<?php
// en waar komt $keuze vandaan????
// let hieronder op de quotes om de naam van keuze.. ;)
if ( $keuze == "taank.php") { 
$ding = "http://www.mijnsite.nl/aank.php"; 
}elseif ( $keuze == "tacc.php" ) {
$ding = "http://www.mijnsite.nl/acc.php"; 
}//enz
?>


het komt van een andere pagina
<form action="plaats.php" method="post" accept-charset="iso-8859-1"> 
<p> 
Leerlingen nr:<br> 
<input name="keuze" type="text" size="40" maxlength="6" tabindex="1000" value="100338"> 

<input type="submit" name="submit" value="bekijk" title="Verstuur dit formulier" tabindex="1007">  
</p> 
</form> 
Dan wordt het dus zo:

<?php
// $keuze komt uit een POST waarde dus:
$keuze=$_POST['keuze'];
// let hieronder op de quotes om de naam van keuze.. ;)
if ( $keuze == "taank.php") {
$ding = "http://www.mijnsite.nl/aank.php";;
}elseif ( $keuze == "tacc.php" ) {
$ding = "http://www.mijnsite.nl/acc.php";;
}//enz
?>

Reageren