Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 13 of 13
  1. #1
    New Coder
    Join Date
    Dec 2006
    Location
    Bangalore
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Internet Explorer Problem in IE, wanted solution

    Problem in IE, wanted solution
    Path:
    localhost/articles/

    <?php
    $self = $_SERVER['PHP_SELF'];
    $pg_content = "<a href=\"$self?id=$id\">$article_title</a>";
    ?>

    this link works fine in Firefox by querying the db and displaying the article details

    in IE6 it keeps coming back to the index even though
    the proper url is passed to the IE address bar as
    http://localhost/articles/index.php?id=1

    if the above url is manually entered into the address bar it works fine
    anyone know why ?
    Hemanth
    www.valueads.biz
    Bangalore
    India

  • #2
    New Coder
    Join Date
    Dec 2006
    Location
    Bangalore
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts
    <a href="http://a/va2/index.php?id=1">http://a/va2/index.php?id=1</a><br>
    <a href="/a/va2/index.php?id=1">/a/va2/index.php?id=1</a><br>
    <a href="a/va2/index.php?id=1">a/va2/index.php?id=1</a><br>
    <a href="index.php?id=1">index.php?id=1</a><br>

    even these
    first & last work in firefox

    none work in internet explorer
    Hemanth
    www.valueads.biz
    Bangalore
    India

  • #3
    Senior Coder Nightfire's Avatar
    Join Date
    Jun 2002
    Posts
    4,266
    Thanks
    6
    Thanked 48 Times in 48 Posts
    Code you're using to get the $id info from the url is?

  • #4
    New Coder
    Join Date
    Dec 2006
    Location
    Bangalore
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts
    snippet
    $pg_content .= "<a href=\"$self?id=$id \">$article_title</a>";

    it is working perfectly in Firefox

  • #5
    Senior Coder Nightfire's Avatar
    Join Date
    Jun 2002
    Posts
    4,266
    Thanks
    6
    Thanked 48 Times in 48 Posts
    Yeah that's gonna put it in the link, but what are you using to get it from the url?

    Are you using $_GET['id']?

  • #6
    New Coder
    Join Date
    Dec 2006
    Location
    Bangalore
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts
    at least these manually entered <a> links
    should work

    they are not

    but if you type these exactly into the address bar they work

    not as a link on the page

    links to other pages (separate page to handle get/post data)
    also work

  • #7
    Senior Coder Nightfire's Avatar
    Join Date
    Jun 2002
    Posts
    4,266
    Thanks
    6
    Thanked 48 Times in 48 Posts
    I'll ask one more time. Show the code you are using to retrieve id from the url. You're just showing a link. A link isn't what I'm asking for. There's an error in your code, or you have a caching problem in IE. But I do not know what it is as I have no code to work from, therefore I cannot help you

  • #8
    New Coder
    Join Date
    Dec 2006
    Location
    Bangalore
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts
    if(!isset($_GET['id']))
    { // if no id is specified, show the list
    $self = $_SERVER['PHP_SELF'];

    $query = "SELECT ad_id, ad_time, ad_title, ad_content FROM va_ads ORDER BY ad_id";
    $result = mysql_query($query) or die('Error : ' . mysql_error());

    $pg_title = 'Latest Ads List';
    // create the list
    $pg_content = "<table width=100% cellspacing=0 cellpadding=5 border=1 valign=top>
    <tr><th>Select for details<th>Date</tr>" ;
    while($row = mysql_fetch_array($result, MYSQL_NUM))
    {
    list($ad_id, $ad_time, $ad_title, $ad_content) = $row;
    $pg_content .= "<tr><td><a href=\"$self?id=$ad_id \">$ad_title</a><br>
    $ad_content</td><td width=50>" . date('M j Y', strtotime($ad_time)) . "</td></tr>";
    }
    $pg_content .= '</table>' ;

    } else {
    // id selected so get the article info from database
    $query = "SELECT ad_id, ad_time, ad_title, ad_content FROM va_ads WHERE ad_id=".$_GET['id'];
    $result = mysql_query($query) or die('Error : ' . mysql_error());
    $row = mysql_fetch_array($result, MYSQL_ASSOC);

    $pg_title = $row['ad_title'];
    $pg_content = '<p><b>Date : </b>'.date('M j Y', strtotime($row['ad_time'])).
    '<p><b>Advertisement Details :</b><br>'.$row['ad_content'];


    this is the unaltered code which is working in firefox
    sorry for delay. quick reply was getting stuck
    Hemanth
    www.valueads.biz
    Bangalore
    India

  • #9
    Super Moderator JohnDubya's Avatar
    Join Date
    Nov 2006
    Location
    Missouri
    Posts
    634
    Thanks
    12
    Thanked 18 Times in 18 Posts
    I'm not sure if I'm seeing everything, but I don't see where you set $id to be anything. It should be set like:

    PHP Code:
    $id $_GET['id']; 

  • #10
    New Coder
    Join Date
    Dec 2006
    Location
    Bangalore
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts
    [QUOTE=mvhemanth;541808]

    if(!isset($_GET['id']))
    { // the if not set code


    } else {
    // the id is set
    $query = "SELECT ad_id, ad_time, ad_title, ad_content FROM va_ads
    WHERE ad_id=".$_GET['id'];
    ^^^^^^^^^^^^^^
    $result = mysql_query($query) or die('Error : ' . mysql_error());

    *******************
    I'm querying the DB with the ID

    I again repeat... "works perfectly in Firefox"

    i'm beginning to thing self referencing with GET/POST doesnt work in IE

    buy if u type...
    localhost/va2/index.php?id=1

    MANUALLY in the address bar it works in IE

    if you use it as a 'self referencing' link
    <a href="index.php?id=1">List</a>
    within the 'index.php' file
    ^^^^^^^^

    it is not working only in IE
    even as a simple link

    link on page not working
    manual entry in address bar working
    Hemanth
    www.valueads.biz
    Bangalore
    India

  • #11
    Super Moderator JohnDubya's Avatar
    Join Date
    Nov 2006
    Location
    Missouri
    Posts
    634
    Thanks
    12
    Thanked 18 Times in 18 Posts
    Well, you're getting the $_GET['id'] for the query, but in your link:

    Code:
    $pg_content = "<a href=\"$self?id=$id\">$article_title</a>";
    You are using $id, which hasn't even been set in your code. That's why the variable isn't showing up. If you use the little snippet I used up above, that will insert the $_GET['id'] into the $id variable. Good luck.

  • #12
    New Coder
    Join Date
    Dec 2006
    Location
    Bangalore
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by JohnDubya View Post
    Well, you're getting the $_GET['id'] for the query, but in your link:

    Code:
    $pg_content = "<a href=\"$self?id=$id\">$article_title</a>";
    You are using $id, which hasn't even been set in your code. That's why the variable isn't showing up. If you use the little snippet I used up above, that will insert the $_GET['id'] into the $id variable. Good luck.
    I am using $self?id=$ad_id
    as i have posted in the detailed code u asked for
    its still not working
    Hemanth
    www.valueads.biz
    Bangalore
    India

  • #13
    Senior Coder
    Join Date
    Jan 2007
    Posts
    1,648
    Thanks
    1
    Thanked 58 Times in 54 Posts
    First, I'd suggest escaping your variables when echoing it.

    PHP Code:
    $link "<a href=\"{$self}?id={$ad_id}\">Link</a>"
    You never know what is happening to $ad_id when it is trying to read it.

    Now, on the actual page in Internet Explorer, right click the link and choose Copy Shortcut. Paste that into here so we know what link it is generating.

    In index.php, before the check for $_GET['id'], put this:

    PHP Code:
    print_r($_GET); 
    Copy the results of that and paste it into here.


  •  

    Posting Permissions

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