$_GET['var_name'] solution?
Moderator: General Moderators
$_GET['var_name'] solution?
I have a set of scripts that i have on my server that work fine.. i have to place them on another server and as it is.. doesnt work. Its just not passing variables unless i use this ( $_GET['var_name'] ) for each variable. Is there a predefined variable along the lines of $HTTP_POST_VARS that will call all vars so it dont have to create one for each variable passed?
what about
at the top of your pages.
you really should be coding to include the $_GET methology by now tho!
Code: Select all
extract($_POST);you really should be coding to include the $_GET methology by now tho!
alright, i've been trying all kinds of stuff.. its just not working right.
this is what i have as a test to see what will make it work on this server .
Ive also put the $_GET['name'] where the $name var is. i still get nothing, well i get "hello it worked" no name. i tried what bech100 said, same thing. Any idea?
this is what i have as a test to see what will make it work on this server .
Code: Select all
<?
$HTTP_POST_VARS;
if ($_GETї'action']=="this"){
echo "hello ". $name . " it worked";
} else {
?>
<form name="form1" method="post" action="<? echo "testRS.php?action=this"; ?>">
name:
<input type="text" name="name">
<input type="submit" name="Submit" value="Submit">
</form>
<?
};
?>- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
Is anything showing up in your $_REQUEST vars? Do you know what version of PHP the server is running?
Something you can try to see what is showing up in your vars is run each through a foreach loop to see what the output is:
Do this for all of your vars to see what is getting sent/requested. Just a thought. Hope it helps.
Something you can try to see what is showing up in your vars is run each through a foreach loop to see what the output is:
Code: Select all
<?php
foreach ($_GET as $key => $val)
{
echo "The key is $key<br />";
echo "The val is $val<br />";
}
?>- shiznatix
- DevNet Master
- Posts: 2745
- Joined: Tue Dec 28, 2004 5:57 pm
- Location: Tallinn, Estonia
- Contact:
wait if you use
and
you dont need to add the $var = $_POST['var'] stuff??
Code: Select all
extract($_GET);Code: Select all
extract($_POST);being that im having this problem on this new server im workign with and not my own.. i just compaired the phpinfo() on both servers.. on the one, the server im having no problem with, the variables_order is set to EGPCS and on the other it just has no value. Could this be why im having so many problems?
- n00b Saibot
- DevNet Resident
- Posts: 1452
- Joined: Fri Dec 24, 2004 2:59 am
- Location: Lucknow, UP, India
- Contact:
try this
and tell me what happens.
Code: Select all
<?
if (isset($_POSTї'name']))
echo "Hello ". $_POSTї'name']. " It does work!";
else {
?>
<form method="post" action="<?=$_SERVERї'PHP_SELF']?>">
name: <input type="text" name="name">
<input type="submit" name="Submit" value="Submit">
</form>
<?
};
?>