SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Hybrid View

  1. #1
    SitePoint Evangelist
    Join Date
    Mar 2008
    Posts
    551
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to show url in php page

    Hi all,
    If the url is mydomain.com/page.php?type=fish

    how can I output the text string "fish" in my page (it is just for some wireframing it is really basic). Thank-you

  2. #2
    . shoooo... silver trophy logic_earth's Avatar
    Join Date
    Oct 2005
    Location
    CA
    Posts
    9,013
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    print $_GET['type'];
    Logic without the fatal effects.
    All code snippets are licensed under WTFPL.


  3. #3
    SitePoint Evangelist
    Join Date
    Mar 2008
    Posts
    551
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thats cool
    How do I say
    if $_GET['type'];
    is something
    then set it to a variable? Then I will just echo the result

    Thanks Im just moving over from coldfusion to php

  4. #4
    SitePoint Enthusiast
    Join Date
    Nov 2007
    Posts
    63
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Bayliss Trevor View Post
    Thats cool
    How do I say
    if $_GET['type'];
    is something
    then set it to a variable? Then I will just echo the result

    Thanks Im just moving over from coldfusion to php
    You mean
    PHP Code:
    if ($_GET['type']=='fish')
    echo 
    'whatever'

  5. #5
    Non-Member adstiger's Avatar
    Join Date
    Nov 2008
    Location
    Canada
    Posts
    348
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    echo $_GET['type'];

    will output fish


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
  •