homepage Welcome to WebmasterWorld Guest from 54.163.84.199
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
Netscape/PHP problem
IE sees links where NS doesn't
sarkye




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

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




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

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




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

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




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

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




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

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




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

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




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

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




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

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




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

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




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

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




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

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




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

:)

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved