Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 9 of 9

Thread: Question!

  1. #1
    Regular Coder
    Join Date
    Jan 2011
    Posts
    117
    Thanks
    27
    Thanked 0 Times in 0 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!

  • #2
    Senior Coder
    Join Date
    Jul 2011
    Posts
    1,226
    Thanks
    3
    Thanked 171 Times in 171 Posts
    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?

  • #3
    Regular Coder
    Join Date
    Jan 2011
    Posts
    117
    Thanks
    27
    Thanked 0 Times in 0 Posts
    Quote 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!

  • #4
    Senior Coder
    Join Date
    Jul 2011
    Posts
    1,226
    Thanks
    3
    Thanked 171 Times in 171 Posts
    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.

  • #5
    Regular Coder
    Join Date
    Jan 2011
    Posts
    117
    Thanks
    27
    Thanked 0 Times in 0 Posts
    You need a promotion badly! Lol!!!

  • #6
    Regular Coder
    Join Date
    Jan 2011
    Posts
    117
    Thanks
    27
    Thanked 0 Times in 0 Posts
    Quote 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?

  • #7
    Senior Coder
    Join Date
    Jul 2011
    Posts
    1,226
    Thanks
    3
    Thanked 171 Times in 171 Posts
    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

  • #8
    Regular Coder
    Join Date
    Jan 2011
    Posts
    117
    Thanks
    27
    Thanked 0 Times in 0 Posts
    Quote 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.

  • #9
    Senior Coder
    Join Date
    Jul 2011
    Posts
    1,226
    Thanks
    3
    Thanked 171 Times in 171 Posts
    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 .


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •