- This topic is empty.
-
AuthorPosts
-
March 10, 2014 at 5:39 am #165272geloboyetParticipant
So its all said in the title. REPLY asap. Thanks
March 12, 2014 at 9:56 am #165544dragon10yParticipantDo this :
<?php // The url var is named $url here change it if needed. // Change the GET var to your needs to. $url = isset($_GET['url']) ? $_GET['url'] : null; $url = rtrim($url, '/'); $url = filter_var($url, FILTER_SANITIZE_URL); $new_url = explode('/', $url); ?>
That should take care of the problem.
March 12, 2014 at 6:36 pm #165602__ParticipantThat should take care of the problem.
How do you figure? The user gives us no clue whatsoever as to why their script is crashing. How can you be sure this will solve it? How do you know that this code will even run—what if it’s a parse error?
@geloboyet, no, it’s not “all said in the title.” If you need further help, you need to explain your problem more clearly. Showing the relevant code will surely be helpful as well.March 20, 2014 at 11:41 am #166395BionicClickParticipantI agree, without more info… removing the forward slash only make sense.. as the OP states without it its ok… pretty straightforward…
+1 for shaneisme for helping.
<hr />
explination to the OP:
if you have a URL of say, http://example.com it visits the default page in the main folder.
if you have a URL of say, http://example.com/ it STILL visits the default page in the main folder.
if you have a URL of say, http://example.com/folder1/ it visits the default page in the folder named “folder1” folder. if there is not a default file in folder “folder1” then your going to get a black white page or error message.
visiting http://example.com/folder1/ is like visiting http://example.com/folder1/index.html
personally on my web servers the default web page is index.php, and falls back to index.html. meaning that IF I visit http://example.com/folder1/ and inside “folder1” there is a file named “index.php” on my server I see that page… if the index.php file is missing but there is a index.html file I see that instead.. but if both are missing, I get a blank white page, or an error… such as “cannot be found” or something.
<hr />
caveat
IF your site fails at the following examples you have larger issues. or no default webpage file in the folder where the URL points.
http://example.com/
http://example.com/index.html/
http://example.com/myFolderName/index.html/examples that should always fail
http://example.com/myFolderName (with no default files in folder like index.html)
http://example.com/myFolderName/ (with no default files in folder like index.html)
http://example.com/myFolderName/index (with no default files in folder like index.html)
http://example.com/myFolderName/index.March 20, 2014 at 12:05 pm #166399__Participantmygreatsite.com
You should use the example domain (http://example.com) for examples. That’s what it’s for, after all; so you don’t accidentally link to domains you did not intend to. (I’m a mod on another forum, and I can’t tell you how many times I have to deal with posts that use xxx.com as an example…!)
March 20, 2014 at 12:41 pm #166410BionicClickParticipantnoted, and changed. Thank you.
-
AuthorPosts
- The forum ‘Back End’ is closed to new topics and replies.