Welcome to WebmasterWorld Guest from 54.227.125.200

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

Netscape/PHP problem

IE sees links where NS doesn't

     

sarkye

10:58 pm on Oct 19, 2001 (gmt 0)

10+ Year Member



If someone can figure this out I'd be *so* grateful.
I have a PHP page pulling data from a mySQL d/base. The same thing pretty much on two different sites. One site works perfect with this code (excerpt):

//get columns
$id = $row[0];
$company = $row[1];
$url = $row[2];
$description = $row[3];

print("<tr>\n");

print("<td valign=\"top\" rowspan=\"2\">\n");
print("<script language=\"Javascript\">");
print("<!--\n");
print("expnew(\"$newexpire\")\n");
print("//-->\n");
print("</script></td>\n");
print("<td width=\"50%\" class=\"category\" nowrap><strong>$company</strong></td>\n");
print("<td><img src=\"images/pixel.gif\" width=\"10\" height=\"1\" alt=\"\" border=\"0\"></td>\n");
**this is the line in question (works in this site)**print("<td><a href=\"http://$url\" class=\"link\">$url</a></td>\n");
print("<td><img src=\"images/pixel.gif\" width=\"10\" height=\"1\" alt=\"\" border=\"0\"></td>\n");

print("</tr>\n");

The second site builds the page but the links aren't active in NS. Code excerpt for this one is:

// get each row
while($row = mysql_fetch_row($mysql_result))
{
//get columns
$id = $row[0];
$title = $row[1];

print("<tr>\n");
print("<td width=\"20\"><img src=\"../images/pixel.gif\" width=\"20\" height=\"1\" alt=\"\" border=\"0\"></td>\n");
**This is the line in question (will not build a clikable link in NS)**print("<td><a href=\"select.php?article=$id\" class=\"article\">$title</a></td>\n");
print("</tr>\n");
print("<tr>\n");
print("<td colspan=\"2\"> </td>\n");
print("</tr>\n");

I'm tearing my hair out here!! I've tried removing the variable but NS still won't build a link.

NS also puts huge ugly spaces between the rows of the table...why?????

If I need to give more info please let me know. This is kind of an urgent case too, the site's been live like this for two months and I didn't know!

sugarkane

12:21 am on Oct 20, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



>>print("<td><a href=\"select.php?article=$id\" class=\"article\">$title</a></td>\n");<<

Hmmm, the only thing I can think of is that $id is confusing PHP somehow -- maybe try:

$id=urlencode($id);

...before passing $id to select.php

sarkye

12:43 am on Oct 20, 2001 (gmt 0)

10+ Year Member



hello again sugarcane :)

I tried what you suggested and it didn't work unfortunately.

Like I said, I tried removing the variable entirely but Netscape won't even build a link that just goes to select.php.

This same exact thing works like a charm on one of my other sites! What gives Netscape??

Air

1:12 am on Oct 20, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Can you post the snippet of the resulting HTML the script prints out for that section? preferably from Netscape "view source", it may help to solve this one if you can :)

sarkye

1:26 am on Oct 20, 2001 (gmt 0)

10+ Year Member



You bet Air:

<tr>
<td width="20"><img src="../images/pixel.gif" width="20" height="1" alt="" border="0"></td>
<td><a href="select.php?article=13" class="article">Negativity in the Workplace - Part 2</a></td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>

baffling, isn't it?

Air

2:22 am on Oct 20, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You're right, it is baffling :) So if you take the complete "Page source" from netscape and save it as static HTML it works? I just keep thinking that it's an HTML error somewhere earlier up the html code from the snippet you posted, preventing netscape from displaying that part of the table with the link. IE.x would of course ignore a mismatched <td> or <tr> tag but netscape won't. It's a possibility, and one of the few things that I can think of that would produce that result, 'cause the snippet you posted works fine everywhere :)

sarkye

2:35 am on Oct 20, 2001 (gmt 0)

10+ Year Member



You're on the exact same wavelength I was on...I've tried saving the source and *previewing* it in Netscape and it works just fine if I don't actually save the file, but here's the *really* wierd thing, if I save it as an .html file and then preview it again, I'm back to square one again - no links.
The super-wierd thing is that the output HTML creates the page exatly as I want it. The link text is there and it even has the right CSS style applied, it's just not a link *and* the text can't be selected when viewing in Netscape - it's as if it's not even on the page.

Wanna see the full source for the PHP file and resulting HTML? Or have you had enough? ;)

Air

3:02 am on Oct 20, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Sure, but if it's too long you may want to use e-mail or sticky-mail(see top of the screen for sticky mail link), I'll post back what I find (if anything :( ) in case others are interested. It sure looks weird though :)

sarkye

3:13 am on Oct 20, 2001 (gmt 0)

10+ Year Member



OK, I sent the .php and the HTML result as two seperate messages to your Stickymail. Thank you for helping with this!

If you want to see the pages I have on another site - doing the same thing but *working* - let me know.

:)

Air

3:53 am on Oct 20, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Guess what? It works for me even if I save it, but.... I don't have the style sheet, so why not try it without the style sheet and if that works then at least you'll have a target to focus on. The script looks fine.

sarkye

4:21 am on Oct 20, 2001 (gmt 0)

10+ Year Member



You - are - soooooooo - goooooood!!!!

It works it works it works....

I removed the stylesheet and just like you said, the page worked...so...I looked at the .css file to see what I could tweak, in case you're curious, which I'm sure you are after you were kind enough to spend time looking at my php :)... I had a padding attribute and an align attribute among other things, and after fiddling with various combinations, removing those fixed it *and* it fixed the butt ugly monstrous white spaces between the rows in my table...

Thank you *so* much Air :)

Air

5:43 am on Oct 20, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



:)
 

Featured Threads

Hot Threads This Week

Hot Threads This Month