Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5

Thread: Strange problem

  1. #1
    New to the CF scene
    Join Date
    Aug 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Strange problem

    i write code below

    require('system.settings.php?oper=1');

    and the server return me this message

    Fatal error: require() [function.require]: Failed opening required 'system.settings.php?oper=1'

    i check the path and it's right path

    but when i write the code without the "?oper=1" its working fine

    i check my php.ini "register_globals On"

    so wtf...?

  • #2
    Master Coder
    Join Date
    Jun 2003
    Location
    Cottage Grove, Minnesota
    Posts
    9,502
    Thanks
    8
    Thanked 1,089 Times in 1,080 Posts
    You can't pass a variable within "include" or "require".

    Why do you need oper=1?

  • #3
    New to the CF scene
    Join Date
    Aug 2012
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    hi thnx for relpy

    hi actually u can pass it throw require() function i do it before..!!!,
    and it's work fine

    but when i make new installation on my computer so dost work

    so i think it is in php.ini

  • #4
    Senior Coder
    Join Date
    Jun 2008
    Location
    New Jersey
    Posts
    2,536
    Thanks
    45
    Thanked 259 Times in 256 Posts
    According to the documentation, you can use the URL fopen wrappers to allow get variables, but it seems only for remote files? I don't know if that makes sense, but I guess if the wrappers are active, it should work locally too?

    But in general, no, you can't pass variables, with good reason... include/require open files, not access URLs.

  • #5
    Regular Coder
    Join Date
    May 2011
    Posts
    124
    Thanks
    12
    Thanked 6 Times in 6 Posts
    Try this:

    PHP Code:
    $_GET['oper']=1;
    require(
    'system.settings.php'); 


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •