Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 8 years ago.
Improve this question
I use a code to set the URL as:
http://domainname.com/user
The problem is that I use some masks in my .htaccess, so what we see in the URL is not always the real path of the file.
What I need is to get the URL, what is written in the URL, nothing more and nothing less—the full URL.
I need to get how it appears in the Navigation Bar in the web browser, and not the real path of the file on the server.
You need to simple check in PHP what's the value of $_SERVER['REQUEST_URI']
or substr($_SERVER['REQUEST_URI'],1) if you want to remove leading slash
Related
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 6 years ago.
Improve this question
I am working on some sort of blogging platform in php with a nice material design lite frontend. However I have a page that dynamically loads the content, it works fine in the root directory, but not in my admin directory. I hope you can spot some kind of error/typo in my code, I know the error is in the menu-start file, since disabling it enables loading.
Here is the page that loads the code
and here is the menu-start page
If you need any other code, please ask
You're using relative links for include, which will mess up when you start changing directories. Use a pseudo-absolute path with DOCUMENT_ROOT. Be sure to use this for all of your includes.
<?php include $_SERVER['DOCUMENT_ROOT'].'/menu-start.php'; ?>
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 6 years ago.
Improve this question
need your experties here sir/maam
im just wondering why im having this in my url [::1] every time i clicked my button. please help here..
//[::1]/myfirstwebsite/index.php/auth/login
even when i use inspect elemet
You're using IPv6 and most-likely don't have $config['base_url'] set in your config.php file.
Refer to this documentation for more information.
When your url in form action shows
http://::1/project_name/
Chances are you have left the base url blank
$config['base_url'] = '';
In latest versions of codeIgniter it is not recommend that you leave your base_url blank.
$config['base_url'] = 'http://localhost/project_name/';
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 7 years ago.
Improve this question
I am using curl to get some html pages in strings, but I have a problem when i display it , it doesn't show the images nor the css ,let say
the data have this
want to get modified to
thanks!
I want it to modify the whole html page ...
You can use wget with the -k option. Or just see the answers here.
Your problem is that links to images and stylesheets are relative instead of absolute, so your browser doesn't know the real origin of the page when displaying it. A quick fix would be to add
<base href="http://domain.com" />
(with the real originating domain) in the head of your page prior to displaying it.
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 7 years ago.
Improve this question
im copying a file from another domain. It does not give me any errors but the files does not get recognized and its different size from the original file. Its the same extension i checked. so im kinda clueless.
if (!copy('http://maholi.com/image/data/Products/Linen - Juvenile and Infant/1440.jpg', $_SERVER['DOCUMENT_ROOT'].'/resources/categories/tttt6.jpg')) {
echo "failed";
}
any ideas?
This works fine for me:
if (!copy('http://maholi.com/image/data/Products/Linen%20-%20Juvenile%20and%20Infant/1440.jpg', $_SERVER['DOCUMENT_ROOT'].'/tttt6.jpg')) {
echo "failed";
}
Edit: URL's are not allowed to contain spaces. See "Is a URL allowed to contain a space?". Your web browser will automatically encode illegal characters, making you believe they are allowed.
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 8 years ago.
Improve this question
I pass a variable called txt from one query on a web page to another web page using
<?php echo $_GET['txt'];?>
the problem some time the text will have a word like don't in it. the (') causes things to just stop. I need to output the variable as read from the database which would include any text that was in the field
When using $_GET you should use urlencode() and urldecode().