Friday, May 17, 2024
 Popular · Latest · Hot · Upcoming
151
rated 0 times [  156] [ 5]  / answers: 1 / hits: 31577  / 13 Years ago, mon, september 19, 2011, 12:00:00

I want for something like this:



<?php
if($something)
header('Location:javascript:history.go(-2)');
?>


but header('Location:javascript:history.go(-2)'); doesn't work. Any alternatives?



I don't know the page the user was just on, so I can't hardcode the url.


More From » php

 Answers
15

From your point of view, i think you might be looking for something like this:



<html><head></head><body>
<?php
if($something){
?>
<script type=text/javascript>
window.history.go(-2);
</script>
<?php
}
?>
</body></html>

[#90033] Friday, September 16, 2011, 13 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
lesli

Total Points: 348
Total Questions: 105
Total Answers: 119

Location: United States Minor Outlying Island
Member since Fri, Jan 6, 2023
1 Year ago
;