T_ELSEF error

Gestart doorTmeiland2 reacties99 weergaven

3 berichten · pagina 1 van 1

Tmeiland

Lid · Topicstarter

Berichten
450
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Hallo, ik gebruik ergens een else if op line waar ik zo te zien het niet nodig heb iemand een idee hoe ik het kan fixxen.

error: syntax error, unexpected T_ELSE

Codeblok (voorbeeld.php):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21


if($email == null){
?>

}elseif(!checkemail($email)){
echo
;
}
else{
echo
;
}

else{

$sql1 = DB::Query("SELECT * from users where mail = ".DB::Escape($email)." LIMIT 1");
$num1 = DB::NumRows($sql1);
if($num1 == 1 ){
?>
} else { ?>

}
0
Remi

Lid

Berichten
1.270
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Klopt niet veel van die code. Zal even kijken of ik er wat van kan fabriceren.

Edit: Valt niet veel van te begrijpen. Ik heb de code aangepast en die zal niet in een error resulteren, maar of het werkt zoals jij wilt...

[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$email[/COLOR] [COLOR= #007700]==[/COLOR] null[COLOR= #007700]){[/COLOR]
?>
<div class="icon_question_email"></div>
[COLOR= #0000BB]<?php[/COLOR]
[COLOR= #007700]}[/COLOR]
[URL="http://www.php.net/else"]else[/URL]
[COLOR= #007700]{[/COLOR]
    [URL="http://www.php.net/if"]if[/URL][COLOR= #007700](![/COLOR]checkemail[COLOR= #007700]([/COLOR][COLOR= #0000BB]$email[/COLOR][COLOR= #007700]))
    {[/COLOR]
        [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<div class="icon_bad_email"></div>[/COLOR][COLOR= #007700];
    }[/COLOR]
    [URL="http://www.php.net/else"]else[/URL]
    [COLOR= #007700]{[/COLOR]
        [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<div class="icon_good_email"></div>[/COLOR][COLOR= #007700];
    }[/COLOR]

    [COLOR= #0000BB]$sql1[/COLOR] [COLOR= #007700]=[/COLOR] DB[COLOR= #007700]::[/COLOR]Query[COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * from users where mail = "[/COLOR][COLOR= #007700].[/COLOR]DB[COLOR= #007700]::[/COLOR]Escape[COLOR= #007700]([/COLOR][COLOR= #0000BB]$email[/COLOR][COLOR= #007700]).[/COLOR][COLOR= #DD0000]" LIMIT 1"[/COLOR][COLOR= #007700]);[/COLOR]
    [COLOR= #0000BB]$num1[/COLOR] [COLOR= #007700]=[/COLOR] DB[COLOR= #007700]::[/COLOR]NumRows[COLOR= #007700]([/COLOR][COLOR= #0000BB]$sql1[/COLOR][COLOR= #007700]);[/COLOR]
    [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$num1[/COLOR] [COLOR= #007700]==[/COLOR] [COLOR= #0000BB]1[/COLOR] [COLOR= #007700])
    {[/COLOR]
    ?>
    <div class="icon_bad_email" onmouseover="tooltip.show(Email is al in gebruik);" onmouseout="tooltip.hide();"></div>    
    [COLOR= #0000BB]<?php[/COLOR] [COLOR= #007700]}[/COLOR] [URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR] ?>
    <div class="icon_good_email" onmouseover="tooltip.show(Email is goed);" onmouseout="tooltip.hide();"></div>
    [COLOR= #0000BB]<?php[/COLOR] 
    [COLOR= #007700]}
}[/COLOR]
?>
0
Tmeiland

Lid · Topicstarter

Berichten
450
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Klopt niet want als je het nu zo doet krijg je 2 images door elkaar.

want je hebt
}
else
{ ---> DEZE helemaal onder afgesloten met if($num ==1)
if(!checkemail($email))
{

ik vond het ook heel raar, hopelijk kan iemand het fixxen.

toevoeging op 17 augustus 2013, 221034:
Ik heb het al gefixt, met dank aan Remy, Remy heeft het overzichterlijker gemaakt en heb het probleem al gevonden bedankt Remy
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