Results 1 to 7 of 7

Thread: ifames and anchor tags

  1. #1
    Join Date
    May 2006
    Location
    L.A.
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default ifames and anchor tags

    New to PHP: will not feel bad if you let me know how terrible my syntax is

    I have an iframe that pulls info from the GET request.
    my url looks something like this: http://www.mywebsite.com/index.php?file=main.html

    The code for index:
    Code:
    <iframe src="<?php echo(htmlentities($_GET['file'])); ?>
    This works great. (by the way unfortunately I HAVE to use the iframe)

    Now I have added some anchor tags inside of main.html
    the code looks like this:
    Code:
    <a name="anchor"></a>
    this Does not work:
    http://www.mywebsite.com/index.php?f...in.html#anchor

    nor,

    http://www.mywebsite.com/index.php?f...n.html&#anchor

    nor,
    http://www.mywebsite.com/index.php?f...in.html&anchor

    nor,
    code for index:
    Code:
    <iframe src="<?php echo(htmlentities($_GET['file','page'])); ?>
    url: http://www.mywebsite.com/index.php?f...l&page=#anchor

    Any suggestions would be appreciated.
    Thnx
    Last edited by shill; 05-16-2006 at 01:26 AM.

  2. #2
    Join Date
    May 2006
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Your site doesn't appear to be hosted at that location.

  3. #3
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Quote Originally Posted by shill
    I have an iframe that pulls info from the GET request.
    my url looks something like this: http://www.mywebsite.com/index.php?file=main.html
    Quote Originally Posted by cybercoder
    Your site doesn't appear to be hosted at that location.
    Please read the posts more carefully before responding with garbage.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  4. #4
    Join Date
    May 2006
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by jscheuer1
    Please read the posts more carefully before responding with garbage.
    I don't appreciate this abuse!

    How are we suppossed to help properly without an example. That is all I was trying to get across.

  5. #5
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Quote Originally Posted by cybercoder
    I don't appreciate this abuse!

    How are we suppossed to help properly without an example. That is all I was trying to get across.
    Then be more clear. Something like:

    Please post a link to the page on your site that contains the problematic code so we can check it out.


    Would do.

    Otherwise, it appears as though you have your head up somewhere.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  6. #6
    Join Date
    Jun 2006
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default How 'bout this...

    If you have not already solved this try...

    url: http://www.mywebsite.com/index.php?f...&anchor=anchor

    Code:
    <iframe src="<?php echo(htmlentities($_GET['file'])); ?>#<?php 
       echo(htmlentities($_GET['anchor'])); ?>">

  7. #7
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    I believe the issue might be with the #. Since that specifies an anchor, it will look for that anchor on the current page.

    As such, use the html character code instead of #, &&#35;35;
    like this:
    http://www.mywebsite.com/index.php?f...&#35;35;anchor

    However, I wonder if that ampersand will now cause you issues, trying to split the variable in two.


    The last post will do it. You can try that
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •