Im trying to run two php scripts, the first checks if a flagged game was chosen, if it was not i want the code to move on without running the second cookie check php code.
Only run the second code if the first has equal strings.
What should separate the two codes so it works as intended.
<?php
$string1 = $row['title'];
$string2 = ["game 1", "game 2", "game 3"];
// Check if any of the titles in $string2 are equal to $string1
foreach ($string2 as $title) {
if ($title == $string1) {
//Dont run this code below if $string1 is not equal to $string2
if (isset($_COOKIE['My Cookie'])) {
// The cookie exists
echo '<script>window.location.href = "https://www.mysite.com";</script>';
} else {
// The cookie doesn't exist
echo <<<EOF
<script type="text/javascript">
[Added this forum's [code]...[/code]
tags around the code block ~ MOD]