Passing varaible through $_session but not working..

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • upendrajpr@gmail.com

    Passing varaible through $_session but not working..

    Dear friend,

    I am trying to send some login variable with

    <? session_start; ?>

    if(!isset($_SES SION['permission'])) {
    $_SESSION['permission'] = 1; }

    it works on the same page but when I come to some other page
    it can not worked .. I am using php 5.2.1 with apache server on xp. My
    register_global is disabled for security reason.

    How can I pass the variable to other page ??

    Thanks in advance.

    @situ

  • Michael Fesser

    #2
    Re: Passing varaible through $_session but not working..

    ..oO(upendrajpr @gmail.com)
    >Dear friend,
    >
    I am trying to send some login variable with
    >
    ><? session_start; ?>
    <?php session_start() ; ?>

    Relying on short open tags is bad.
    >if(!isset($_SE SSION['permission'])) {
    $_SESSION['permission'] = 1; }
    >
    it works on the same page but when I come to some other page
    >it can not worked ..
    Does the second page call session_start() as well? How do you transmit
    the session ID - in the URL or in a cookie?

    Micha

    Comment

    • Jerry Stuckle

      #3
      Re: Passing varaible through $_session but not working..

      upendrajpr@gmai l.com wrote:
      Dear friend,
      >
      I am trying to send some login variable with
      >
      <? session_start; ?>
      >
      <?php session_start() ; ?>
      if(!isset($_SES SION['permission'])) {
      $_SESSION['permission'] = 1; }
      >
      it works on the same page but when I come to some other page
      it can not worked .. I am using php 5.2.1 with apache server on xp. My
      register_global is disabled for security reason.
      >
      How can I pass the variable to other page ??
      >
      Thanks in advance.
      >
      @situ
      >

      --
      =============== ===
      Remove the "x" from my email address
      Jerry Stuckle
      JDS Computer Training Corp.
      jstucklex@attgl obal.net
      =============== ===

      Comment

      • Captain Paralytic

        #4
        Re: Passing varaible through $_session but not working..

        On 26 Jul, 14:27, Jerry Stuckle <jstuck...@attg lobal.netwrote:
        upendra...@gmai l.com wrote:
        Dear friend,
        >
        I am trying to send some login variable with
        >
        <? session_start; ?>
        >
        <?php session_start() ; ?>
        >
        if(!isset($_SES SION['permission'])) {
        $_SESSION['permission'] = 1; }
        >
        it works on the same page but when I come to some other page
        it can not worked .. I am using php 5.2.1 with apache server on xp. My
        register_global is disabled for security reason.
        >
        How can I pass the variable to other page ??
        >
        Thanks in advance.
        >
        @situ
        >
        --
        =============== ===
        Remove the "x" from my email address
        Jerry Stuckle
        JDS Computer Training Corp.
        jstuck...@attgl obal.net
        =============== ===
        Did you actually mean to say anything here Jerry?

        Comment

        • Jerry Stuckle

          #5
          Re: Passing varaible through $_session but not working..

          Captain Paralytic wrote:
          On 26 Jul, 14:27, Jerry Stuckle <jstuck...@attg lobal.netwrote:
          >upendra...@gma il.com wrote:
          >>Dear friend,
          >> I am trying to send some login variable with
          >><? session_start; ?>
          ><?php session_start() ; ?>
          >>
          >>if(!isset($_S ESSION['permission'])) {
          >> $_SESSION['permission'] = 1; }
          >> it works on the same page but when I come to some other page
          >>it can not worked .. I am using php 5.2.1 with apache server on xp. My
          >>register_glob al is disabled for security reason.
          >> How can I pass the variable to other page ??
          >> Thanks in advance.
          >> @situ
          >--
          >============== ====
          >Remove the "x" from my email address
          >Jerry Stuckle
          >JDS Computer Training Corp.
          >jstuck...@attg lobal.net
          >============== ====
          >
          Did you actually mean to say anything here Jerry?
          >
          Yep, check it again. A minor correction to the code - which on
          reloading the newsgroup I find Michael had also caught.

          --
          =============== ===
          Remove the "x" from my email address
          Jerry Stuckle
          JDS Computer Training Corp.
          jstucklex@attgl obal.net
          =============== ===

          Comment

          Working...