pnerd Posted May 10, 2007 Share Posted May 10, 2007 Hi guys. Im new here so i got much to learn. Currently the sites that i make are in this format e.g. http://localhost/phpscript/test.php. I noticed some sites have it in this format e.g. http://down.com/up/index.php?p=cs. How do they get the format of "index.php?p=cs" and what does it mean? Thanks. Link to comment https://forums.phpfreaks.com/topic/50772-page-linking/ Share on other sites More sharing options...
mmarif4u Posted May 10, 2007 Share Posted May 10, 2007 This is said to be passing data through urls and u will get the data in te nest page. URL: index.php?name=$name So in the next page u will get it like: $name=$_GET['name'] Link to comment https://forums.phpfreaks.com/topic/50772-page-linking/#findComment-249630 Share on other sites More sharing options...
flappy_warbucks Posted May 10, 2007 Share Posted May 10, 2007 well the index.php is the actual page containing the script everything after the "?" is a passed variable from looking at that the page can decide what to do so for example: if (isset($_GET['p'])) { do this } else { or do this; } typically its to point the page in the right direction depending on what information is passed Link to comment https://forums.phpfreaks.com/topic/50772-page-linking/#findComment-249631 Share on other sites More sharing options...
igor berger Posted May 10, 2007 Share Posted May 10, 2007 inde.php is a file name ? this means a query idname is a variable idname=value is the value that you are passing to the page you are calling. & seperates the variables. so index.php?idname1=hello&idname2=thanx etc... On the page recieving the variables you will set up your PHP to be <php $idname1=$_GET["idname1"]; $idname2=$_GET["idname2"]; echo $idname1; echo "<br>"; echo $idname2; ?> Try it out. Link to comment https://forums.phpfreaks.com/topic/50772-page-linking/#findComment-249633 Share on other sites More sharing options...
pnerd Posted May 10, 2007 Author Share Posted May 10, 2007 Thanks for the enlightenment. However, is there really a big difference between the 2 codes? If so which would be easier in terms of coding for a beginner. Link to comment https://forums.phpfreaks.com/topic/50772-page-linking/#findComment-249644 Share on other sites More sharing options...
flappy_warbucks Posted May 10, 2007 Share Posted May 10, 2007 Thanks for the enlightenment. However, is there really a big difference between the 2 codes? If so which would be easier in terms of coding for a beginner. it depends on what you want to do and what needs to be passed... Link to comment https://forums.phpfreaks.com/topic/50772-page-linking/#findComment-249648 Share on other sites More sharing options...
igor berger Posted May 10, 2007 Share Posted May 10, 2007 Do a test page and see, how it works! Link to comment https://forums.phpfreaks.com/topic/50772-page-linking/#findComment-249650 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.