Page 1 of 1

relocation

Posted: Wed Aug 06, 2003 7:54 am
by zuzupus
hi,

i created one radio button and one user select so that when user selects radio whose values coming from database after that if he submit the page withoust selecting user it will locate to diff. page, but i dont no its not working in my case

Code: Select all

<form action="diradmin.php" method="post">   
<? foreach($tree as $r) { ?>
<input type="radio" name="ddir" value="<?=$r->sys_pk ?>" id="<?="dir{$r->sys_pk}" ?>" />
<? } ?>
user
<select name="user">
<option selected="selected">** Please select**</option>
                     <? foreach($users as $r) { ?>
 <option value="<?=$r->sys_pk ?>"><?=htmlentities($r->name) ?></option>
                                                             <? } ?>
 </select>
<input type="submit" name="modify" value="Modify" />

there  is one lib php file in which all functions r defined

diradmin.php
<? $dir = './'; require($dir.'lib.php'); get_session(); ?>
if ($modify && $ddir) 
{
	if (!$user) {
                 	send_location_die('dirmodify.php?id='.$ddir);
                    } 
}

in lib.php
function send_location_die($location) 
{
	send_location($location);
	die();
}
function send_location($location) 
{
		expire_header();
		header("Location: ".$location);
		flush();
}
but when user selects radio and not selecting any user after that form submission its not locationg to dirmodify.php,i will go amd its so easy i dont no why its not submitting to this page

thanks in advance

Posted: Wed Aug 06, 2003 8:16 am
by patrikG

Code: Select all

function send_location($location)
{
      expire_header(); // unless you've programmed and included a function like this, it doesn't exist. Just delete this line.
      header("Location: ".$location);
      flush();
}

Posted: Wed Aug 06, 2003 8:54 am
by zuzupus
[thanks alot