:S:S:S

Gestart doorDesire19 reacties203 weergaven

20 berichten · pagina 1 van 2

Desire

Lid · Topicstarter

Berichten
4.367
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
waarom werkt dit niet?

[COLOR= #0000BB]<?php[/COLOR] 

[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]{[/COLOR]
variabele [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"test"[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$variabele[/COLOR][COLOR= #007700];
}[/COLOR] then [COLOR= #007700]{[/COLOR]
variabele [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"test2"[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$variabele[/COLOR][COLOR= #007700];
}[/COLOR] [URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR]
variabele [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"test3"[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$variabele[/COLOR][COLOR= #007700];
}[/COLOR]

?>


fout:

Parse error: syntax error, unexpected {, expecting ( in /home/melvin/domains/webbzo.nl/public_html/test.php on line 3
0
Berichten
832
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
variabele = "test";

Voor een variabel moet wel een $ he emo
dus $variabele = "test";
0
Berichten
5.498
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Toch niet yummie
0
Berichten
832
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
De if is ook verkeerd zie ik.

Eigenlijk klopt er echt niks van deze code, waar heb je dit geleerd? Want er klopt echt niks van, ik raad je aan om ergens anders te leren.
0
Desire

Lid · Topicstarter

Berichten
4.367
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
@guillamos: Hij werkt indd niet
0
Berichten
5.897
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
bij if moet dit bijvoorbeeld if($a = a){
echo $a;
}
0
Desire

Lid · Topicstarter

Berichten
4.367
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
ik heb nu dit:
[COLOR= #0000BB]<?php[/COLOR] 

[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$variabele[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]test[/COLOR][COLOR= #007700]){[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$variabele[/COLOR][COLOR= #007700];
}[/COLOR] then [COLOR= #007700]{
([/COLOR][COLOR= #0000BB]$variabele[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]test2[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$variabele[/COLOR][COLOR= #007700];
}[/COLOR] [URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{
([/COLOR][COLOR= #0000BB]$variabele[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]test3[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$variabele[/COLOR][COLOR= #007700];
}[/COLOR]

?>


met deze fout:

Parse error: syntax error, unexpected { in /home/melvin/domains/webbzo.nl/public_html/test.php on line 5
0
Berichten
5.897
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Wat is het nut van de then want die gebruik/ken ik niet

probeer dit eens :


if($variabele = test){
echo $variabele;
}elseif($variabele = test2)
echo $variabele;
} elseif($variabele = test3);
echo $variabele;
}

?>
0
Desire

Lid · Topicstarter

Berichten
4.367
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
fout:

Parse error: syntax error, unexpected } in /home/melvin/domains/webbzo.nl/public_html/test.php on line 7
0
Berichten
5.897
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien

if($variabele = test){
echo $variabele;
}elseif($variabele = test2){
echo $variabele;
} elseif($variabele = test3){
echo $variabele;
}

?>
0
Berichten
1.579
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
[COLOR= #0000BB]<?php[/COLOR]

[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$variabele[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]test[/COLOR][COLOR= #007700]){[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$variabele[/COLOR][COLOR= #007700];
}[/COLOR][URL="http://www.php.net/elseif"]elseif[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$variabele[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]test2[/COLOR][COLOR= #007700]){[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$variabele[/COLOR][COLOR= #007700];
}[/COLOR] [URL="http://www.php.net/elseif"]elseif[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$variabele[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]test3[/COLOR][COLOR= #007700]){[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$variabele[/COLOR][COLOR= #007700];
}[/COLOR]

?>
0
Desire

Lid · Topicstarter

Berichten
4.367
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
@maarten: Parse error: syntax error, unexpected } in /home/melvin/domains/webbzo.nl/public_html/test.php on line 9

@crazy: hij werkt
0
Berichten
5.897
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
$variabele = test;
if($variabele = test){
echo $variabele;
}elseif($variabele = test2){
echo $variabele;
} elseif($variabele = test3){
echo $variabele;
}

?>
0
Berichten
1.579
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
@HM Graag gedaan emo
@Maarten het is al op gelost zie me post, post in het gevol even code tag om je code heen is makkelijker voor iedereen :")
0
Desire

Lid · Topicstarter

Berichten
4.367
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
bog ff een vraag, als de eerste(test) werkt, moet(test2) ook tevoorschijn komen, en als er een error is moet (test3) komen
0

Jouw reactie

Deel je idee, stel een vraag of help een ander verder.

Editor laden…

Praat mee met de One2xs-community.

Inloggen om te reageren