This topic is locked
[SOLVED]

  Prohibit the display of the page of a List

9/24/2012 10:39:46 AM
PHPRunner General questions
N
netmedia59 author

Hello,
Is there a way to prohibit the display of the page blabla_list.php

When I have a page like blabla_list.php?mastertable=salonspro&masterkey1=123

In other words, I don't want the users to have the ability to display : blabla_list.php

If they open that page, they must be redirected to menu.php
Thanks
Olivier
Lille (FRANCE)

C
cgphp 9/24/2012

Not sure I understand what you mean. Do you want to prohibit the access to that page when mastertable parameter is part of the request?

N
netmedia59 author 9/24/2012

Hey Cristian,
Thanks for the message

It's the oposite, I want to prohibit the access when there is no master table

NO : blabla_list.php so go to menu.php or something else

YES : blabla_list.php?mastertable=salonspro&masterkey1=123

Regards
Olivier



Not sure I understand what you mean. Do you want to prohibit the access to that page when mastertable parameter is part of the request?

Sergey Kornilov admin 9/24/2012

The easiest solution - remove blabla_list.php from the menu so it can be only accessed from the master table.

C
cgphp 9/24/2012

In the "After application initialized" event, enter the following code:

if(basename($_SERVER['SCRIPT_FILENAME']) == 'blabla_list.php' && (!isset($_GET['mastertable']) || $_GET['mastertable'] != 'salonspro'))

{

header('Location: menu.php');

exit();

}
N
netmedia59 author 9/25/2012

Hey Cristian,
Thanks very much !

It's working great

The only problem is that I can't delete a record in the list now even when there is a mastertable

When I want to delete a checked record ... i'm redirected to menu.php

Is there a way to make an exception ?
Thanks again

Regards
Olivier

C
cgphp 9/25/2012
if(basename($_SERVER['SCRIPT_FILENAME']) == 'blabla_list.php' && (!isset($_POST['a']) || $_POST['a'] != 'delete' || !isset($_GET['mastertable']) || $_GET['mastertable'] != 'salonspro'))

{

header('Location: menu.php');

exit();

}
N
netmedia59 author 9/25/2012

Hey Cristian
BRAVO
It works exactly as expected

MERCI

Thanks again
Olivier
Lille (FRANCE)


if(basename($_SERVER['SCRIPT_FILENAME']) == 'blabla_list.php' && (!isset($_POST['a']) || $_POST['a'] != 'delete' || !isset($_GET['mastertable']) || $_GET['mastertable'] != 'salonspro'))

{

header('Location: menu.php');

exit();

}