show once

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    show once

    how can i make this code show one time on index

    Code:
    if($uid==$who)
    {
    echo "<br/><b><a href=\"index.php?action=uset&amp;sid=$sid\">[ Edit My  Profile ]</a></b>";
    }
    or how can i make a file to update the profile and make it show only once after registration

    #2
    Originally posted by riderz View Post
    how can i make this code show one time on index

    Code:
    if($uid==$who)
    {
    echo "<br/><b><a href=\"index.php?action=uset&amp;sid=$sid\">[ Edit My  Profile ]</a></b>";
    }
    or how can i make a file to update the profile and make it show only once after registration
    You can try like:

    PHP Code:
    $t mysql_fetch_array(mysql_query("SELECT regtime FROM ibwf_users WHERE id='".$who."' "));
    $rt $t[0];
    $nt time() - $rt;

    if(
    $nt<300)
    {
    echo 
    "<br/><b><a href=\"index.php?action=uset&amp;sid=$sid\">[ Edit My  Profile ]</a></b>";

    It will show that link up to 5 mins after anyone's registration.
    Tell me if it's working or not.

    @ riderz
    Last edited by anderson; 05.09.09, 14:45. Reason: sentence edition
    Wait...
    sigpic

    Comment


      #3
      Originally posted by anderson View Post
      You can try like:

      PHP Code:
      $t mysql_fetch_array(mysql_query("SELECT regtime FROM ibwf_users WHERE id='".$who."' "));
      $rt $t[0];
      $nt time() - $rt;

      if(
      $nt<300)
      {
      echo 
      "<br/><b><a href=\"index.php?action=uset&amp;sid=$sid\">[ Edit My  Profile ]</a></b>";

      It will show that link up to 5 mins after anyone's registration.
      Tell me if it's working or not.

      @ riderz
      this isn't a good idea..better to use an sql fetching with something like a row char(1) NOT NULL default '0'..if row is equal to 0 then show link to edit profile..then in the update page, you should query to set the row value into 1..then it will not show again after it was updated..Got my point?
      My Blog: http://jhommark.blogspot.com
      My Facebook: http://www.facebook.com/jhommark
      My Official Site: http://www.undergroundweb.tk
      My Community Site: http://undergroundwap.xtreemhost.com

      Comment


        #4
        Originally posted by kiLLeR-eyEd_14 View Post
        this isn't a good idea..better to use an sql fetching with something like a row char(1) NOT NULL default '0'..if row is equal to 0 then show link to edit profile..then in the update page, you should query to set the row value into 1..then it will not show again after it was updated..Got my point?
        riders asked for a code that shows the link only for once after registration so I coded in that way. Besides personally I avoid sql as much as I can.
        Wait...
        sigpic

        Comment


          #5
          I would have said use a session variable set on the register page but maybe the session isnt started intill you log-in!

          Code:
          $_SESSION['first_time'] = 1; // set on the register page
          then

          Code:
          if(isset($_SESSION['first_time'])){ 
          if($uid==$who)
          {
          echo "<br/><b><a href=\"index.php?action=uset&amp;sid=$sid\">[ Edit My  Profile ]</a></b>";
          }
          unset($_SESSION['first_time']); 
          }

          Comment


            #6
            Originally posted by wap2k View Post
            I would have said use a session variable set on the register page but maybe the session isnt started intill you log-in!

            Code:
            $_SESSION['first_time'] = 1; // set on the register page
            then

            Code:
            if(isset($_SESSION['first_time'])){ 
            if($uid==$who)
            {
            echo "<br/><b><a href=\"index.php?action=uset&amp;sid=$sid\">[ Edit My  Profile ]</a></b>";
            }
            unset($_SESSION['first_time']); 
            }
            Many old mobile phone doesn't support serverside session.
            Wait...
            sigpic

            Comment


              #7
              Originally posted by anderson View Post
              Many old mobile phone doesn't support serverside session.
              yeh, that's why what i've recommended is much better..Lol
              My Blog: http://jhommark.blogspot.com
              My Facebook: http://www.facebook.com/jhommark
              My Official Site: http://www.undergroundweb.tk
              My Community Site: http://undergroundwap.xtreemhost.com

              Comment


                #8
                Originally posted by anderson View Post
                Many old mobile phone doesn't support serverside session.
                I created my own session system for wapside. So i dont really know much about php sessions themselfs.

                Thankyou iv learned something new

                Comment


                  #9
                  Originally posted by anderson View Post
                  Many old mobile phone doesn't support serverside session.
                  if $_SESSION is not set then i create a cookie and call it with $_COOKIE..That's what i've done in my site..You can also use $_REQUEST['PHPSESSID'] where PHPSESSID is the sessi0n name..To debug, print session_name();
                  My Blog: http://jhommark.blogspot.com
                  My Facebook: http://www.facebook.com/jhommark
                  My Official Site: http://www.undergroundweb.tk
                  My Community Site: http://undergroundwap.xtreemhost.com

                  Comment


                    #10
                    Originally posted by kiLLeR-eyEd_14 View Post
                    if $_SESSION is not set then i create a cookie and call it with $_COOKIE..That's what i've done in my site..You can also use $_REQUEST['PHPSESSID'] where PHPSESSID is the sessi0n name..To debug, print session_name();
                    Old mobiles dont suppot both session n cookie. try logging ur site using a WAP 1.0 phone like Motorola C-168 or MAUE WAP browser. If u can log successfully dont' forget to inform me.
                    ======================

                    Well, riderz did u get ur solution from this thread? @ riderz
                    Wait...
                    sigpic

                    Comment


                      #11
                      Originally posted by anderson View Post
                      Old mobiles dont suppot both session n cookie. try logging ur site using a WAP 1.0 phone like Motorola C-168 or MAUE WAP browser. If u can log successfully dont' forget to inform me.
                      ======================

                      Well, riderz did u get ur solution from this thread? @ riderz
                      ok.,then try to use $_REQUEST['PHPSESSID']..Php provides the ses id depending on the browser i think?But, i get a problem with functions like parsepm($msg, $sid)..So i came back to SESSION and COOKIE..I think maui wap browsers have a cookie support?Then cookies will work..And other wap1.0..Unless they don't supp0rt c0okies..
                      My Blog: http://jhommark.blogspot.com
                      My Facebook: http://www.facebook.com/jhommark
                      My Official Site: http://www.undergroundweb.tk
                      My Community Site: http://undergroundwap.xtreemhost.com

                      Comment

                      Working...
                      X