SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Hybrid View

  1. #1
    SitePoint Enthusiast pea's Avatar
    Join Date
    Jul 2006
    Posts
    94
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    $_GET with unknown string

    Hello. How would you get a variable from a url using $_GET. umm.. for example:

    http://www.sitepoint.com/forums/newt...newthread&f=34 ... 34 could be anything, so i couldn't just do $number = 34, i'd have to do something like $number = <name of submision>.

    Sorry i explained that badly....

    my code:

    for each line of a file it had this form:
    PHP Code:
    <form action='' method='post'><input name='' type='submit' value='X'>
    <
    input name='' type='hidden' value='$line_num'></form
    When i come to the delete line function, on this line:
    PHP Code:
    unset($file[$_GET['???']]); 
    ..yeh. Thanks. Pete

  2. #2
    SitePoint Wizard silver trophy Jelena's Avatar
    Join Date
    Feb 2005
    Location
    Universum, 3rd Corner
    Posts
    3,001
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    You are using POST method in a form, and you also haven't set up name for input field.
    PHP Code:
    <form action='' method='post'><input name='' type='submit' value='X'>
    <
    input name='line' type='hidden' value='$line_num'></form
    PHP Code:
    $line $_POST["line"]; 
    -- Jelena --

  3. #3
    SitePoint Enthusiast pea's Avatar
    Join Date
    Jul 2006
    Posts
    94
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    oOOOOOOOOOoooooooooo! now i get 'method='get''..Thanks


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
  •