...

View Full Version : Question!



xxcorrosionxx
09-12-2011, 05:36 AM
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:


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:


1000

and it will show up on a parameter of:


<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!

BluePanther
09-12-2011, 05:44 AM
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?

xxcorrosionxx
09-12-2011, 05:52 AM
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!

BluePanther
09-12-2011, 05:59 AM
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:


<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.

xxcorrosionxx
09-12-2011, 06:04 AM
You need a promotion badly! Lol!!!

xxcorrosionxx
09-12-2011, 06:08 AM
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:


<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:


<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?

BluePanther
09-12-2011, 06:25 AM
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 :p

xxcorrosionxx
09-12-2011, 06:38 AM
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 :p

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.

BluePanther
09-12-2011, 07:31 AM
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 :) .



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum