CPVLab Discount: Save $50!
  #1  
Old 04-03-2011, 01:03 AM
Junior Member
 
Join Date: Mar 2011
Posts: 12
Thanks: 6
Thanked 0 Times in 0 Posts
Default PHP Get Question

I'm trying to play with a new landing page that I'm working on that grabs part of the url string.

The way the url reads:

Code:
bla.com/huh?f=greg&l=albany%2C+ny
The way it comes in from leadimpact:


Code:
mysite.com/?keyword=bla.com/huh?f=greg&l=albany%2C+ny

When I use PHP's get function, I can't pull in "greg" when I use the following:


Code:
<?php echo $_GET["f"]; ?>
It only pulls "keyword" which yields "bla.com/huh?f=greg" and "l", which yields "albany, ny"

Is there a simple way to modify the get function to pull the person's name when it's passed by leadimpact?

Thanks!
Reply With Quote
  #2  
Old 04-04-2011, 08:36 AM
Senior Member
 
Join Date: Feb 2011
Posts: 121
Thanks: 11
Thanked 27 Times in 21 Posts
Default

try to use $_REQUEST, which is an array that contains $_GET elements.
I'm not sure, I'm not a programmer just thinking aloud
Reply With Quote
  #3  
Old 04-04-2011, 02:48 PM
CPVDen Co-Owner
 
Join Date: Apr 2010
Posts: 179
Thanks: 1
Thanked 12 Times in 12 Posts
Default

Also try:

$_POST['f'];

Reply With Quote
  #4  
Old 04-04-2011, 08:09 PM
Junior Member
 
Join Date: Mar 2011
Posts: 12
Thanks: 6
Thanked 0 Times in 0 Posts
Default

Thanks! Will give this a shot.
Reply With Quote
  #5  
Old 04-17-2011, 10:02 AM
Junior Member
 
Join Date: Mar 2011
Posts: 4
Thanks: 0
Thanked 1 Time in 1 Post
Default

Originally Posted by imdbombazz View Post
I'm trying to play with a new landing page that I'm working on that grabs part of the url string.
The way the url reads:
Code:
bla.com/huh?f=greg&l=albany%2C+ny
The way it comes in from leadimpact:
Code:
mysite.com/?keyword=bla.com/huh?f=greg&l=albany%2C+ny

When I use PHP's get function, I can't pull in "greg" when I use the following:

Code:
<?php echo $_GET["f"]; ?>
It only pulls "keyword" which yields "bla.com/huh?f=greg" and "l", which yields "albany, ny"
Is there a simple way to modify the get function to pull the person's name when it's passed by leadimpact?
Thanks!
Will not work that way buddy.
The get pars work this way -
URL/scriptname.php?(question mark shows that get parameters will be passed)PAR1=VALUE1&(& shows that another parameter starts here)PAR2=VALUE2

So in your case first $_GET value with name keyword will be "bla.com/huh?f=greg"

To get the person name, which in this case is greg, you need to work with other php functions.
Here is how I would do it.
Code:
$keyword = $_GET ["keyword"];
$array = Explode ("f=", $keyword);
$firstname = array  [1];
echo "Hello " . firstname . "!";
Reply With Quote
  #6  
Old 04-18-2011, 04:20 AM
Junior Member
 
Join Date: Mar 2011
Posts: 12
Thanks: 6
Thanked 0 Times in 0 Posts
Default

Thanks for the help. I have zero experience with PHP so i'm trying to learn where I can.

Thanks again!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 05:58 AM.


Search Engine Optimization by vBSEO 3.6.0