$_GET values in Blank app

Hello.

I am paginating a table using blank application, in order to display page’s records a used $_GET variable as below validation when the page is not specified then show the first one:

$page = 1;
if (isset($_GET[‘page’])){
if (is_numeric($_GET[‘page’])){
$page= (int) $_GET[‘page’];
}
}

In the navigation var, I build the links via: sc_make_link(MY_APP, pagina=$page). But it does not work because the valued is never set for GET method.

In the other hand, if I do:

$page = 1;
if (isset([page])){
if (is_numeric([page])){
$page= (int) [page];
}
}

the application always ask for [page] value in order to initialize it, of course I won’t let the user to do that, because it should be set 1 in someway but never manually. Do you guys have some advice? Thank you in advance.

maybe

////////
[page] = “”;///block this line after test because it represents your global variable
$page = 1;
if (!isset([page]) or (empty([page]))){[page] = $page; } else {[page] = [page];}

if (isset([page])){
if (is_numeric([page])){
$page= (int) [page];
}
} else {[page] = $page ;}

switch($page)
{
case 1 :$relink = (“test link 1”);break;
case 2: $relink = (“test link 2”);break;
default: $relink = (“test link 1”);break;
}

echo $page.’</br>’;
echo $relink.’</br>’;

////////

Hello, @nsch2308 .
Thank you for your help, but for each session [page] will be asked the first time and it is what I am trying to avoid. I do not think so that this could do not be achieved in SC. Via PHP es the most easy thing passing and variable and then read it via $_GET.

not always obvious, but many variables depend on whether the session user opens or closes their session properly,
if it closes correctly, we can validate an output field and use it at logon, but only if he leaves cleanly, and, …
good continuation,

The braces [] are used to refer external variables. In jour app, go to the global variables section, and your [page] variable will show up. Ther you can set it to optional, and to especify the HTTM metod (get, post, etc) It works perfect for me