Help With Php

zoobyzooby Join Date: 2003-08-26 Member: 20236Members
<div class="IPBDescription">I'm such a noob...</div> I'm making my own site and I was wondering if anyone here knows a good tutorial for php using the GET method, preferably one that shows how the URL above is decoded or whatever into doing what it is I want it to do, and how to generate such URLs (with the ?f=10 type deal) I haven't a clue how it works, and as I searched for it I haven't been able to find much of anything useful.

Thanks!!

Comments

  • SycophantSycophant Join Date: 2002-11-05 Member: 7092Members
    edited March 2004
    Here's a quick tutorial, no filler or bs ......

    Let's just make up a URL : "www.somesite.com?one=sycophant&two=zooby".
    In this case, the tags are obviously named "one" and "two".

    How access the info:
    $_GET['one']
    $_GET['two']

    You can use 'em just like any other variable. For example:
    your code ..... <? print "First tag is ". $_GET['one'] .", and the second tag is ". $_GET['two']; ?>
    output .......... "First tag is sycophant, and the second tag is zooby"

    Hope this helps. <!--emo&:)--><img src='http://www.unknownworlds.com/forums/html//emoticons/smile.gif' border='0' style='vertical-align:middle' alt='smile.gif' /><!--endemo-->
  • zoobyzooby Join Date: 2003-08-26 Member: 20236Members
    edited March 2004
    Cool thanks that definitely helps a bit.

    I've seen sites where clicking a link will result in get variable. I was also wondering how to do this. (If it's possible. If it isn't, I must be on drugs or something)

    [edit]Wait never mind that was a stupid question[/edit]
  • SycophantSycophant Join Date: 2002-11-05 Member: 7092Members
    Yep, this is even easier - just write out the full URL in your code. It'll work fine.

    For example, let's say we're on some page which has a link to "second.php" and you want to have a few tags set in the url. When you do up your link to the second page, just code them in.

    <!--c1--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td><b>CODE</b> </td></tr><tr><td id='CODE'><!--ec1--><a href="second.php?one=info&two=blah">click here for second page</a><!--c2--></td></tr></table><div class='postcolor'><!--ec2-->
  • Speed_2_DaveSpeed_2_Dave Join Date: 2002-11-15 Member: 8788Members
    edited March 2004
    [edit] I'm a php newb, forget about it.
Sign In or Register to comment.