GIDForums  

Go Back   GIDForums > Computer Programming Forums > MySQL / PHP Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 06-Aug-2003, 06:51
zuzupus zuzupus is offline
Junior Member
 
Join Date: Jul 2003
Posts: 70
zuzupus is an unknown quantity at this point

relocation


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

PHP Code:

<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
  #2  
Old 06-Aug-2003, 07:20
JdS's Avatar
JdS JdS is offline
Senior Member
 
Join Date: Aug 2001
Location: KUL, Malaysia
Posts: 3,371
JdS will become famous soon enough
If you just use this instead; what happens?

PHP Code:

<?php
// FILENAME: diradmin.php

$dir = './';
require( $dir.'lib.php' );
get_session();
if( isset($_POST['modify']) && isset($_POST['ddir']) ) 
{
  if( !isset($_POST['user']) )
  {
    die( header('location:dirmodify.php?id='.intval($_POST['ddir'])) );
  } 
}
?>


I know you want to use your custom functions, but to troubleshoot, it's always better to write straight code in the event something doesn't seem to work...
  #3  
Old 06-Aug-2003, 07:35
zuzupus zuzupus is offline
Junior Member
 
Join Date: Jul 2003
Posts: 70
zuzupus is an unknown quantity at this point
thanks JDS,but unfortunately this code is not at all working but strnage thing when i am using old code now its working i dont whats going on,niw it works with my posted code

thanks its really appreciable
  #4  
Old 06-Aug-2003, 07:59
JdS's Avatar
JdS JdS is offline
Senior Member
 
Join Date: Aug 2001
Location: KUL, Malaysia
Posts: 3,371
JdS will become famous soon enough
Yep, I think the mistake was:

PHP Code:

<?php
  if( empty($_POST['user']) )
  {
    //...

?>


Anyway, now I am just curious; what is inside get_session();?
 
 

Recent GIDBlogNARMY by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 01:40.


vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.