PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
yosmanor
Forum Newbie
Posts: 5 Joined: Thu Oct 15, 2015 9:48 pm
Post
by yosmanor » Thu Oct 15, 2015 10:20 pm
Trying to pass parameter using this URL
http://premieraircharters.com/window.ph ... ice="$2300 "
No values are transferred.
Any suggestions?
Code: Select all
<?php
$airport=$_get["airport"];
$state=$_get["state"];
$distance=$_get["distance"];
$price=$__get["price"];
Echo $airport;
Echo "<br>";
Echo $state;
Echo "<br>";
Echo $distance;
Echo "<br>";
Echo $price;
Echo "<br>";
?>
Christopher
Site Administrator
Posts: 13596 Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US
Post
by Christopher » Thu Oct 15, 2015 10:25 pm
Code: Select all
$airport=$_GET["airport"];
$state=$_GET["state"];
$distance=$_GET["distance"];
$price=$_GET["price"];
(#10850)
yosmanor
Forum Newbie
Posts: 5 Joined: Thu Oct 15, 2015 9:48 pm
Post
by yosmanor » Fri Oct 16, 2015 7:28 am
Christopher wrote: Code: Select all
$airport=$_GET["airport"];
$state=$_GET["state"];
$distance=$_GET["distance"];
$price=$_GET["price"];
hanks,
I am not sure what the syntax error is.
Pasted the above, same result.
pickle
Briney Mod
Posts: 6445 Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:
Post
by pickle » Fri Oct 16, 2015 3:28 pm
There is case sensitivity.
is not a global variable.
is.
The quotes might be messing stuff up - try removing them.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
yosmanor
Forum Newbie
Posts: 5 Joined: Thu Oct 15, 2015 9:48 pm
Post
by yosmanor » Fri Oct 16, 2015 3:37 pm
pickle wrote: There is case sensitivity.
is not a global variable.
is.
The quotes might be messing stuff up - try removing them.
Neither uppercase GET nor removing the quotes made a difference.
The values of the parameters are not transferred to the test php file
yosmanor
Forum Newbie
Posts: 5 Joined: Thu Oct 15, 2015 9:48 pm
Post
by yosmanor » Fri Oct 16, 2015 3:44 pm
yosmanor wrote: pickle wrote: There is case sensitivity.
is not a global variable.
is.
The quotes might be messing stuff up - try removing them.
Neither uppercase GET nor removing the quotes made a difference.
The values of the parameters are not transferred to the test php file
Thanks,
Part of the problem is solved.
Having said that the value appears with \" before and after it.
Any idea hoe to remove it
\"Bangor\"
\"Maine\"
\"180\"
\"$2300\"
Christopher
Site Administrator
Posts: 13596 Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US
Post
by Christopher » Sat Oct 17, 2015 12:22 pm
yosmanor wrote: yosmanor wrote: Thanks,
Part of the problem is solved.
Having said that the value appears with \" before and after it.
Any idea hoe to remove it
\"Bangor\"
\"Maine\"
\"180\"
\"$2300\"
The best way would be to no put quotes around the values when you create the URL. Otherwise use trim(), substr(), str_replace() or preg_replace().
(#10850)
yosmanor
Forum Newbie
Posts: 5 Joined: Thu Oct 15, 2015 9:48 pm
Post
by yosmanor » Sun Oct 18, 2015 7:21 am
Christopher wrote: yosmanor wrote: yosmanor wrote: Thanks,
Part of the problem is solved.
Having said that the value appears with \" before and after it.
Any idea hoe to remove it
\"Bangor\"
\"Maine\"
\"180\"
\"$2300\"
The best way would be to no put quotes around the values when you create the URL. Otherwise use trim(), substr(), str_replace() or preg_replace().
Thank you