- This topic is empty.
Viewing 7 posts - 1 through 7 (of 7 total)
Viewing 7 posts - 1 through 7 (of 7 total)
- The forum ‘Back End’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
php $_GET and undefined index
<?php
if ($_GET['page']=='home')
{ include "modul/home.php";}
else
if ($_GET['page']=='detail')
{ include "modul/detail.php";}
?>
to get a variable in the url php page that
@robetnobe, you need to use complete sentences and ask a specific question. It is not clear what problem you are trying to solve. It would also probably be helpful if you answered Benwalker’s question.
yes want to get the page url in php variable error occurs that is undefined index
ok thanks walker
yes how to avoid showing error back
That’s a possible cause of your problem. If this is indeed what is causing your problem, then the solution is to check if $_GET['page']
exists before you try to use it:
<?php
// add this "isset" check:
if( isset( $_GET['page'] ) ){
if( $_GET['page']=='home' ){
include "modul/home.php";
}
elseif( $_GET['page']=='detail' ){
include "modul/detail.php";
}
}
ok i will try :)