Re: changing iframe source via php [message #183853 is a reply to message #183848] |
Fri, 22 November 2013 15:30 |
Arno Welzel
Messages: 317 Registered: October 2011
Karma:
|
Senior Member |
|
|
Am 22.11.2013 14:48, schrieb richard:
> On Fri, 22 Nov 2013 13:33:28 +0000, Tim Streater wrote:
>
>> In article <1csll7c4jvn5r(dot)1aym2fc9ijbqu(dot)dlg(at)40tude(dot)net>, richard
>> <noreply(at)example(dot)com> wrote:
>>
>>> On Thu, 21 Nov 2013 17:23:00 -0500, richard wrote:
>>>
>>>> I'm trying to figure out a way so that I can change the iframe source with
>>>> just simply changing the src value.
>>>> But I keep getting a parse error.
>>>>
>>>> I set the posted value with a link.
>>>> value=1 src=page1
>>>> value=2 src=page2
>>>> value=3 src=page3
>>>> if value is anything else, then the home page is used.
>>>>
>>>> <iframe name="home" id="aframe" src="????">
>>>>
>>>> How od I code where the ? are??
>>>
>>> $apage=$_GET["page"];
>>> if (empty($apage)) {$apage=0;}
>>>
>>> if ($apage=1){
>> ^^^^^^ "Here we go again, oh watch him now, ..."
>>
> and I get the same results.
Because of different reasons but NOT because of your WRONG assignment
operation.
if($apage=1)
WILL ALWAYS SET $apage to 1, because a single "=" ALWAYS means "assign
value from the right to the left" - ALWAYS!
--
Arno Welzel
http://arnowelzel.de
http://de-rec-fahrrad.de
|
|
|