Require_once and fopen in php security -


i have 1 file i've implemented in php. error

warning: require_once(): http:// wrapper disabled in server configuration allow_url_include=0 in /applications/mamp/htdocs/opencart/catalog/view/theme/default/template/payment/bank_transfer.tpl on line 13warning:

questions:

  1. i know need fix allowing allow_url_include=0, in php.ini.i'm using mamp, i've searched folders in mamp , mamp pro, didn't find line, can set value 0. do add line?

  2. i've read link , i'm worried there security issues using require_once, fopen , absolute url. there security issues using absolute url , require_once?

  3. how can specify url document? it's www.example.com/opencart/admin/kzm/kzm.utils.php, tried use relative url /opencart/admin/kzm/kzm.utils.php, didn't find file. doing right?

bank_transfer.tpl:

<h2><?php echo $text_instruction; ?></h2>     <div class="content">           <p><?php echo $text_description; ?></p>           <p><?php echo $bank; ?></p>           <p><?php echo $text_payment; ?></p>           <p><?php echo $orderidkzm; ?></p>           <p>           <?php              echo $amountkzm;              $titlekzm = $titlekzm.$orderidkzm;              echo '<br>';              require_once('http://example.com/opencart/admin/kzm/kzm.utils.php');             echo $titlekzm;             echo '<br>';              $merchantidkzm = '10';             $currencykzm = 'kzt';             $successurlkzm = 'http://localhost:8888/opencart/admin/kzm/kzm_pay.php';             $errourlkzm = 'http://www.google.com';              $datekzm = " ";             $signstrkzm = " ";             $verkzm = " ";             echo $merchantidkzm.'-'.$currencykzm.'-'.$successurlkzm.'-'.$errourlkzm.'-'.$datekzm;            ?></p>     </div>     <div class="buttons">       <div class="right">             <form action="/opencart/testkzm.php" method="get">                 <input type="hidden" name="merchantidkzm" value="<?php echo $merchantidkzm; ?>">                 <input type="hidden" name="orderidkzm" value="<?php echo $orderidkzm; ?>">                 <input type="hidden" name="amountkzm" value="<?php echo $amountkzm; ?>">                 <input type="hidden" name="currencykzm" value="<?php echo $currencykzm; ?>">                 <input type="hidden" name="successurlkzm" value="<?php echo $successurlkzm; ?>">                 <input type="hidden" name="errorurlkzm" value="<?php echo $errorurlkzm; ?>">                 <input type="hidden" name="signstrkzm" value="<?php echo $signstrkzm; ?>">                 <input type="hidden" name="verkzm"  value="<?php echo $verkzm; ?>">                  <input type="submit" value="<?php echo $button_confirm; ?>" id="button-confirm" class="button" />             </form>         </div>     </div> 

changing allow_url_include=1 not safe. it's set disabled default.

when include on local machine use can ported across platforms. hardcoding include below web root can lead mandatory rewrites if you're on shared hosting plan or if don't control server. more portable dev/production environment.

<?php      require_once($_server['document_root'].'/opencart/admin/kzm/kzm.utils.php');  ?> 

if need directory can this:

<?php      require_once($_server['document_root'].'/../website2_folder/opencart/admin/kzm/kzm.utils.php');  ?> 

Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -