[PHP] Undefined index

Gestart doorDaveygoud12 reacties50 weergaven

13 berichten · pagina 1 van 1

Daveygoud

Lid · Topicstarter

Berichten
196
Reputatie
0
Punten
0,03
Lid sinds
Laatst gezien
hoi allemaal,
ik heb problemen met me website, ik krijg de fouten er niet uit heb overal gekeken blijkbaar ergens waar ik niet uit kom

dit zijn de fouten
Spoiler tonen
Notice: Undefined index: p in /home/daveygoud/domains/radiodeurkruk.nl/public_html/index_site.php on line 39

Notice: Undefined index: p in /home/daveygoud/domains/radiodeurkruk.nl/public_html/index_site.php on line 42
De pagina kon niet worden gevonden!
Lukt het je Pm me maar
0
Berichten
14.025
Reputatie
1
Punten
0,01
Lid sinds
Laatst gezien
Gebruik isset();
0
Berichten
10.421
Reputatie
4
Punten
0,00
Lid sinds
Laatst gezien
Verzin aub een betere titel.
0
Daveygoud

Lid · Topicstarter

Berichten
196
Reputatie
0
Punten
0,03
Lid sinds
Laatst gezien
Aarclay schreef:
Verzin aub een betere titel.
betersmile
0
Berichten
1.284
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
[COLOR= #0000BB]<?php

$p[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]p[/COLOR][COLOR= #007700]];[/COLOR]

[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$p[/COLOR][COLOR= #007700]))
{[/COLOR]
  [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]blabla[/COLOR][COLOR= #007700];
}[/COLOR]

?>
0
Berichten
10.421
Reputatie
4
Punten
0,00
Lid sinds
Laatst gezien
Daveygoud schreef:
Eerdere citaten tonen
Aarclay schreef:
Verzin aub een betere titel.
betersmile
Nee, niks beter. Vermeld je PROBLEEM in je titel.
0
Berichten
18.482
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Mounssif schreef:
[COLOR= #0000BB]<?php

$p[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]p[/COLOR][COLOR= #007700]];[/COLOR]

[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$p[/COLOR][COLOR= #007700]))
{[/COLOR]
  [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]blabla[/COLOR][COLOR= #007700];
}[/COLOR]

?>
En dan roep je de pagina zo aan: pagina.php?bla=bla en krijg je alsnog
Notice: Undefined index: p in pagina.php on line 3
0
Berichten
10.421
Reputatie
4
Punten
0,00
Lid sinds
Laatst gezien
Mounssif schreef:
[COLOR= #0000BB]<?php

$p[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]p[/COLOR][COLOR= #007700]];[/COLOR]

[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$p[/COLOR][COLOR= #007700]))
{[/COLOR]
  [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]blabla[/COLOR][COLOR= #007700];
}[/COLOR]

?>
Niet onnodig variabelen kopiëren. ..
0
Rik

Lid

Berichten
18.393
Reputatie
0
Punten
0,04
Lid sinds
Laatst gezien
Mounssif schreef:
[COLOR= #0000BB]<?php

$p[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]p[/COLOR][COLOR= #007700]];[/COLOR]

[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$p[/COLOR][COLOR= #007700]))
{[/COLOR]
  [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]blabla[/COLOR][COLOR= #007700];
}[/COLOR]

?>
Je moet $_GET[p] niet in een variabele wegstoppen als je er geen bewerkingen in doet. Is nergens voor nodig en zorgt juist voor meer fouten. $_GET is gewoon een normale (globale) array.
0
Berichten
10.421
Reputatie
4
Punten
0,00
Lid sinds
Laatst gezien
Dus...

[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]p[/COLOR][COLOR= #007700]])) {[/COLOR]
  [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]blabla[/COLOR][COLOR= #007700];
}[/COLOR]
?>


Et voila.... smile
0
Daveygoud

Lid · Topicstarter

Berichten
196
Reputatie
0
Punten
0,03
Lid sinds
Laatst gezien
Kan er ook iemand even via teamviewer helpen kom er echt niet uitconfusedAls het kan graag
0
Berichten
10.421
Reputatie
4
Punten
0,00
Lid sinds
Laatst gezien
Daveygoud schreef:
Kan er ook iemand even via teamviewer helpen kom er echt niet uitconfused
Als het kan graag

Kijk eens goed. Ik zie hier een oranje site, een aantal berichten onder elkaar, en dat heet een forum. Dus daar helpen we je ook. smile
Niet via Prive-bericht, niet via mail, niet via TeamViewer, niet via berichten via de postduif, ook niet via Whatsapp, ook niet via Facebook en ook niet via rooksignalen. Zo kunnen anderen er ook wat van leren, want kennis is iets wat ook best gedeeld mag worden, en bovendien hoeft iemand zich niet verplicht te voelen om je te helpen, want dat doen we met elkaar.

Dus ik zou zeggen:
Brand maar los in dit topic smile
0
Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
Als je nu eens je php code zou posten zou het eeeenorm handig zijn emo Ik kan niet zomaar voorspellen wat de fout is als ik je code niet heb. 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