cvs: phpweb / mirrors.php /include layout.inc

From: Date: Sat, 07 Jul 2001 03:41:11 +0000
Subject: cvs: phpweb / mirrors.php /include layout.inc
Groups: php.mirrors 
Request: Send a blank email to php-mirrors+get-5255@lists.php.net to get a copy of this message
jimw Fri Jul 6 23:41:11 2001 EDT Modified files: /phpweb mirrors.php /phpweb/include layout.inc Log: stay on same page when switching mirrors Index: phpweb/mirrors.php diff -u phpweb/mirrors.php:1.8 phpweb/mirrors.php:1.9 --- phpweb/mirrors.php:1.8 Mon Mar 12 14:33:52 2001 +++ phpweb/mirrors.php Fri Jul 6 23:41:10 2001 @@ -1,7 +1,8 @@ <?php require_once 'prepend.inc'; -if (isset($country)) { - header("Location: http://$country.php.net/"); +if (isset($REDIRECT)) { + header("Location: $country$FROM"); + exit; } commonHeader("Mirrors Page"); ?> Index: phpweb/include/layout.inc diff -u phpweb/include/layout.inc:1.41 phpweb/include/layout.inc:1.42 --- phpweb/include/layout.inc:1.41 Fri Jul 6 23:23:33 2001 +++ phpweb/include/layout.inc Fri Jul 6 23:41:10 2001 @@ -1,5 +1,5 @@ <?php -/* $Id: layout.inc,v 1.41 2001/07/07 03:23:33 jimw Exp $ */ +/* $Id: layout.inc,v 1.42 2001/07/07 03:41:10 jimw Exp $ */ # spacer() @@ -285,7 +285,7 @@ # function commonFooter() { - global $SCRIPT_NAME,$MYSITE,$LAST_UPDATED,$enclosed; + global $SCRIPT_NAME,$MYSITE,$LAST_UPDATED,$PHP_SELF,$enclosed; if ($enclosed) { echo "</td></tr></table></td></tr></table>\n"; } @@ -301,16 +301,16 @@ function gotomirror(form) { url = form.country.options[form.country.selectedIndex].value; if (url != '<?php echo $MYSITE; ?>') { - window.location.href = url; + current = window.location.href; + window.location.href = url+current.substr(<?echo strlen($MYSITE)?>); } return false; } //--> </script> - <input type="hidden" name="REDIRECT" value="1"> + <input type="hidden" name="REDIRECT" value="1" /> + <input type="hidden" name="FROM" value="<?php echo htmlspecialchars($PHP_SELF)?>" /> <?php - # TODO: should send current url above, so we can redirect to - # the same page on the mirror, and do the same in our javascript. print_link('/source.php?url='.$SCRIPT_NAME, 'show source', false, 'class="small"'); echo delim(); print_link('/credits.php', 'credits', false, 'class="small"');

« previous php.mirrors (#5255) next »