Copyright © https://mongoose-os.com

Mongoose OS Forum

frame

Redirect with PHP

I am having difficulty getting a simple redirect to work in PHP. It works fine using other systems like WAMP and UWAMP. Doesn't seem to like Mongoose.
I purchase mongoose because I thought it was a great lightweight server solution for development on my PC but it is not much good if I cannot do this.

Comments

  • SergeySergey Dublin, Ireland

    Mongoose binary has all the features turned on for a week in a free download version.
    Meaning, you can try before you buy.
    Nevertheless, if you're not happy, let us know your details, we'll reimburse.

  • BlouetBlouet Melksham, UK

    That's not very helpful. I want to get it to work not get my money back. It's a great product but could be a little better with the help.

  • SergeySergey Dublin, Ireland
    edited March 2017

    Peter, then we need an exact sequence of steps from you - what you did, what did you expect to see, what did you see in reality, and overall - what you're trying to achieve. having difficulty is something we cannot constructively address.

  • BlouetBlouet Melksham, UK

    Here is the code that is not working:
    <?php
    $root = $_SERVER['DOCUMENT_ROOT'];
    $file = str_replace($root,"",$_GET['file']);
    $file = str_replace('\', '/', $file);
    $file = 'location: http://localhost'.$file;
    header($file);

    The last line should redirect to a different page. This is not happening. I wonder if there is flag I should set within the PHP.ini file or in the mongoose.conf file. My expertise on this is not great. No that is not correct - it is crap.

  • SergeySergey Dublin, Ireland
    edited March 2017

    Does it work with hardcoded location, like this?

    <?php header('Location: http://google.com', true, 302); exit(); >
    
  • BlouetBlouet Melksham, UK

    No it doesn't however I have just discovered the problem with a process of trial and error. It didn't like the msql dll in the php.ini file. I just commented that out and it all work as it should. Basically all my own fault. Thanks for giving me your time.

  • SergeySergey Dublin, Ireland

    Great, thanks for letting us know, Peter!

Sign In or Register to comment.