Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself.
Closed 8 years ago.
Improve this question
I'm working with cookies in php, and I define some inside a class function. It's curious, because if I just specify the name, content and path, they all work, but when I also specify the domain, it doesn't work (I mean that it doesn't show in browser cookies and when I try to get it, it doesn't exist.) don't know why. My code is exactly as I described, and I'm sure there's no syntax error (basically because PhP would tell me).
setcookie('rememberme', $cookie_string, time() + COOKIE_RUNTIME, "/", COOKIE_DOMAIN);
Cokie domain is ".127.0.0.1", but i also tried with other domains, and the same.
Can somebody tell me why? Thank you.
It would help to know the value of:
COOKIE_RUNTIME
The correct syntax is:
setcookie(name,value,expire,path,domain,secure)
This works:
$expire=time()+60*60*24*30;
setcookie("japagou", 1, $expire, "/", "yourdomain.tld");
Check some examples
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself.
Closed 9 years ago.
Improve this question
I have seen this code in my header. php file, i don't know what is the use of this tag. They also mentioned initial scale=1.0 like that so can you anyone explain me what the use of that code.
It's used to set the initial scale of the layout. If the initial scale is set to 1, then the layout will be viewed at a scale of 1:1 (no zooming). It can be adjusted as well as changed to a set width.
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.
Closed 8 years ago.
This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself.
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
Improve this question
http://www.aliexpress.com/item/NEW-7-Android-2-3-256MB-DDR2-4GB-NAND-Flash-7-inch-tablet-pc/498159194.html - I got this link
Here you can see a buttons: bundle, color
If you click some of them the price will change, but the question is how can I parse that behaviour to my page via php?
The problem is that I can't understand where is javascript code that executes this, or how to find it, maybe someone got ideas about that?
Inspecting that page's source code I can see that the skuProducts variable in javascript contains this information encoded into a JSON-string. You can't really run this javascript code on your webserver, so you'll have to devise another way to get that variable's value - and then you can use json_decode() to get the contents.
Note that changing the amount of items results in an AJAX call to a shipping costs calculator. You could probably simulate that, but I'm not sure that webshop would like that (and it might be illegal).
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 8 years ago.
This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself.
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 have two PHP files: A.php and B.php. A passes $id to B using POST and B can get $id the first time but I need to jump back to B again using Header. This time the parameter gets lost.
How can I pass the parameter when I use Header to jump back?
You must Use $_REQUEST instead of $_POST so it will work in both case . and when you use header to jump back again use query string with same name.
you can pass id variable in the query string when you redirect.
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
whats up guys?
so my question is simple: my application receives the name of the file as a $_POST['fieldname'] from user and then create the file in a folder on server, or in another case using the $_POST['fieldname'] return the path of the file if file exists. so, is it safe?!
thank you guys!
The answer is that it depends on how well you set up the security around your filesystem access and how you serve the files. If you are only allowing them to send information to a particular folder and you're sanitizing the input, you could be fine. Here's more info on basic filesystem security from php.net. However you want to make sure they can't php code in files and execute them directly. A good bet there would be to not allow any execution from that folder using .htaccess.
However, as the top comment on that php.net link says, you should really consider not letting your users name files, and you should think about trying to store as much in a database as possible.