What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » PHP Question

PHP Question
Author: Message:
Eddie
Veteran Member
*****


Posts: 2078
Reputation: 30
32 / Male / Flag
Joined: Oct 2005
Status: Away
O.P. RE: PHP Question
quote:
Originally posted by methos
That's done something called the "get" function...

In php, you have assign variables to the end of the url and then call them back using the GET function, so to create an easy include function, you would have your links changing that variable, and a block of code to check what that variable is, so for example, if we had the variable "page" and the includes 1.php and 2.php and the variables for those pages being "one" and "two" respectively, we would have the big block of code to check what the variable is:

php code:
$page = (isset($_GET['page'])) ? $_GET['page'] : "";
   
if($page=="" or $page=="one"){
    include("1.php");
}
elseif($page=="two"){
    include("2.php");
}

This uses the GET function and sets the variable $page to the value that has been set in the URL (for example www.bbq.com?page=one would mean the variable page is set to one), then checks what the variable is, and if the variable is one or not set then it includes 1.php and if the variable is two it includes 2.php.

To change this variable (ie, when you click a link) you use the following code:

php code:
<a href="?page=two">goto page 2</a>

This is a self-explanatory line of code.

This method can also be used to string variables and can be incredibly useful. To string variables, you just set the variables in the same way. If you need any more help feel free to post :)
That method is relatively similair to what i've used before, but before, all you had to do was list the different page names, link to the directory the files were in and it would then present them files in a similair fashion to how you did it, hope you understand.
...there used to be a signature here :)
03-31-2009 04:28 PM
Profile PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
PHP Question - by Eddie on 03-31-2009 at 02:29 PM
RE: PHP Question - by matty on 03-31-2009 at 03:42 PM
RE: PHP Question - by stoshrocket on 03-31-2009 at 03:48 PM
RE: PHP Question - by Eddie on 03-31-2009 at 04:28 PM
RE: PHP Question - by MeEtc on 03-31-2009 at 04:43 PM
RE: PHP Question - by Eddie on 03-31-2009 at 04:49 PM
RE: PHP Question - by stoshrocket on 03-31-2009 at 05:07 PM
RE: PHP Question - by Eddie on 03-31-2009 at 05:16 PM
RE: PHP Question - by stoshrocket on 03-31-2009 at 05:30 PM
RE: PHP Question - by Eddie on 03-31-2009 at 05:47 PM
RE: PHP Question - by stoshrocket on 03-31-2009 at 05:49 PM
RE: PHP Question - by davidpolitis on 04-02-2009 at 07:43 AM
RE: PHP Question - by Eddie on 04-02-2009 at 08:33 AM
RE: RE: PHP Question - by davidpolitis on 04-02-2009 at 12:52 PM
RE: PHP Question - by stoshrocket on 04-02-2009 at 12:10 PM
RE: PHP Question - by segosa on 04-02-2009 at 10:05 PM
RE: RE: PHP Question - by davidpolitis on 04-03-2009 at 06:49 AM
RE: RE: RE: PHP Question - by segosa on 04-03-2009 at 08:09 AM
RE: PHP Question - by stoshrocket on 04-02-2009 at 11:23 PM
RE: PHP Question - by Eddie on 04-03-2009 at 06:50 AM
RE: RE: PHP Question - by davidpolitis on 04-03-2009 at 06:55 AM
RE: PHP Question - by NanaFreak on 04-03-2009 at 06:54 AM
RE: PHP Question - by NanaFreak on 04-03-2009 at 07:06 AM
RE: RE: PHP Question - by davidpolitis on 04-03-2009 at 07:16 AM
RE: PHP Question - by Felu on 04-03-2009 at 09:37 AM
RE: RE: PHP Question - by davidpolitis on 04-03-2009 at 10:15 AM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On