Passing parameter back to the same PHP file [closed] - 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 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.

Related

PHP data type resource() [closed]

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
as we all know,there is a data type 'resouce' in php!I sometimes can encounter this data type!but I have some problems about this type!
when I have a db connect,I print the data type,it displays"resource(4, mysql link)",
when I create a image,I print the data type,it displays "resource(2, gd)"
i want to know what the number eg.'4','2' means in the "()".
sorry for my bad englis!
When you see resource(4, ...) what that means is that PHP is keeping a reference to a more complex object that isn't a normal PHP object, and thus can't be manipulated directly. It's typically used by libraries that interface with non-PHP code (such as database client libraries and the GD library).
The number is simply the ID number of that particular external object.
These resources are managed by the external library and only really given to PHP as an indirect reference; they only have meaning to the library code that created them.

register_globals still working, why? [closed]

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
In my php.ini I have register_globals=Off
But still if I visit
`/testing/testing.php?abc=19`
then value of abc=19 is shown by using echo $_REQUEST['abc'].
Question is why still I can access value of abc variable?
Note: I am using XAMPP.
You are asking why you can give register_globals=Off and $_REQUEST['abc'] will be set. That's not relevant to how register_globals works.
register_globals sets a global variable with the name of the URL key. So in this case you could do echo $abc; and the code would work fine if register_globals was enabled and would cause an error if it was disabled.
$_REQUEST (like $_GET and $_POST) is a super-global, and will be available whatever setting you give.
even if off/on register_gloabls $_GET and $_POST will have parameters which are coming from request
when you set register_globals=On
request like http://www.example.com/?abc=1&temp=3
then php will create variable with name abc and temp and assigns value 1,3 respectively.

How do I get information from this page, that isn't in the HTML code [closed]

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).

How to get jQuery variable value in PHP file [closed]

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'];

PHP 5.2 and Smarty, Scope issue [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
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.
Closed 9 years ago.
Improve this question
I am trying to separate my code into functions to make it more readable.
I made a function to update a field in a database. What I am trying to do is that when they change the username it goes to update Account function then updates the session variable , the smarty var,and the database regarding the name.
Everything gets updated after the form is submitted but the smarty variable and I can't figure out why(i know its something to do with the scope) because if i declare it out of the function it works fine.
All the magic that i need fixed is in the Home portion of the routing section of my code. Thank you for any help :)
code :http://pastebin.com/VdRPz3hc

Categories