run code inside editor php

run code inside editor php

Janis0941Janis0941 Posts: 4Questions: 2Answers: 1

Folowing code is working with $_GET

html: ajax: '../code.php?user=$loged_user',
php ->where( 'user', $_GET['user'] )

but $_GET function is not secure and it can be bypassed by passing dfferent value. I wanted to replace $_GET with direct php function, but adding code directly is not working and shows errors:

// DataTables PHP library and database connection
include( "lib/DataTables.php" );
$loged_user = some function;

This question has accepted answers - jump to:

Answers

  • allanallan Posts: 64,519Questions: 1Answers: 10,664 Site admin
    Answer ✓

    What error goes it result in? As long as the function returns a string, you can replace $_GET['user'] there.

    Typically a session variable would be used if you are attempting to limit the access by a user id.

    Allan

  • Janis0941Janis0941 Posts: 4Questions: 2Answers: 1
    Answer ✓

    Thankyou - it turns it was my mistake and one dependent function was not corectlly loaded in my funtion. Problem solved!

Sign In or Register to comment.