GFXVoid Graphic Design Forum

Remove Text Formatting
Loading...

» Online Users: 18,545

0 members and 18,545 guests
No Members online

» Site Navigation

 > FAQ

» Stats

Members: 35,442
Threads: 103,075
Posts: 826,688
Top Poster: cc.RadillacVIII (7,429)
Welcome to our newest member, Lekelindids
Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2006
    Posts
    264

    Default How to use "fancy" links, like website.com/?&categorie=othershit :P

    ok, lot of ppl just want to use PHP to get this fancy links. so ppl think they are great programmers. is not bad tho :P

    i'll show u how in 5 mins using switch function.

    its really, pretty easy.
    and you will also learn how to arrange your files

    ok, its pretty easy. im not good make tuts btw :P


    we're gonna creat a file called index.php. this is our main file. and will have something like this:

    Code:
    <html></html>
    <head>
    <title>TITLE OF THE WEBSITE</title>
    </head>
    <body>
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td>
        <!-- this is the banner row -->
        HERE WE HAVE THE BANNER OF THE SITE!!!</td>
      </tr>
      <tr>
        <td>
    <!-- this is the content row -->
        <?
    //here is where the switch part starts
    switch ($categorie) //the var $categorie can be whatever you want. and is going to be this part of the URL: index.php?&categorie
    {
    case "content1"://in the URL: =content1
        include("content1.htm");
    break;
    case "links":
        include("content2.htm");//in the URL: =content2
    break;
        default: //in case that the URL doesnt have anything (index.php) is going use home.htm
            include("home.htm");
    }
    //here is where the switch part ends
    ?>   </td>
      </tr>
      <tr>
        <td><!-- this is the bottom row -->
        HERE WE CAN PUT THE COPYRIGHT AND STUFF
        </td>
      </tr>
    </table>
               
    
    </body>
    </html>
    ok here is the funny part.
    when you type the URL index.php?&categorie=content1 you are telling the script to use the var CATEGORIE and the instruction under the name CONTENT1. this instruction is going to display the information inside content1.htm the top row and the borrom row are going to be the same.

    WTF? well lets see what does home.htm & content1.htm has:

    HOME.HTM
    Code:
        <td>
          <p>this is the home page<br />
        here you may have the news and stuff</p>
    </td>
    CONTENT1.HTM
    Code:
        <td>
          <p>this is the content1 page<br />
        this is just going 
        to have whatever you want :P lol</p>
        <p>&nbsp;</p>
        <p>blah blah blah </p></td>

  2. #2
    Join Date
    Jun 2006
    Posts
    264

    Default

    somehow this shit doesnt make me put more lines... well this is part 2 :P

    if you clikc on the link www.yoursite.com/index.php?&categorie=content1
    your going to get:
    Code:
    HERE WE HAVE THE BANNER OF THE SITE!!!
    
    this is the content1 page
    this is just going to have whatever you want :P lol
    
    blah blah blah
    
    HERE WE CAN PUT THE COPYRIGHT AND STUFF
    if you type the link www.yoursite.com/index.php

    you are going to get what is in the home.htm:

    Code:
    HERE WE HAVE THE BANNER OF THE SITE!!!
    
    this is the home page
    here you may have the news and stuff
    HERE WE CAN PUT THE COPYRIGHT AND STUFF

  3. #3
    Join Date
    Jul 2005
    Posts
    5

    Default

    they ain't fancy links they can be script manipulators or script injectors very bad for security

    if your going to use them just use them for IDs like user.php?id=1 etc

    using more than 1 can void XHTML validation as they don't class the "&" symbol in a url link as a valid link

    switch in C++ is a int based functioni advise people use if and and array in C++ instead of using a switch function which is a lightweight way of doing it example:

    PHP Code:
    <?
    $user = $_GET['user'];
    $array_users = array(
      1 => "tim", 
      2 => "joe", 
      3 => "jay"
    );

    for($i=1;$i<=4;$i++){
     echo "<a href=\"?user=".$i."\">User ".$i."</a> <br />";
    }
    if($user){
     if($array_users[$user]){
      echo $array_users[$user];
     }else{
      echo "User not found";
     }
    }
    ?>
    Live Example: http://dev.n3tw0rk.co.uk/user_id.php

    this way can be implimated in other variations of IDs like database calling using the value to be called in the WHERE part of the query after varibale validation through eregi and such

  4. #4

    Default

    *Karlos Sighs*

    I'm a PHP coder and yes my first option would be the arrays...However * switch ($categorie) * can be secured if you know how to...Try looking it up

Similar Threads

  1. "George Bush doesn't care about Black People."
    By Shamino in forum The Void
    Replies: 13
    Last Post: 12-19-2008, 07:50 PM
  2. Newest "Solid Snake" Sig
    By RinoaLockhart in forum Sigs & Manips
    Replies: 9
    Last Post: 06-25-2006, 07:01 PM
  3. "Youve just been kicked in the nuts!"
    By AgainstAllOdds in forum The Void
    Replies: 11
    Last Post: 08-04-2005, 06:23 AM
  4. Have you guys heard about "Advent Rising"?
    By Nightfire in forum The Void
    Replies: 3
    Last Post: 06-30-2005, 09:44 AM
  5. <("<)<(")>(>")>Cubez<("<)<(")>(>")>
    By Morphius in forum Digital Art
    Replies: 18
    Last Post: 04-29-2005, 07:13 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Powered by vBadvanced CMPS v4.1.1