-1

For some reason I cannot get this code to work for a back button. Can anyone see what I'm doing wrong?

<button type="submit" class="single_add_to_cart_button shop-skin-btn shop-flat-btn" onclick="<?php echo $_SERVER['HTTP_REFERER'] ?>">Back</button>

Thanks very much.

user2377521
  • 25
  • 1
  • 6

1 Answers1

1

First, $_SERVER['HTTP_REFERER'] is not one to trust at all(some browsers allow you to modify, others block it), thus you need to sanitize the data, maybe urlencode, etc. Second, try using <a href=""></a> instead.