mvasco
mvasco

Reputation: 5101

JQuery Mobile and PHP

I am using Dreamweaver with JQuery Mobile to create a web site.

I know that in JQuery Mobile I have to include `rel="external" to link to an external file.

In my case, as I am using Dreamweaver's generated code, I need to change it at this point:

$MM_redirectLoginSuccess = "menu.php";
if (isset($_SESSION['PrevUrl']) && false) {
      $MM_redirectLoginSuccess = $_SESSION['PrevUrl'];  
    }
    header("Location: " . $MM_redirectLoginSuccess );
  }
  else {
    header("Location: ". $MM_redirectLoginFailed );
  }

I have tried putting

$MM_redirectLoginSuccess = "menu.php rel='external'";

but it doesn´t work.

Any help is welcome.

UPDATED

This the URL showed in the browser before the user logs in

http://.../obrasbiesa/login.php

And this is the URL showed in the browser after login, it should be

http://.../obrasbiesa/menu.php

but it is

http://.../obrasbiesa/login.php#/obrasbiesa/login.php

Upvotes: 1

Views: 72

Answers (1)

Latheesan
Latheesan

Reputation: 24116

The code snippet you've posted has quite a bit of syntax errors.

Try this :

// Set Previous Url
$_SESSION['PrevUrl'] = 'http://'. $_SERVER['HTTP_HOST'] .'/obrasbiesa/menu.php';

// Redirect
if (isset($_SESSION['PrevUrl']) && !empty($_SESSION['PrevUrl'])) {
    header("Location: " . $_SESSION['PrevUrl'] );
} else {
    header("Location: ". $MM_redirectLoginFailed ); // p.s. is this variable being set?
}

Upvotes: 1

Related Questions