943,885 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 857
  • PHP RSS
Nov 16th, 2007
0

url pass question

Expand Post »
how can I pass GET url which contains character "?" to php file.
for example I have url:
http://www.mysite.com/file1.php?stri...a1=1&a2=2&a3=3

I want to pass all string "file2.php?a1=1&a2=2&a3=3" into file1.php
now on file1.php, if I use
$v=$_REQUEST['string'];
echo "$v";

I only get
file2.php?a1=1

it lost rest "a2=2&a3=3"

how can I fix this issue?

Any idea?
Similar Threads
Reputation Points: 10
Solved Threads: 0
Junior Poster in Training
michael123 is offline Offline
93 posts
since Jun 2005
Nov 16th, 2007
0

Re: url pass question

PHP Syntax (Toggle Plain Text)
  1. $_SERVER['QUERY_STRING']
That's the short answer
Sponsor
Reputation Points: 520
Solved Threads: 268
Code Monkey
ShawnCplus is offline Offline
1,564 posts
since Apr 2005
Oct 9th, 2009
0
Re: url pass question
See all your variable in get request like-
PHP Syntax (Toggle Plain Text)
  1. echo '<pre>';
  2. print_r($_get);
  3. echo '</pre>';
This will print the $_get variable.
You can access each var by its name like index of the array for ex.
$p1 = $_get['p1'];
$p2 = $_get['p2'];
Reputation Points: 29
Solved Threads: 76
Practically a Master Poster
network18 is offline Offline
616 posts
since Sep 2009

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: holiday property reservation logic
Next Thread in PHP Forum Timeline: weather data





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC