AdWarm
August 18, 2011, 9:29am
1
$iframecontent = get_url('http://domain.com/data.ashx?id=270.126&sub_id=List5&gender=".$title."&firstname=".$first."&lastname=".$last."&email=".$email."&dob=".$dob."');
Morning Guys!
Hope you are all well, any reason why my variables are not being replaced with its value in the url?
Thank you.
rpkamp
August 18, 2011, 10:06am
2
Because you’re mixing up single quotes and double quotes.
$iframecontent = get_url('http://domain.com/data.ashx?id=270.126&sub_id=List5&gender='.$title.'&firstname='.$first.'&lastname='.$last.'&email='.$email.'&dob='.$dob);
Also, you may want to [fphp]urlencode[/fphp] those parameters.
$iframecontent = get_url(
sprintf(
'http://domain.com/data.ashx?id=270.126&sub_id=List5&gender=%s&firstname=%s&lastname=%s&email=%s&dob=%s',
urlencode($title),
urlencode($first),
urlencode($last),
urlencode($email),
urlencode($dob)
)
);
(in the highlighted version you posted the string is all red, while the variables ~should~ be blue, that’s always a good clue to see you’ve screwed up the string :))
AdWarm
August 18, 2011, 10:33am
3
Thank you very much ScallioXTX