zgkhoo Posted October 12, 2007 Share Posted October 12, 2007 any tutorial for these php url/link technique in the internet? wat those technique called? php link /url system technique or? http://www.phpfreaks.com/forums/index.php?action=search http://chinese2.cari.com.my/myforum/viewsub.php?gid=184 http://www.talkphp.com/showthread.php?p=1804#post1804 <?php header("Location: http://www.domain.com/users/".$session->username."/index.php"); ?> which the red syntax i not very understand and hope to find the tutorial abt these. thanks... Quote Link to comment https://forums.phpfreaks.com/topic/72925-any-tutorial-for-these-php-urllink-technique/ Share on other sites More sharing options...
Aureole Posted October 12, 2007 Share Posted October 12, 2007 One second I'll get you a link I made a little tutorial on this the other day... Quote Link to comment https://forums.phpfreaks.com/topic/72925-any-tutorial-for-these-php-urllink-technique/#findComment-367757 Share on other sites More sharing options...
zgkhoo Posted October 12, 2007 Author Share Posted October 12, 2007 thats tutorial is for me but /".$session->username."/index.php" wat this meant? do u have a complete and detail tutorial for it? wat is this type of technique called? i need the technique name for easier research in google. thanks... Quote Link to comment https://forums.phpfreaks.com/topic/72925-any-tutorial-for-these-php-urllink-technique/#findComment-367758 Share on other sites More sharing options...
Aureole Posted October 12, 2007 Share Posted October 12, 2007 I have never seen that technique before but $session->username is an OOP thing, so wherever you saw that - they have a class for their session. Quote Link to comment https://forums.phpfreaks.com/topic/72925-any-tutorial-for-these-php-urllink-technique/#findComment-367762 Share on other sites More sharing options...
zgkhoo Posted October 12, 2007 Author Share Posted October 12, 2007 http://www.phpfreaks.com/forums/index.php?action=search http://chinese2.cari.com.my/myforum/viewsub.php?gid=184 http://www.talkphp.com/showthread.php?p=1804#post1804 then the above language called wat? php also oop language? thanks.. Quote Link to comment https://forums.phpfreaks.com/topic/72925-any-tutorial-for-these-php-urllink-technique/#findComment-367772 Share on other sites More sharing options...
Aureole Posted October 12, 2007 Share Posted October 12, 2007 Say if you had index.php and wanted to have ?action=search then you could do something like... <?php switch($_GET['action']) { case 'search'; search_page(); break; case 'about'; about_page(); break; } function search_page { echo('You are on the search page.'); } function about_page { echo('You are on the about page.'); } ?> You could also do something like this... <?php switch($_GET['action']) { case 'search'; include('includes/search.php'); break; case 'about'; include('includes/about.php'); break; } ?> I believe the technique is called query-stringing or something... OOP is Object Oriented Programming, stay away from it until you know all the basics... Quote Link to comment https://forums.phpfreaks.com/topic/72925-any-tutorial-for-these-php-urllink-technique/#findComment-367774 Share on other sites More sharing options...
zgkhoo Posted October 12, 2007 Author Share Posted October 12, 2007 y GET n REQUEST always involve in this query string? GET n REQUEST not only use in form? thanks. Quote Link to comment https://forums.phpfreaks.com/topic/72925-any-tutorial-for-these-php-urllink-technique/#findComment-367783 Share on other sites More sharing options...
Aureole Posted October 12, 2007 Share Posted October 12, 2007 I don't know anything about the request super global but no it's not just for forms you can use it for other things too, whatever you want really. Quote Link to comment https://forums.phpfreaks.com/topic/72925-any-tutorial-for-these-php-urllink-technique/#findComment-367789 Share on other sites More sharing options...
Cagecrawler Posted October 12, 2007 Share Posted October 12, 2007 The $_GET superglobal is used to pass variables across pages using the url. For example, if you had "index.php?foo=bar", then you could access that as "$_GET['foo'] = bar". $_POST is the superglobal mainly used for forms and $_REQUEST is sort of in between. I've never needed to use $_REQUEST. Quote Link to comment https://forums.phpfreaks.com/topic/72925-any-tutorial-for-these-php-urllink-technique/#findComment-367794 Share on other sites More sharing options...
zgkhoo Posted October 13, 2007 Author Share Posted October 13, 2007 The $_GET superglobal is used to pass variables across pages using the url. For example, if you had "index.php?foo=bar", then you could access that as "$_GET['foo'] = bar". $_POST is the superglobal mainly used for forms and $_REQUEST is sort of in between. I've never needed to use $_REQUEST. this technique called? thanks.. Quote Link to comment https://forums.phpfreaks.com/topic/72925-any-tutorial-for-these-php-urllink-technique/#findComment-368484 Share on other sites More sharing options...
Aureole Posted October 13, 2007 Share Posted October 13, 2007 As I have already said I believe it is called query-stringing but I really don't know, why does it matter what the technique is called so bad anyway? Quote Link to comment https://forums.phpfreaks.com/topic/72925-any-tutorial-for-these-php-urllink-technique/#findComment-368753 Share on other sites More sharing options...
kratsg Posted October 13, 2007 Share Posted October 13, 2007 This is data passing via URL. It uses two methods, the $_GET method and the $_REQUEST method. ($_REQUEST is very unstable, do not even use this). http://www.phpfreaks.com/forums/index.php?action=search http://chinese2.cari.com.my/myforum/viewsub.php?gid=184 http://www.talkphp.com/showthread.php?p=1804#post1804 <?php header("Location: http://www.domain.com/users/".$session->username."/index.php"); ?> The first url: $action = $_GET['action']; //this will set $action to be "search" The second url: $gid = $_GET['gid']; //this will set $gid to be "184" The third url is a header-redirect. Basically, you are right that it is OOP. They said something like: $session = new Class(); In their "Class" is a variable called $username, they can call the variable within the class by saying $session->username The code above basically tells the browser to get the person's username from a session variable (using the Class(); to validate it) and redirect them to $username/index.php $_GET and $_POST are used to get data that was passed via forms. Quote Link to comment https://forums.phpfreaks.com/topic/72925-any-tutorial-for-these-php-urllink-technique/#findComment-368763 Share on other sites More sharing options...
Cagecrawler Posted October 14, 2007 Share Posted October 14, 2007 You can read about superglobals here: http://uk3.php.net/manual/en/language.variables.predefined.php http://uk3.php.net/manual/en/reserved.variables.php Quote Link to comment https://forums.phpfreaks.com/topic/72925-any-tutorial-for-these-php-urllink-technique/#findComment-368954 Share on other sites More sharing options...
corbin Posted October 14, 2007 Share Posted October 14, 2007 More links of potential interest: All of these look like they explain it fairly decently: http://www.w3schools.com/php/php_get.asp http://www.w3schools.com/php/php_post.asp http://www.tizag.com/phpT/postget.php Bleh... this one looks halfway decent too: http://www.freewebmasterhelp.com/tutorials/php/6 Quote Link to comment https://forums.phpfreaks.com/topic/72925-any-tutorial-for-these-php-urllink-technique/#findComment-368989 Share on other sites More sharing options...
marcus Posted October 14, 2007 Share Posted October 14, 2007 www.phpvideotutorials.com the fun way Quote Link to comment https://forums.phpfreaks.com/topic/72925-any-tutorial-for-these-php-urllink-technique/#findComment-368992 Share on other sites More sharing options...
zgkhoo Posted October 16, 2007 Author Share Posted October 16, 2007 cool..thanks again n again.. Quote Link to comment https://forums.phpfreaks.com/topic/72925-any-tutorial-for-these-php-urllink-technique/#findComment-370426 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.