SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: $_GET problems

  1. #1
    SitePoint Enthusiast
    Join Date
    Oct 2004
    Location
    London
    Posts
    29
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    $_GET problems

    Hi all

    I need some help please, I am trying to pass some hidden variables from a form

    This is the browser URL --->reply_in_topic.php?f=4&t=1

    I check for empty fileds

    if (trim($form_var) == "") {
    header("Location: reply_in_topic.php?t=$_GET[t]");

    The output I get is
    reply_in_topic.php?t=

    I don't understand why the variable is not being passed?

    any idea cheers
    g

  2. #2
    SitePoint Evangelist Rodney H.'s Avatar
    Join Date
    Sep 2005
    Location
    Chicago, IL
    Posts
    479
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hmm.. Try this:



    PHP Code:
    <?php
    if (trim($form_var) == '') {
        
    header("Location: reply_in_topic.php?t=" $_GET['t']);
        exit;
    }
    ?>

  3. #3
    SitePoint Evangelist nsj's Avatar
    Join Date
    Oct 2005
    Location
    Jamaica (W.I)
    Posts
    447
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    first, what is $form_var?
    Second, $_GET[t] should be $_GET['t'];

    EDIT: oops, sorry rodney


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
  •