Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: Need help with this part of a script - think it is HTML

  1. #1
    Join Date
    May 2005
    Posts
    42
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Need help with this part of a script - think it is HTML

    Hi ALL -

    This is at the end of Matt's simple search script. You can see the entire script if you want to go here. ( http://www.scriptarchive.com/search.html ). I need to get the part that I copied below centered on the page with a border around it. I have tried everything and nothing has worked. Below is the original, unedited, script. If you go to:

    http://www.ados.com/~vanover/a2/index.htm

    and search for (type in the search box on the lower right) pcmm you will see how the results page is to the left of the window with no border.

    sub return_html {
    print "Content-type: text/html\n\n";
    print "<html>\n <head>\n <title>Search Results</title>\n </head>\n";
    print "<body bgcolor=\"white\" link=\"black\" vlink=\"orange\">";
    print "<table width=\"720\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
    print "<tr><td><img src=\"/images/topgradient.jpg\"></td></tr>";
    print "<tr><td><img src=\"/images/LogoHeader.jpg\"></td></tr>";
    print "</table><font face=\"Verdana,Tahoma,Arial\">";
    print "\n <center>\n <h1>Search Results</h1>\n </center>\n";
    print "Below are the results of your Search:<p>\n";
    print "<ul>\n";
    foreach $key (keys %include) {
    if ($include{$key} eq 'yes') {
    print "<li><a href=\"$baseurl$key\">$titles{$key}</a>\n";
    }
    }
    print "</ul>\n";
    print "<a href=\"$title_url\">Back to $title</a>\n";
    print "<table width=\"720\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
    print "<tr><td><img border=\"0\" src=\"/images/bottomgradient.jpg\"></td></tr></table>";
    print "</body>\n</html>\n";
    }

    If I can get it centered, it will make the whole site consistent. Any help would be greatly appreciated! Thank you.

  2. #2
    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

    Did you try:

    Code:
    sub return_html {
    print "Content-type: text/html\n\n";
    print "<html>\n <head>\n <title>Search Results</title>\n </head>\n";
    print "<body bgcolor=\"white\" link=\"black\" vlink=\"orange\"><center>";
    print "<table width=\"720\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
    print "<tr><td><img src=\"/images/topgradient.jpg\"></td></tr>";
    print "<tr><td><img src=\"/images/LogoHeader.jpg\"></td></tr>";
    print "</table><font face=\"Verdana,Tahoma,Arial\">";
    print "\n <center>\n <h1>Search Results</h1>\n </center>\n";
    print "Below are the results of your Search:<p>\n";
    print "<ul>\n";
    foreach $key (keys %include) {
    if ($include{$key} eq 'yes') {
    print "<li><a href=\"$baseurl$key\">$titles{$key}</a>\n";
    }
    }
    print "</ul>\n";
    print "<a href=\"$title_url\">Back to $title</a>\n";
    print "<table width=\"720\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
    print "<tr><td><img border=\"0\" src=\"/images/bottomgradient.jpg\"></td></tr></table>";
    print "</center></body>\n</html>\n";
    }
    - John
    ________________________

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

  3. #3
    Join Date
    May 2005
    Posts
    42
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hi John -

    Thank you for your reponse! I thought that work too, but alas it did not. I thought it would. After your post, I tried it again - still no luck. Any other suggestion(s)?

    Thanks John!

  4. #4
    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

    I'd try putting the ul inside a centered table's cell:
    Code:
    sub return_html {
    print "Content-type: text/html\n\n";
    print "<html>\n <head>\n <title>Search Results</title>\n </head>\n";
    print "<body bgcolor=\"white\" link=\"black\" vlink=\"orange\">";
    print "<table width=\"720\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
    print "<tr><td><img src=\"/images/topgradient.jpg\"></td></tr>";
    print "<tr><td><img src=\"/images/LogoHeader.jpg\"></td></tr>";
    print "</table><font face=\"Verdana,Tahoma,Arial\">";
    print "\n <center>\n <h1>Search Results</h1>\n </center>\n";
    print "Below are the results of your Search:<p>\n";
    print "<table align=\"center\" width=\"50%\"><tr><td><ul>\n";
    foreach $key (keys %include) {
    if ($include{$key} eq 'yes') {
    print "<li><a href=\"$baseurl$key\">$titles{$key}</a>\n";
    }
    }
    print "</ul></td></tr></table>\n";
    print "<a href=\"$title_url\">Back to $title</a>\n";
    print "<table width=\"720\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">";
    print "<tr><td><img border=\"0\" src=\"/images/bottomgradient.jpg\"></td></tr></table>";
    print "</body>\n</html>\n";
    }
    I mean, most of it is just HTML with double quotes escaped, so it should be possible to work it out one way or the other. The '%' in 50% may have to be escaped too, not sure. If so, it would be:
    Code:
    width=\"50\%\"
    - John
    ________________________

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

  5. #5
    Join Date
    May 2005
    Posts
    42
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hi John -

    Thank you again! Just now tried that and it still didn't move. I am really stumped on this. Actually, I have been working on this for several days. lf you think of anything else, I would be so glad to give it a try.

  6. #6
    Join Date
    Jul 2005
    Location
    Kuwait-I'm American
    Posts
    127
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    why not try css to format it so everything will be in the middle?
    //\\ //\\// || //\\//\\ //\\ ||_
    SOFTWARE

  7. #7
    Join Date
    Jul 2005
    Location
    Kuwait-I'm American
    Posts
    127
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    what language is it any ways??? If it is html why not use the basi:

    <p align="...">
    </p>

    ...="left","center","right"
    //\\ //\\// || //\\//\\ //\\ ||_
    SOFTWARE

  8. #8
    Join Date
    May 2005
    Posts
    42
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hi -

    And thanks for the responses! I have a new twist to this one. I am sure there is a "gremlin" somewhere. I deleted the cgi-bin folder and any other files in folders that had the name search.pl. Front Page <sigh> can sure be a stinker at times. I have a feeling this is one of them. Nonetheless, all files dealing with the search code have been deleted. Thought I would start from scratch. HOWEVER - after all that - I tried a search and it STILL WORKS as if the files were still there (even had someone try it on their computer with the same result). Talk about being stumped. Can anyone shed some light on this? ...please as I have no brain cells left!

  9. #9
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Now this is odd.
    I've actually had this happen to me before - the webserver serve up a file that isn't there any more - but it shouldn't have happened on someone else's computer as well.
    I think it might, as you suspect, be a FrontPage problem. FrontPage is never worth the bother. I am against the idea of WYSIWYG editors in the first place, but FrontPage (by report) seems to be by far the worst.

    Does it work if you edit it in something else?
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  10. #10
    Join Date
    May 2005
    Posts
    42
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Forgot to say - HTML and now Server Quirk

    What a relief to know it has happened to someone else - thought I had lost it for sure. I would never use FP (especially from what I know now). This was a case of working with what was already there. The site is rather large so I have to work with it the way it is BUT (lol) guess I will see if in time the code disappears. I am not sure of anything I can do even with hand-coding, since the files are not there now. Have to think on this for a bit. hmmmmmmmm JUST what I needed!

    Thanks for letting me know of your experience. How did you address the issue?

    I forgot to say that I am/have been editing the code in Another Notepad (it is like Notepad - pretty basic).
    Last edited by fmv503; 07-05-2005 at 06:59 PM. Reason: Forgot to say

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
  •