apache - php variable $page not passed correctly into the URL -
i'm trying install review&approval server kollaborate, it's zip package containing js/php files needs deployed in document root, , navigate http://server-ip/install/index.php
but navigating next page result in literally passing $page variable url instead of 1.php -> 2.php , on.. this: http//server-ip/install/index.php?page=<?=($page+1)
resulting in 'page not found!' pagecounter on webpage not displaying correctly looks variable $page index.php not passed browser correctly real value. suexec disabled fast-cgi wrapper, , there re-writing rules in .htaccess
rewriteengine on # not directory rewritecond %{request_filename} !-d # existing php file rewritecond %{request_filename}\.php -f # rewrite index index.php rewriterule ^(.*)$ $1.php
a short snippet navigation function done javascript: since piece of software can purchased , don't need editing customers show how construct it. kollaborate support not me further other saying wrong in installation.
<?php $page_count = 15; $page = 1; if (isset($_get['page'])) $page = $_get['page']; if (!file_exists("pages/$page.php")) { echo '<h1>error: page not found!</h1> <a href="index.php?page='.($page+1).'"><button>next page</button</a>'; exit; }
and navigation step bit further in index.php
<script> function nextpage() { if (typeof endpage == 'function') { var err = endpage(); if (err && err.length > 0) { $('#error').html(err); $('#error').show(); return; } } $('#error').hide(); window.location.href = "index.php?page=<?=($page+1)?>"; } </script>
this kollaborate server requires sort of lampp stack on ubuntu, i'm using centos , installed separate required packages php/mysql/nodejs/
the configuration of server goes in 15 steps each step defined in separate php files(1.php thru 15.php) residing in pages folder within install folder.
i had working once centos year ago, can't figure out for... malformed config issue in httpd or php? or nodejs perhaps? installed on centos 6.7 latest of , based on httpd , php 5.5.3(tried nginx before yields in same disappointing result)
from first glance short tags might not turned on in php config. using short tags <?
instead of long tags <?php
requires short_open_tag
php ini directive set. if create php script in application , have run phpinfo();
there should line tells if short tags off or on. search 'short_open_tag'.
you try switching long tag syntax in index.php
, instead of
window.location.href = "index.php?page=<?=($page+1)?>";
the line be
window.location.href = "index.php?page=<?php echo ($page+1);?>";
Comments
Post a Comment