Hoe kan ik dit doen!?

Gestart doorAllard16 reacties24 weergaven

17 berichten · pagina 1 van 2

Allard

Lid · Topicstarter

Berichten
970
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Beste,

Ik heb even een vraag. Ik heb een zeer belangrijk script. Als er iets mis is, komt dat er te staan via een print. Maar de functie gaat wel gewoon door. Dat wil ik niet. Ik heb het al via die() geprobeerd, maar dan verdwijnt ook de andere gedeeltes van de site. En ohja, het onderstaande script werkt helaas ook niet.

[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/register_shutdown_function"]register_shutdown_function[/URL][COLOR= #007700]([/COLOR]__FUNCTION__[COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/exit"]exit[/URL][COLOR= #007700]();[/COLOR]
0
Berichten
3.314
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Eerst de wel dingen doen en dan pas die gebruiken yummie
0
Allard

Lid · Topicstarter

Berichten
970
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Jullie snappen het niet. Het moet zoals hieronder. Alleen word Tekst niet meer weergegeven. Hoe kan ik dat wel doen?

[COLOR= #0000BB]<?php
$var[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]1[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$var[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]1[/COLOR][COLOR= #007700])
{[/COLOR]
      [URL="http://www.php.net/die"]die[/URL] [COLOR= #007700]([/COLOR][COLOR= #DD0000]"Error, var is gelijk."[/COLOR][COLOR= #007700]);
}[/COLOR] 

[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Tekst"[/COLOR][COLOR= #007700];[/COLOR]
?>
0
Berichten
2.692
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Allard schreef:
Jullie snappen het niet. Het moet zoals hieronder. Alleen word Tekst niet meer weergegeven. Hoe kan ik dat wel doen?
[COLOR= #0000BB]<?php
$var[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]1[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$var[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]1[/COLOR][COLOR= #007700])
{[/COLOR]
      [URL="http://www.php.net/die"]die[/URL] [COLOR= #007700]([/COLOR][COLOR= #DD0000]"Error, var is gelijk."[/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]"Tekst"[/COLOR][COLOR= #007700];
}[/COLOR]
?>

emo?

Edit: Oh.. Verkeert gelezen emo
0
Allard

Lid · Topicstarter

Berichten
970
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ja, wat kan ik vervangen door die? Een functie die wel het hele script stopt, maar Tekst wel laat zien.
0
Berichten
2.692
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Bedoel je nu zegmaar dat je iets IN een functie wilt stoppen?
Doe dan:

[COLOR= #0000BB]<?php[/COLOR]
[COLOR= #007700]function[/COLOR] blaat[COLOR= #007700]([/COLOR][COLOR= #0000BB]$a[/COLOR][COLOR= #007700]){[/COLOR]
    [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$a[/COLOR] [COLOR= #007700]==[/COLOR] [COLOR= #0000BB]1[/COLOR][COLOR= #007700])[/COLOR]
        [URL="http://www.php.net/return"]return[/URL] true[COLOR= #007700];
}[/COLOR]
?>
0
Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
[COLOR= #0000BB]<?php
$var[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]1[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$var[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]1[/COLOR][COLOR= #007700])
{[/COLOR]
      [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Tekst"[/COLOR][COLOR= #007700];[/COLOR]
      [URL="http://www.php.net/die"]die[/URL] [COLOR= #007700]([/COLOR][COLOR= #DD0000]"Error, var is gelijk."[/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]"Tekst"[/COLOR][COLOR= #007700];
}[/COLOR]
?>

emo zo dan?
Als je die() doet wordt je pagina afgebroken he
0
Allard

Lid · Topicstarter

Berichten
970
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Uhh nee, ik ga natuurlijk niet mijn hele website op die plaats zetten. Heeft iemand een goed alternatief?
0
Berichten
3.314
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ik snap wat je bedoelt, maar dit is niet mogelijk, dan moet je je script wat aanpassen yummie
0
Allard

Lid · Topicstarter

Berichten
970
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
En wat zal ik dan moeten aanpassen?
0
Berichten
3.314
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Gewoon if ($welgoed){ doe ditte();
}
else{Doe niets;}
0
Berichten
2.692
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Of..

[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$wat[/COLOR] [COLOR= #007700]==[/COLOR] [COLOR= #0000BB]1[/COLOR][COLOR= #007700]){[/COLOR]
     goto verdermetscript[COLOR= #007700];
}[/COLOR]

[COLOR= #FF8000]//hier allemaal scripts :P deze zie je niet als $wat gelijk aan 1 is ;p[/COLOR]

verdermetscript[COLOR= #007700]: {[/COLOR]
      [COLOR= #FF8000]//Hier tussen weer een script :P
      //idk of dit wel zo moet maar er is wel iets als goto ;p[/COLOR]
[COLOR= #007700]}[/COLOR]
?>
0
Berichten
1.811
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Het Goto-statement wordt sterk afgeraden te gebruiken.
0
Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
Superb schreef:
Of..

[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$wat[/COLOR] [COLOR= #007700]==[/COLOR] [COLOR= #0000BB]1[/COLOR][COLOR= #007700]){[/COLOR]
     goto verdermetscript[COLOR= #007700];
}[/COLOR]

[COLOR= #FF8000]//hier allemaal scripts :P deze zie je niet als $wat gelijk aan 1 is ;p[/COLOR]

verdermetscript[COLOR= #007700]: {[/COLOR]
      [COLOR= #FF8000]//Hier tussen weer een script :P
      //idk of dit wel zo moet maar er is wel iets als goto ;p[/COLOR]
[COLOR= #007700]}[/COLOR]
?>
HELP GOTO redfaceredfaceDit maakt je script echt lelijk dus gebruik dit aub niet emo
0
Berichten
2.692
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Niemand die het script ziet behalve jijzelf hea emo
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