Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #11900 > unrolled thread

changing iframe source via php

Started byrichard <noreply@example.com>
First post2013-11-21 17:23 -0500
Last post2013-11-23 18:51 -0800
Articles 17 — 9 participants

Back to article view | Back to comp.lang.php


Contents

  changing iframe source via php richard <noreply@example.com> - 2013-11-21 17:23 -0500
    Re: changing iframe source via php David Robley <me@home.invalid> - 2013-11-22 09:40 +1030
    Re: changing iframe source via php invalid@example.com - 2013-11-22 11:21 +1100
    Re: changing iframe source via php Richard Yates <richard@yatesguitar.com> - 2013-11-21 16:32 -0800
      Re: changing iframe source via php richard <noreply@example.com> - 2013-11-21 20:23 -0500
        Re: changing iframe source via php Richard Yates <richard@yatesguitar.com> - 2013-11-21 19:24 -0800
    Re: changing iframe source via php Arno Welzel <usenet@arnowelzel.de> - 2013-11-22 12:21 +0100
    Re: changing iframe source via php richard <noreply@example.com> - 2013-11-22 08:08 -0500
      Re: changing iframe source via php Tim Streater <timstreater@greenbee.net> - 2013-11-22 13:33 +0000
        Re: changing iframe source via php richard <noreply@example.com> - 2013-11-22 08:48 -0500
          Re: changing iframe source via php Arno Welzel <usenet@arnowelzel.de> - 2013-11-22 16:30 +0100
      Re: changing iframe source via php Arno Welzel <usenet@arnowelzel.de> - 2013-11-22 16:27 +0100
      Re: changing iframe source via php Doug Miller <doug_at_milmac_dot_com@example.com> - 2013-11-22 20:19 +0000
      Re: changing iframe source via php Doug Miller <doug_at_milmac_dot_com@example.com> - 2013-11-22 20:21 +0000
    Re: changing iframe source via php Denis McMahon <denismfmcmahon@gmail.com> - 2013-11-23 01:43 +0000
      Re: changing iframe source via php Denis McMahon <denismfmcmahon@gmail.com> - 2013-11-23 19:30 +0000
        Re: changing iframe source via php Scott Johnson <noonehome@chalupasworld.com> - 2013-11-23 18:51 -0800

#11900 — changing iframe source via php

Fromrichard <noreply@example.com>
Date2013-11-21 17:23 -0500
Subjectchanging iframe source via php
Message-ID<1s4gzmodspnfe$.1sw8nmo0gpova$.dlg@40tude.net>
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??

[toc] | [next] | [standalone]


#11904

FromDavid Robley <me@home.invalid>
Date2013-11-22 09:40 +1030
Message-ID<l6m3pd$e8n$1@news.albasani.net>
In reply to#11900
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.

It would help if you told what the parse error was, and showed the relevant 
code which is causing the 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??

Depends on exactly what it is you want to appear there :-) again, show what 
you have tried??


-- 
Cheers
David Robley

TV is chewing gum for the eyes.

[toc] | [prev] | [next] | [standalone]


#11906

Frominvalid@example.com
Date2013-11-22 11:21 +1100
Message-ID<oo8t891s195ekc3723vtgfgtoh6bhoiaem@4ax.com>
In reply to#11900
On Thu, 21 Nov 2013 17:23:00 -0500, richard <noreply@example.com> 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??

Easy to do in JavaScript. Impossible to do in php.

---
This email is free from viruses and malware because avast! Antivirus protection is active.
http://www.avast.com

[toc] | [prev] | [next] | [standalone]


#11907

FromRichard Yates <richard@yatesguitar.com>
Date2013-11-21 16:32 -0800
Message-ID<e39t89pfie42dor49lh9r4f25dfojggv3j@4ax.com>
In reply to#11900
On Thu, 21 Nov 2013 17:23:00 -0500, richard <noreply@example.com>
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??

You should post your attempts because it is not very clear what you
are trying to do. If you are getting 'value' in a query string and
want to use that to get the associated page in the iframe, then it may
be that you want this:

<iframe name="home" id="aframe" src="page<?php echo
$_GET['value'];?>">

[toc] | [prev] | [next] | [standalone]


#11908

Fromrichard <noreply@example.com>
Date2013-11-21 20:23 -0500
Message-ID<7d19n0q9hu8x.1neuj97vlff7i.dlg@40tude.net>
In reply to#11907
On Thu, 21 Nov 2013 16:32:05 -0800, Richard Yates wrote:

> On Thu, 21 Nov 2013 17:23:00 -0500, richard <noreply@example.com>
> 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??
> 
> You should post your attempts because it is not very clear what you
> are trying to do. If you are getting 'value' in a query string and
> want to use that to get the associated page in the iframe, then it may
> be that you want this:
> 
> <iframe name="home" id="aframe" src="page<?php echo
> $_GET['value'];?>">

kind of tried that approach. did not work.

[toc] | [prev] | [next] | [standalone]


#11909

FromRichard Yates <richard@yatesguitar.com>
Date2013-11-21 19:24 -0800
Message-ID<gijt89llgiup4nt48na276e4pufh5dilj7@4ax.com>
In reply to#11908
On Thu, 21 Nov 2013 20:23:35 -0500, richard <noreply@example.com>
wrote:

>On Thu, 21 Nov 2013 16:32:05 -0800, Richard Yates wrote:
>
>> On Thu, 21 Nov 2013 17:23:00 -0500, richard <noreply@example.com>
>> 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??
>> 
>> You should post your attempts because it is not very clear what you
>> are trying to do. If you are getting 'value' in a query string and
>> want to use that to get the associated page in the iframe, then it may
>> be that you want this:
>> 
>> <iframe name="home" id="aframe" src="page<?php echo
>> $_GET['value'];?>">
>
>kind of tried that approach. did not work.

"Kind of" rarely does work. Post your code.

[toc] | [prev] | [next] | [standalone]


#11914

FromArno Welzel <usenet@arnowelzel.de>
Date2013-11-22 12:21 +0100
Message-ID<528F3E42.4000704@arnowelzel.de>
In reply to#11900
Am 21.11.2013 23:23, schrieb richard:

> 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??

Sorry - but with this non-existing problem description it is impossible
to help you.

Post your *existing* code - and please in a layout that it is readable.


-- 
Arno Welzel
http://arnowelzel.de
http://de-rec-fahrrad.de

[toc] | [prev] | [next] | [standalone]


#11917

Fromrichard <noreply@example.com>
Date2013-11-22 08:08 -0500
Message-ID<1csll7c4jvn5r.1aym2fc9ijbqu.dlg@40tude.net>
In reply to#11900
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){
echo '<iframe name="home" id="if1" src="index3.php"></iframe>';
}
  else {
echo '<iframe name="home" id="if1" src="home.php"></iframe>';
}

This results in "index3.php" being shown when the site is first loaded.
when the link is clicked, which has ?page=1 as a value, it not only brings
in the correct page, but duplicates the original page as well.

On other pages I swap pages with an iframe with no problems.

www.mroldies.net
compare to www.mroldies.net/index3.php

[toc] | [prev] | [next] | [standalone]


#11918

FromTim Streater <timstreater@greenbee.net>
Date2013-11-22 13:33 +0000
Message-ID<221120131333285887%timstreater@greenbee.net>
In reply to#11917
In article <1csll7c4jvn5r.1aym2fc9ijbqu.dlg@40tude.net>, richard
<noreply@example.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, ..."

> echo '<iframe name="home" id="if1" src="index3.php"></iframe>';
> }
>   else {
> echo '<iframe name="home" id="if1" src="home.php"></iframe>';
> }
> 
> This results in "index3.php" being shown when the site is first loaded.
> when the link is clicked, which has ?page=1 as a value, it not only brings
> in the correct page, but duplicates the original page as well.
> 
> On other pages I swap pages with an iframe with no problems.
> 
> www.mroldies.net
> compare to www.mroldies.net/index3.php
>

-- 
Tim

"That excessive bail ought not to be required, nor excessive fines imposed,
nor cruel and unusual punishments inflicted"  --  Bill of Rights 1689

[toc] | [prev] | [next] | [standalone]


#11920

Fromrichard <noreply@example.com>
Date2013-11-22 08:48 -0500
Message-ID<1o5ng8lrsr0u9.fo074ldhvppi.dlg@40tude.net>
In reply to#11918
On Fri, 22 Nov 2013 13:33:28 +0000, Tim Streater wrote:

> In article <1csll7c4jvn5r.1aym2fc9ijbqu.dlg@40tude.net>, richard
> <noreply@example.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.

Go to the main page and click the "test" link.

[toc] | [prev] | [next] | [standalone]


#11924

FromArno Welzel <usenet@arnowelzel.de>
Date2013-11-22 16:30 +0100
Message-ID<528F789B.8020609@arnowelzel.de>
In reply to#11920
Am 22.11.2013 14:48, schrieb richard:

> On Fri, 22 Nov 2013 13:33:28 +0000, Tim Streater wrote:
> 
>> In article <1csll7c4jvn5r.1aym2fc9ijbqu.dlg@40tude.net>, richard
>> <noreply@example.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

[toc] | [prev] | [next] | [standalone]


#11923

FromArno Welzel <usenet@arnowelzel.de>
Date2013-11-22 16:27 +0100
Message-ID<528F77CF.5080308@arnowelzel.de>
In reply to#11917
Am 22.11.2013 14:08, schrieb richard:

> 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){

When you will you ever learn the difference between "=" and "=="?

> echo '<iframe name="home" id="if1" src="index3.php"></iframe>';
> }
>   else {
> echo '<iframe name="home" id="if1" src="home.php"></iframe>';
> }
> 
> This results in "index3.php" being shown when the site is first loaded.
> when the link is clicked, which has ?page=1 as a value, it not only brings
> in the correct page, but duplicates the original page as well.





-- 
Arno Welzel
http://arnowelzel.de
http://de-rec-fahrrad.de

[toc] | [prev] | [next] | [standalone]


#11933

FromDoug Miller <doug_at_milmac_dot_com@example.com>
Date2013-11-22 20:19 +0000
Message-ID<XnsA2809BBB59219dougmilmaccom@78.46.70.116>
In reply to#11917
richard <noreply@example.com> wrote in news:1csll7c4jvn5r.1aym2fc9ijbqu.dlg@40tude.net:

>   if ($apage=1){

You did it again.

[toc] | [prev] | [next] | [standalone]


#11934

FromDoug Miller <doug_at_milmac_dot_com@example.com>
Date2013-11-22 20:21 +0000
Message-ID<XnsA2809C395E9CBdougmilmaccom@78.46.70.116>
In reply to#11917
richard <noreply@example.com> wrote in news:1csll7c4jvn5r.1aym2fc9ijbqu.dlg@40tude.net:

> www.mroldies.net
> compare to www.mroldies.net/index3.php

And there's *another* thing you haven't figured out yet -- we can't see your php code, only what 
the server renders as a result of *executing* that code.

If you want us to see the code, you have to post it.

[toc] | [prev] | [next] | [standalone]


#11939

FromDenis McMahon <denismfmcmahon@gmail.com>
Date2013-11-23 01:43 +0000
Message-ID<l6p179$1qr$2@dont-email.me>
In reply to#11900
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.

What does the parse error say?

> 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??

I suspect you need to refer back to all those posts we've made in the 
past about the need to be extra careful with the handling of quote 
characters inside string data.

-- 
Denis McMahon, denismfmcmahon@gmail.com

[toc] | [prev] | [next] | [standalone]


#11947

FromDenis McMahon <denismfmcmahon@gmail.com>
Date2013-11-23 19:30 +0000
Message-ID<l6qvo3$l2i$1@dont-email.me>
In reply to#11939
On Sat, 23 Nov 2013 01:43:05 +0000, Denis McMahon wrote:

> I suspect you need to refer back to all those posts we've made in the
> past about the need to be extra careful with the handling of quote
> characters inside string data.

Seems the posts that you need to refer back to are the ones about the 
difference between == and = (and possibly === as well).

Although I'm not willing to rule out the possibility of messed up string 
quoting also being a factor.

-- 
Denis McMahon, denismfmcmahon@gmail.com

[toc] | [prev] | [next] | [standalone]


#11950

FromScott Johnson <noonehome@chalupasworld.com>
Date2013-11-23 18:51 -0800
Message-ID<l6rpil$kpk$1@dont-email.me>
In reply to#11947
On 11/23/2013 11:30 AM, Denis McMahon wrote:
> On Sat, 23 Nov 2013 01:43:05 +0000, Denis McMahon wrote:
>
>> I suspect you need to refer back to all those posts we've made in the
>> past about the need to be extra careful with the handling of quote
>> characters inside string data.
>
> Seems the posts that you need to refer back to are the ones about the
> difference between == and = (and possibly === as well).
>
> Although I'm not willing to rule out the possibility of messed up string
> quoting also being a factor.
>

Wise assumption

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.php


csiph-web