REAL [Beginner] Using GET method menu

Shout-Out

User Tag List

Results 1 to 7 of 7
  1. #1
    Spatz21's Avatar Active Member CoreCoins Purchaser
    Reputation
    15
    Join Date
    Nov 2007
    Posts
    208
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    REAL [Beginner] Using GET method

    I did look at that other post and there were a few questions unanswered and answers that were rubbish.


    The

    $_Get is useful for passing data from one page to another in the URL bar. It means that you do not need a form. I myself use the GET when making pages display certain info.

    Originally Posted by warsheep View Post
    Its an good tutorial, BUT,
    how do people create index.php?thinghere ?

    But, the tutorial itself is good!


    I will have a hyperlink.

    <a herf=www.mmowned.com/Index.php?step=exploits>Exploits Section</a>

    The next page you go onto ...


    <?php
    //This is used when clicking a hyperlink to display certain pieces of data

    if $_GET['step'] == exploits {

    will display some crap

    }

    ?>





    If you want to put a variable at the end. Lets say you are listing a database of people and when you click on someones name it sends you to their profile with some data on it ...


    <a href=profiles.com/profile.php?profileID=$Users_ID>$Users_Name's Profile</a>

    If you are listing everyones names from the database onto a page you would make an SQL query that loops and each time selects one person, pulls out their ID and Name then puts it into the hyperlink as above.

    So lets say I am ID 1 in database ... the URL will end up
    profiles.com/profile.php?profileID=1


    Now you use the $_GET to list the users profile.

    <?php

    User_ID=$_GET['profileID'];

    //Sql query which calls all the data for that User_ID here

    $User_Name
    $User_Address
    $User etc ...

    ?>


    When I first started PHP coding I didn't know any of this. My first project I made a browser based game. For it I made it display all the names of the signed up people and allowed them to make their one profiles. When I first thought about it, I thought "WOW so I am going to have to make a new page for each users profile? :s". Then I realise I could use the GET to call an ID, which I could use to call certain pieces of data from the database. Meaning I only had 1 page.

    I felt like a fool when I worked this out but its easy stuff.

    If you are using data like Username/Passwordy type of things you dont really want it coming up in the URL. Use $_POST for those situations


    If you have any questions post below. It is like 3:30AM here so I am very tierd and may of not expliained it properly, or used wrong grammar and confuzed the hell out of you.

    REAL [Beginner] Using GET method
  2. #2
    tttommeke's Avatar Banned
    Reputation
    1
    Join Date
    Jul 2007
    Posts
    613
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    <?php
    //This is used when clicking a hyperlink to display certain pieces of data

    if $_GET['step'] == exploits {

    will display some crap

    }

    ?>

    Yhea...

    <?php
    //This is used when clicking a hyperlink to display certain pieces of data

    if $_GET['step'] == "exploits" {

    Code to execute

    }

    ?>

    you forgot the " "

  3. #3
    Spatz21's Avatar Active Member CoreCoins Purchaser
    Reputation
    15
    Join Date
    Nov 2007
    Posts
    208
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No I didnt It work work both ways
    6 rep to -1
    Matt linking post in sbawx.. could've been -25 rep, read the rules

  4. #4
    warsheep's Avatar Contributor
    Reputation
    184
    Join Date
    Sep 2006
    Posts
    1,216
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks, it might have some flaws, but I learned what I needed.
    FOR A MOMENT, NOTHING HAPPENED. THEN, AFTER A SECOND OR SO, NOTHING CONTINUED TO HAPPEN.

  5. #5
    Dreadvizzle's Avatar Active Member
    Reputation
    22
    Join Date
    Dec 2006
    Posts
    84
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    the normal way to do this would be



    <?php

    if $_REQUEST['step'] == exploits {

    will display some crap

    }
    Last edited by Dreadvizzle; 05-04-2008 at 08:24 PM.
    My staff is a good one!
    -Kralnor


  6. #6
    Lucani's Avatar Member
    Reputation
    1
    Join Date
    May 2008
    Posts
    15
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    if i want use POST method i can write it in similar way or i have to change something in form ?

  7. #7
    Sonic Waffle's Avatar Contributor
    Reputation
    170
    Join Date
    Dec 2007
    Posts
    990
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    <?php
    if $_REQUEST['forum'] == "5" {
    header('location:http://www.mmowned.com/forums/exploits')
    }

    Out come: http://www.mmowned.com/index.php?forum=5 -> http://www.mmowned.com/forums/exploits

    That's what you really want if you are going to redirect to a different page.



Similar Threads

  1. Replies: 3
    Last Post: 09-19-2009, 10:53 AM
  2. Wow Radar - Using TLS method
    By unknwon in forum WoW Memory Editing
    Replies: 35
    Last Post: 08-20-2008, 03:38 AM
  3. [Beginner] Using GET method
    By Le Froid in forum Programming
    Replies: 4
    Last Post: 03-15-2008, 07:25 AM
  4. REAL way to get kegs faster
    By yaafl in forum World of Warcraft Exploits
    Replies: 27
    Last Post: 10-09-2007, 08:38 AM
All times are GMT -5. The time now is 01:37 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search