Passing variable to other php link.
Moderator: General Moderators
Change $_GET's and $_POST's to $_REQUEST's and echo the values out as soon as you request them.. does that work? If nothing echoes out make sure that the variables are getting sent by going to yourscript.php?variable=test and see if it echoes out test for $variable=$_REQUEST['varialbe']; echo $variable;
-
Cryptkeeper
- Forum Newbie
- Posts: 17
- Joined: Wed Nov 10, 2004 3:05 am
- CoderGoblin
- DevNet Resident
- Posts: 1425
- Joined: Tue Mar 16, 2004 10:03 am
- Location: Aachen, Germany
Try adding the php command
var_dump($_REQUEST) ; to your code and check the array indexes.
You could also insert a hidden field into form containing the username as recommended previously.
Does the url shown when posting the form contain the user identifier ? If not insert a hidden field in your form to hold it.
var_dump($_REQUEST) ; to your code and check the array indexes.
You could also insert a hidden field into form containing the username as recommended previously.
Does the url shown when posting the form contain the user identifier ? If not insert a hidden field in your form to hold it.
Create a new folder on your server and try this experiment:
file1.php
file2.php
file1.php
Code: Select all
<?
header("location:http://yoursite.com/folder/file2.php?test=Itworks");
?>Code: Select all
$test = $_REQUEST['test'];
if ($test!=NULL) {
echo "$test";
} else {
echo "There is something wrong with your server/php configuration";
}-
Cryptkeeper
- Forum Newbie
- Posts: 17
- Joined: Wed Nov 10, 2004 3:05 am
don't put sensitive information in them that you wouldn't want other people to see as a right click view source will reveal all.
Hidden fields still get passed in the url string if they are within a form.
I'm sure there are a few more concerns but that is all that comes to the top of my head right now.
Hidden fields still get passed in the url string if they are within a form.
I'm sure there are a few more concerns but that is all that comes to the top of my head right now.