Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I have this link viewdocument.php?a=http%3A%2F%2Fwww.iesalfonsox.com%2Fimages%2FLIBROS_ESO_13-14.pdf in (for example) index.php and I want to put only the URL of the document of the link.
Example:
Link: http://www.myweb.com/viewdocument.php?a=some.pdf
On the HTML: You're viewing "Some.pdf".
Do you understand? Convert "viewdocument.php?a=some.pdf" to "some.pdf".
If this is the current URL being accessed on your site, Php provide globals and you can access it using the $_GET variable:
so for your example you will use this:
$file = $_GET['a']; // will return some.pdf
The other case will be for parsing a url from a string, for which php provides a function:
parse_url();
Follow the link to see examples
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I have big problem. I have some code like :
This is in my folder "country"
if($_GET[''] == 'England') {
echo 'test';
}
Is that impossible to left empty get parameter? to get url like : link.com/country/England
You can do the following: example.com/country/?England, and check if the England key exists:
if(isset($_GET['England'])) {
// Do stuff
}
Without the ? characters, it's a bit more difficult and require to rewrite URL with [mod_rewrite][1] if you're using Apache web server for example
You are looking for url rewriting: http://httpd.apache.org/docs/2.0/misc/rewriteguide.html
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I just received a source from my customer (it's written by PHP Generally), I try to read it and glance at database. I realize that it's very mess, some webpage's content is also saved in database. So, I want to find files are using by browser and I mean that php files, I want to edit them. Can I do that?
P/S: I'm sorry if this article bother you
Hi At any point you need to know what functions, what includes and what arguments are being passed just use debug_print_backtrace() function in your code.
for further reading follow http://www.php.net/manual/en/function.debug-print-backtrace.php
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
How does one display the USD exchange rate from https://bitpay.com/api/rates using PHP on a web page?
ie, that in the first line:
{"code":"USD","name":"US Dollar","rate":325.8}
you need json_decode() from php
it will convert the json data to a php object
but as suggested by Marc B
write some code
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
How can I write a code that gets the current location coordinates (LLA) in my web browser using PHP .
Is it possible by using GPS via HTTP or something like that ?
please help
Thanks
You will need to use the brower's geolocation API, for example as shown here.
Then, you simply pass the parameters to a PHP script using whatever method you like, a form, or a jQuery post.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 9 years ago.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Questions concerning problems with code you've written must describe the specific problem — and include valid code to reproduce it — in the question itself. See SSCCE.org for guidance.
Improve this question
I need to jQuery variable value in PHP code in same file with out calling ajax? Please help me it is possible or not. Here jQuery and PHP code here given below.
well you can make use of jquery.session plugin to store Session variable and then you can access that variable using php code.
Sample Code
$(function() {
$.session("myVar", "value");
});
In PHP
echo $_SESSION['myVar'];