I have a jQuery Dialog set to autoOpen:true.
Thus it pops up on page load. The dialog contains two buttons
one closes it, the other opens a form,
, when I submit the form, I have set a redirect to the same page.
I would rather this `dialog’ does not appear again when the redirect (kind of refresh) happens.
I have tried using $_SERVER['HTTP_REFERER'] and $_SERVER['REQUEST_URI'] as below:
var ref_url = $('#referring_url').val();
var cur_url = $('#current_url').val();
var refresher = true;
if(ref_url = cur_url)
refresher = false;
else
refresher = true;
I have set the dialog autoOpen value to refresher
and then to parse the uri values from php i have used the hidden input boxes below:
<input id="referring_url" name="referring_url" id="referring_url" type="hidden" value="<?php echo $_SERVER['HTTP_REFERER']; ?>" />
<input id="current_url" name="current_url" id="current_url" type="hidden" value="<?php echo $_SERVER['REQUEST_URI']; ?>" />
You are using assignment in the if expression.
if(ref_url = cur_url){this statement should beif(ref_url == cur_url){