homepage Welcome to WebmasterWorld Guest from 54.166.39.179
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
PHP Sessions with select tag
trumanya



 
Msg#: 4471202 posted 8:38 am on Jun 30, 2012 (gmt 0)

i'm working on a site where there is select tag

<form name="frmSel" method="POST">
<label><strong style="color:#0084D0;font-size:15px;font- weight:bold;">Centers : </strong> </label>
<select name="centers">
<option value="">Select</option>
<option value="index-page-1">index page1</option>
<option value="index-page-2">index page2</option>
</select>
</form>

what i want is after selecting any option it should go on respective page through php sessions and respective value should be stored in that session.
there are inner pages which are same for both index pages.
but there is some data which should change after selecting any option on main index page.
i was trying to use if condition in session but it doesn't worked.

<?php
session_start();
$center=$_POST['centers'];
$flag=0;
if(session_name($center)== "index-page-1")
{
session_register('index-page-1');
}
else
{
$flag=1;
}
?>

and then in inner page(its sample)
<?
if($flag==0)
{?>
<p> some text1 </p>
<?
}
else
{?>
<p> some text2 </p>
<?}?>

plz help me!

 

coopster

WebmasterWorld Administrator coopster us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 4471202 posted 8:54 pm on Jan 20, 2013 (gmt 0)

A belated welcome to WebmasterWorld, trumanya.

Did you ever get this resolved? It's not quite clear to me what you are attempting to accomplish.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved