Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (isset($_GET['add-to-cart'])) {
- $addToCartValue = $_GET['add-to-cart'];
- // Check if the value starts with 'gla_'
- if (strpos($addToCartValue, 'gla_') === 0) {
- // Extract the numeric part after 'gla_'
- $numericId = substr($addToCartValue, 4);
- // Validate that the remaining string is numeric
- if (ctype_digit($numericId)) {
- // Redirect to the same page with the corrected query string
- $newUrl = '/gallery/?add-to-cart=' . $numericId;
- header('Location: ' . $newUrl);
- exit; // Stop further execution of the script
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment