PDA

View Full Version : Help with new pages


GavoTrav
08-19-2011, 05:22 PM
Well I want to create a new page. I've done it many times with the extension.php

Well Now I want to it with say


index.php?do=Rules


Instead of

rules.php


I cannot think of what this is called so I cannot search for it if it was already asked :p

kh99
08-19-2011, 06:28 PM
If I understand you correctly, you want to know how to read the parameters from the url? If you write a script called index.php, then in your browser you enter "http://mydomain/dir/index.php?do=Rules", in index.php you can look at $_GET['do'] or $_REQUEST['do'] to see the value of do ($_REQUEST is a combination of form fields and url fields, but unless you're submitting a form it doesn't matter which one you look at).

The vbulletin code has a function called clean_gpc() that gets the values and makes sure they are the right type, then puts them in the $vbulletin->GPC[] array. You can look at any of the vbulletin scripts to see how that's done.

Hopefully I've tried to answer the right question.

Lynne
08-19-2011, 10:11 PM
You can see an example of vbulletin using $_REQUEST['do'] in the profile.php page and many other default vbulletin pages.