html5 - I want to pass `id` into index.php without using form but it is not working -


i want pass id index.php,my code shown below.

my main.php is:

<?php   $rd = dirname(__file__); //to directory path... $request[]='';      // make empty array  if (empty($request[1]) && empty($request[2]) && isset($_session['l_user'])) {      $request[1] = 'index';     $request[2] = '?id=1';     include_once($rd.'/php_includes/'.$request[1].'.php'.$request[2]); //i think problem might here...    }else {      $request[1] = 'index';     $request[2] = '?id=2';     include_once($rd.'/ph p_includes/'.$request[1].'.php'.$request[2]);  // , might here } ?> 

and index.php somethin this:

if(isset($_get['id'] == 1)) {            //do something... }else{            //do else... } 

but doesn't have result not have error.its not working.

try this, initilaise value top of include_once, , can able initalised variable inside included file (i.e index.php). note can't able pass value query string in include ad require

$id = '1'; include_once($rd.'/php_includes/'.$request[1].'.php'); 

in index.php

 if($id=="1"){    }else{    } 

Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -