FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » radio button change after going to next page
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: radio button change after going to next page [message #174551 is a reply to message #174549] Fri, 17 June 2011 16:12 Go to previous messageGo to previous message
Co is currently offline  Co
Messages: 75
Registered: May 2011
Karma:
Member
On 17 jun, 15:32, Jerry Stuckle <jstuck...@attglobal.net> wrote:
> On 6/17/2011 9:26 AM, Co wrote:
>
>
>
>
>
>
>
>
>
>> On 17 jun, 15:02, Jerry Stuckle<jstuck...@attglobal.net>  wrote:
>>> On 6/17/2011 7:30 AM, Co wrote:>  Hi All,
>
>>>> I have a page which shows all users on our community.
>>>> We have two kinds of users Active members and Veterans.
>>>> I have a radiobutton on my page to switch from Active Members to
>>>> Veterans or vv.
>>>> However when I choose Veterans and have to click to a next page the
>>>> radiobutton gets updated again
>>>> and jumps back to Active Member, so showing the active members again
>>>> in stead of the veterans.
>
>>> <snip>
>
>>>> Regards
>>>> Marco
>
>>> As I've told you before - find out what's in your $_POST variable after
>>> you've submitted the form.
>
>>> Really - you've got to learn to do your own debugging instead of
>>> bringing every little problem here.  It doesn't look like you're even
>>> trying.
>
>> Jerry,
>
>> that's what I like about you , you're always so positive.
>> You really know how to motivate people.
>> I will try to find what is in the POST variable.
>
>> Marco
>
> Marco, what you have yet to learn is we are not your unpaid consultants.
>   We are users trying to help each other.
>
> But the key is "help each other".  That means you have to put forth a
> reasonable effort before coming here.
>
> Find out what's in your $_POST variable and use it to trace through your
> code.  That's what the rest of us would have to do.
>
> --
> ==================
> Remove the "x" from my email address
> Jerry Stuckle
> JDS Computer Training Corp.
> jstuck...@attglobal.net
> ==================

I changed my code a little and created a session.

if(isset($_POST['submit1'])) {
$_SESSION['status'] = $_POST['status'];
}
if(isset($_SESSION['status'])) {
$status_account = $_SESSION['status'];
echo $_SESSION['status'];
if($status_account=='1') {
$status_active = 'checked';
$queryString = "WHERE email_activated='1' AND active='1' AND
country='" . $_SESSION['Origin'] . "' ORDER BY id ASC"; }
else {
$status_veteran = 'checked';
$queryString = "WHERE email_activated='1' AND active='0' AND
country='" . $_SESSION['Origin'] . "' ORDER BY id ASC";
}

Now the codes first checks if the submit button was clicked.
If so the session gets a value 0 or 1.
So if I am browsing through the pages and the session is set it knows
if it should show active members of veterans.

Only thing I would like to know is how to destroy the session when you
browse away from the page.

Marco
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Displaying UTF-8-encoded strings from MySQL with PHP
Next Topic: User login status?
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Tue Nov 26 06:26:10 GMT 2024

Total time taken to generate the page: 0.04799 seconds