0

<?php if ($_SERVER['REQUEST_METHOD'] == 'GET') {

if (isset($_GET['type'])) {
    switch ($_GET['type']) {
        case 'big':
            header('Location: HOME');
            // Query can be executed here...
            exit;
        break;

?>

<div class="container-fluid">
        <div class="row">
            <a href="?type=big">
                <div class="col-md-6 big">
                    <h1>Big</h1>

Those are my two sets of code. The PHP and the HTML. However whenever i click on the picture. The URL becomes http://WEBSITE/rooms?type=big , however it doesnt do the redirect part where it's meant to go to the ''home'' page.

My web.config for this is currently

<rule name="Imported Rule 6" stopProcessing="true">
                <match url="^rooms([a-zA-Z0-9_-]+)(|/)$" ignoreCase="false" />
                <action type="Rewrite" url="index.php?url=rooms&amp;type={R:1}" appendQueryString="false" />
            </rule>
omarisgod
  • 47
  • 5
  • Have you tried using the absolute path? – chris85 Jul 31 '16 at 23:18
  • can't you use "index.php"? – bzim Jul 31 '16 at 23:19
  • I'm a beginner with PHP. however i want a query to be executed too before the redirect. So if you have any suggestions I'd love to see. I cant use it under index.php because thats already in use. – omarisgod Jul 31 '16 at 23:19
  • With only that set of codes it's going to be hard to tell what's wrong. Are they in separate files? What's `HOME` supposed to mean? Do you have htaccess in your website? Also, take a look at [How do I get PHP Errors to display?](http://stackoverflow.com/questions/1053424/how-do-i-get-php-errors-to-display) – FirstOne Jul 31 '16 at 23:45
  • 1
    @FirstOne The error is to do with the web.config. I will upload what my web.config is for that certain rule on the main post. – omarisgod Jul 31 '16 at 23:59

1 Answers1

0

try: header("Refresh:0; url=index.php");

bzim
  • 1,002
  • 9
  • 17