Web Analytics Made Easy -
StatCounter Question! - CodingForum

Announcement

Collapse
No announcement yet.

Question!

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

  • Question!

    Alright i hope i can explain this as best as i can without anyone getting confused! So let's began shall we?

    I would like to create a drop down box with names like:

    Code:
    Chat 1 
    Chat 2
    Chat 3
    Alright, for each one of those drop down names i would like it to implement a number inside my SiteID stable. The number's can be any digits long. So when people look on the registration form they will see chat 1, chat 2, chat 3, for the drop down boxes. Then when they login their profile they will see the numbers from another thing that i am doing.

    The chat 1 for example will have a a number of:

    Code:
    1000
    and it will show up on a parameter of:

    PHP Code:
    <param name="siteID" value="<?php echo $_SESSION['SESS_SITE_ID']; ?>">
    Something like that, i hope someone can understand where i am coming from and help me with this. Thank you in advanced!
    Im a little Bi^*@ that cant do anything...

  • #2
    Not REALLY grasping entirely on what you're wanting to do here. Are the drop down selections on a form at registration? In other words, are they part of a form a user will submit before seeing results?
    Useful function to retrieve difference in times
    The best PHP resource
    A good PHP FAQ
    PLEASE remember to wrap your code in [PHP] tags.
    PHP Code:
    // Replace this
    if(isset($_POST['submitButton']))
    // With this
    if(!empty($_POST))
    // Then check for values/forms. Some IE versions don't send the submit button 
    Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.

    Comment


    • #3
      Originally posted by BluePanther View Post
      Not REALLY grasping entirely on what you're wanting to do here. Are the drop down selections on a form at registration? In other words, are they part of a form a user will submit before seeing results?
      Yes the drop down is in a registration form i made. I want it to show names of something and when they submit the registration it shows up as numbers inside the mysql table!
      Im a little Bi^*@ that cant do anything...

      Comment


      • #4
        Still not really following the purpose of this. Elaborate a bit more for me please.

        Dubiously moving forward, the html <select name="chatroom"> will pass the selected <option value="value"> inside $_POST['chatroom']. In other words:
        Code:
        <select name="chatroom">
            <option value="1">Chat 1</option>
            <option value="2">Chat 2</option>
            <option value="3">Chat 3</option>
        </select>
        Will pass $_POST['chatroom'] as the selected option in the drop down - values from 1 to 3 (as strings remember). Some sort of adaption of that is what you're looking for, but that's as far as I'll go without some more information.
        Useful function to retrieve difference in times
        The best PHP resource
        A good PHP FAQ
        PLEASE remember to wrap your code in [PHP] tags.
        PHP Code:
        // Replace this
        if(isset($_POST['submitButton']))
        // With this
        if(!empty($_POST))
        // Then check for values/forms. Some IE versions don't send the submit button 
        Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.

        Comment


        • #5
          You need a promotion badly! Lol!!!
          Im a little Bi^*@ that cant do anything...

          Comment


          • #6
            Originally posted by BluePanther View Post
            Still not really following the purpose of this. Elaborate a bit more for me please.

            Dubiously moving forward, the html <select name="chatroom"> will pass the selected <option value="value"> inside $_POST['chatroom']. In other words:
            Code:
            <select name="chatroom">
                <option value="1">Chat 1</option>
                <option value="2">Chat 2</option>
                <option value="3">Chat 3</option>
            </select>
            Will pass $_POST['chatroom'] as the selected option in the drop down - values from 1 to 3 (as strings remember). Some sort of adaption of that is what you're looking for, but that's as far as I'll go without some more information.
            You solved my problem! Great job~

            I have one more issue though, is it possible to "mask" "hide" something like this:

            PHP Code:
            <param NAME="realname" VALUE="<?php echo $_SESSION['SESS_REAL_NAME'];?>">
            So when it shows up in view source it will say the persons real name. We dont want that instead it will show something else? Is it possible to hide it or when they view the source it is replaced by something else?
            Im a little Bi^*@ that cant do anything...

            Comment


            • #7
              not to the best of my knowledge. If it is important that no-one knows this info, you should rethink the method you're using. For instance, this info is already stored in the session, maybe just lift directly from there? See what you come up with.

              Glad you found a solution to your problem based on my stab in the dark approach
              Useful function to retrieve difference in times
              The best PHP resource
              A good PHP FAQ
              PLEASE remember to wrap your code in [PHP] tags.
              PHP Code:
              // Replace this
              if(isset($_POST['submitButton']))
              // With this
              if(!empty($_POST))
              // Then check for values/forms. Some IE versions don't send the submit button 
              Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.

              Comment


              • #8
                Originally posted by BluePanther View Post
                not to the best of my knowledge. If it is important that no-one knows this info, you should rethink the method you're using. For instance, this info is already stored in the session, maybe just lift directly from there? See what you come up with.

                Glad you found a solution to your problem based on my stab in the dark approach
                How would i expire a session within 20 seconds? like i don't want anyone looking at the source code and seeing the site id.
                Im a little Bi^*@ that cant do anything...

                Comment


                • #9
                  Session data is like any other variable in PHP - server side until specified otherwise (session data is unique to client). People will only see the data you physically output to them. So, in your example of outputting the real name, they will only see the real name - they will not see anything else to do with the session - the 'view source' will display <param name="realname" value="Joe Bloggs" />. Expiring your session data will mean that after 20 seconds, your user will effectively be logged out. It's an unnecessary step, that we don't really need to take .
                  Useful function to retrieve difference in times
                  The best PHP resource
                  A good PHP FAQ
                  PLEASE remember to wrap your code in [PHP] tags.
                  PHP Code:
                  // Replace this
                  if(isset($_POST['submitButton']))
                  // With this
                  if(!empty($_POST))
                  // Then check for values/forms. Some IE versions don't send the submit button 
                  Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.

                  Comment

                  Working...
                  X
                  😀
                  🥰
                  🤢
                  😎
                  😡
                  👍
                  👎