PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Thu Dec 18, 2014 7:33 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Fri Apr 27, 2012 6:46 pm 
Offline
Forum Commoner

Joined: Wed Jan 28, 2009 1:18 pm
Posts: 97
after i process a query on a page i redirect back to the originating page, where i place the all important file_id place on the tail end of the url

now, when i arrive back at the originating page instead of 'test.com/page.php' like it was when i first landed on it, now it says:

test.com/page.php?file_id=120

what i want to do is somehow grab that '120' and post it, ie:

$fid = [everything on the right of the = of the url];

tia


Top
 Profile  
 
PostPosted: Fri Apr 27, 2012 7:54 pm 
Offline
Forum Commoner

Joined: Wed Jan 28, 2009 1:18 pm
Posts: 97
Syntax: [ Download ] [ Hide ]
function curPageURL() {
 $pageURL = 'http';
 if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";}
 $pageURL .= "://";
 if ($_SERVER["SERVER_PORT"] != "80") {
  $pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];

 } else {
  $pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];

 }
 return $pageURL;

}
$test = explode("=",curPageURL());
$t1 = $test[1];

$term2 = $_POST['term2'];
//$term = $_POST['term'];
if ($term2 !="") {
$term2 = $_POST['term2'];

} else {
$term2 = $t1;
}
 


for posterity


Top
 Profile  
 
PostPosted: Sat Apr 28, 2012 3:34 am 
Offline
Spammer :|
User avatar

Joined: Wed Oct 15, 2008 2:35 am
Posts: 5700
Location: WA, USA
Seriously?
Syntax: [ Download ] [ Hide ]
$t1 = $_GET["file_id"];


Top
 Profile  
 
PostPosted: Sat Apr 28, 2012 7:58 pm 
Offline
Forum Commoner

Joined: Wed Jan 28, 2009 1:18 pm
Posts: 97
:oops:

well, at least it was a nice little seminar on curl :)


Top
 Profile  
 
PostPosted: Sat Apr 28, 2012 9:53 pm 
Offline
Jack of Zircons
User avatar

Joined: Thu Nov 09, 2006 9:30 pm
Posts: 4484
Location: California, USA
inosent1 wrote:
well, at least it was a nice little seminar on curl

No, that has nothing to do with curl. It's just basic PHP.
http://www.w3schools.com/php/php_get.asp


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: Google [Bot] and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group