Re: How to transfer value to iframe? [message #183134 is a reply to message #183125] |
Thu, 10 October 2013 13:25 |
Denis McMahon
Messages: 634 Registered: September 2010
Karma:
|
Senior Member |
|
|
On Wed, 09 Oct 2013 23:31:55 -0400, richard wrote:
> I tried this
> <iframe id="x1" src="audiox1.php?asong=songid" name="alpha"></iframe>
> Assigining songid as $songid=$play[0];
> Retrieving value through
> $number=$_GET["asong"];
> echo $number;
> Results in "songid" being printed.
That is as expected, you're setting the value of asong in the query
string to the text value songid.
Depending on how you're generating the string:
<iframe id="x1" src="audiox1.php?asong=songid" name="alpha"></iframe>
and assuming that $songid is a php variable containing the numeric songid
that you want to pass, you may wish to replace songid in the above
construction with one of:
' . $songid . '
$songid
{$songid}
I also suggest that you read
http://www.php.net/manual/en/language.types.string.php
very carefully. There are some very important comments there about what
happens inside different types of string literal depending on the quoting
methods used.
--
Denis McMahon, denismfmcmahon(at)gmail(dot)com
|
|
|