SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast
    Join Date
    Apr 2003
    Location
    In Cyber Space!
    Posts
    33
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Someone look at this I'm not sure what to do!

    I am passing 4 variables from a drop down search box into this. Basiclly if $name is set then I want it to out the code for that search. If $category is set then I want the code to be displayed for that ... same for $topic and $fee. I don't get any errors, but it doesn't work. What am I doing wrong?

    PHP Code:
    <?PHP
    $subtitle 
    ' :: Speakers';
    include(
    "includes/vars.php");
    include(
    "includes/header.php");
    ?>

    <?PHP
    if (isset($name)) {
    print 
    "<td width='366' height='159' rowspan='2' align='left' valign='top' background='images/nav/textbg.jpg' id='norm_padding'>";
    print 
    "<div id='text'><?PHP include('includes/text/speakers/index'.$name.'.txt'); ?></div></td>";
    print 
    "<td width='345' rowspan='3' align='left' valign='top' bgcolor='#FFFFFF' id='norm_padding'>";
    print 
    "<div id='text'>&nbsp;</div></td>";
    print 
    "<td width='14' rowspan='3' bgcolor='#75818C'>&nbsp;</td>";
    print 
    "</tr>";
    print 
    "<tr>";    
        
    }elseif(isset(
    $category)) {
    print 
    "category!";

    }elseif(isset(
    $topic)) {
    print 
    "topic!";

    }else{
    print 
    "fee range!";
    }
    ?>

    <?PHP
    include("includes/footer.php");
    ?>

  2. #2
    SitePoint Zealot
    Join Date
    Jun 2003
    Location
    Middle / East TN
    Posts
    127
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You might want to try $_GET['name'] or $_POST['name'] depending on how your form variables are sent. Post is usually for a form, get for url. To check you can always:
    print_r($_POST);
    There are 10 kinds of people in this world,
    those who can read binary and those who can't.

  3. #3
    public static void brain Gybbyl's Avatar
    Join Date
    Jun 2002
    Location
    Montana, USA
    Posts
    647
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You should also check whether you have register_globals turned on -- That can cause some *weird* stuff to happen (well, it's not really weird, but it's like a curveball (you would never expect it)).

    If you've got it turned off, then you know that you need to follow Bonk's advice and access it using the superglobal arrays. If you've got it turned off, then there is no possible way your code can work, unless you are running extract() somewhere before what you've pasted.
    Ryan


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •