ljzxtww Posted February 29, 2008 Share Posted February 29, 2008 Hi guy: I need the link look like this HI can you help me lilttle bit more please http://domainname/reseller/mega.php I want to be this link: http://domainname/?x=reseller&?&plan=mega please somebody help me larry pappas Link to comment https://forums.phpfreaks.com/topic/93618-_get-and-directedhelp-please/ Share on other sites More sharing options...
hawkenterprises Posted February 29, 2008 Share Posted February 29, 2008 You will need to create a index.php that can handle the variable you are using. Link to comment https://forums.phpfreaks.com/topic/93618-_get-and-directedhelp-please/#findComment-479731 Share on other sites More sharing options...
unsider Posted February 29, 2008 Share Posted February 29, 2008 Neither are loading for me. Safari OS X, sorry i can't help. Link to comment https://forums.phpfreaks.com/topic/93618-_get-and-directedhelp-please/#findComment-479733 Share on other sites More sharing options...
voyde Posted February 29, 2008 Share Posted February 29, 2008 Your index page needs to be something along the lines of.... <? // MAIN PAGE // Put the pages into variables $x = $_GET[x]; $plan = $_GET[plan]; if ($x=="reseller")) { if (empty($plan)) { include ".some/reseller/page.php"; } elseif ($plan=="mega") { include "./some/page/to/mega.php"; } elseif ($plan=="super") { include "./some/page/to/super.php"; } } else { include "./path/to/homepage.php"; } ?> Like I said SOMEthing like that Link to comment https://forums.phpfreaks.com/topic/93618-_get-and-directedhelp-please/#findComment-479761 Share on other sites More sharing options...
ljzxtww Posted February 29, 2008 Author Share Posted February 29, 2008 You will need to create a index.php that can handle the variable you are using. <?php $files = array( "home" => "index.php", "about" => "about.php", "services" => "simplyrem/services.php" ); if($_GET['page'] == ""){ } if(isset($_GET['page']) && isset($files[$_GET['page']])){ include($files[$_GET['page']]); } else { require("simplyrem/index.php"); require_once("libs.inc.php"); } ?> this is my code in index.php I want the link like this one http://domainname/reseller/mega.php I want to be this link: http://domainname/?x=reseller&?&plan=mega but voyde give me the code was wrong I get it Link to comment https://forums.phpfreaks.com/topic/93618-_get-and-directedhelp-please/#findComment-480077 Share on other sites More sharing options...
ljzxtww Posted February 29, 2008 Author Share Posted February 29, 2008 help me with this Link to comment https://forums.phpfreaks.com/topic/93618-_get-and-directedhelp-please/#findComment-480263 Share on other sites More sharing options...
conker87 Posted February 29, 2008 Share Posted February 29, 2008 <?php if (isset($_GET['x'], $_GET['plan']) && file_exists($_GET['x'] . "/" . $_GET['plan'] . ".php")) { include($_GET['x'] . "/" . $_GET['plan'] . ".php"); } else { // do something else. } This will make it so that if you put in say: /?x=first&plan=second you will include the file path /first/second.php Neither are loading for me. Safari OS X, sorry i can't help. Well duh, they point to nothing. Link to comment https://forums.phpfreaks.com/topic/93618-_get-and-directedhelp-please/#findComment-480277 Share on other sites More sharing options...
ljzxtww Posted February 29, 2008 Author Share Posted February 29, 2008 <?php $files = array( "home" => "index.php", "about" => "about.php", "services" => "simplyrem/services.php" ); if($_GET['page'] == ""){ } if (isset($_GET['x'] , $_GET['plan']) && file_exists($_GET['x'] . "/" . $_GET['plan'] . ".php")) { include($_GET['news'] , $_GET['plan'] . "mega.php"); } else // do something else. } if(isset($_GET['page']) && isset($files[$_GET['page']])){ include($files[$_GET['page']]); } else { require("simplyrem/index.php"); require_once("libs.inc.php"); include("reseller/mega.php"); } ?> should I put like this: I didnt understand your question righ here: "This will make it so that if you put in say: /?x=first&plan=second you will include the file path /first/second.php" please tell me again thank you larry Link to comment https://forums.phpfreaks.com/topic/93618-_get-and-directedhelp-please/#findComment-480398 Share on other sites More sharing options...
ljzxtww Posted February 29, 2008 Author Share Posted February 29, 2008 <?php if (isset($_GET['x'], $_GET['plan']) && file_exists($_GET['x'] . "/" . $_GET['plan'] . ".php")) { include($_GET['x'] . "/" . $_GET['plan'] . ".php"); } else { // do something else. } This will make it so that if you put in say: /?x=first&plan=second you will include the file path /first/second.php Neither are loading for me. solve the problem thanks a lots if I have problem I tell you thank you larry pappas Safari OS X, sorry i can't help. Well duh, they point to nothing. Link to comment https://forums.phpfreaks.com/topic/93618-_get-and-directedhelp-please/#findComment-480417 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.