Jump to content

dannel77

Members
  • Posts

    22
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

dannel77's Achievements

Member

Member (2/5)

0

Reputation

  1. Hi, I am trying to make it possible to link to a product page on our website from an external link, directly into the frameset of our site. If someone could help me solve this I'd be really greatful. A direct link (from an external URL) to a product page looks like this: http://www.myhomepage.se/item_show.php?code_no=100090C The index.php as it looks now: [code]<frameset cols="*,900,*" framespacing="0" frameborder="0" border="0"> <frame name="left" frameborder="0" scrolling="no" src="bg_left.php" noresize marginwidth="0" marginheight="0"> <frame name="center" src="main_frame.php" frameborder="0" noresize marginwidth="0" marginheight="0"> <frame name="right" frameborder="0" scrolling="no" src="bg_right.php" noresize marginwidth="0" marginheight="0"> </frameset>[/code] main_frame.php as it is now: [code]<frameset rows="129,50%" border="0" frameborder="0" marginwidth="0" marginheight="0">       <frame src="top.php" name="top" noresize="noresize" marginwidth="0" marginheight="0" frameborder="0" target="main" scrolling="no">       <frameset rows="92%,40" border="0" frameborder="0">         <frameset cols="182,80%" border="0" frameborder="0">             <frame src="menu_tree.php" name="categories" marginwidth="7" marginheight="6" frameborder="0" target="main" scrolling="auto">             <frame src="main.php" name="main" marginwidth="10" marginheight="7" frameborder="0" target="_self" scrolling="auto" noresize="noresize">         </frameset>         <frameset cols="171,80%" border="0" frameborder="0">             <frame src="middle_left.php" name="cart" noresize="noresize" marginwidth="0" marginheight="0" border="0" frameborder="0" scrolling="no">             <frame src="empty.php" name="middle_right" marginwidth="0" marginheight="0" frameborder="0" target="main" scrolling="no">         </frameset>       </frameset>   </frameset>[/code] item_show.php: [code]<?php // required variables require("config.php"); $code_no = mysql_escape_string($_REQUEST['code_no']); ?> <html> <head> <title>Product list</title> <link rel="stylesheet" HREF="master_style.css"> </HEAD> <BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#000000" VLINK="#000000" ALINK="#F70404"> <center> <?php // database connection mysql_connect("$host","$user","$pass"); // database selection mysql_select_db("$database"); // query to get the products of type $category $result = mysql_query("select * from products where(code_no = '$code_no') ORDER BY 'item'"); echo "<FORM NAME=\"itemsform\"> <TABLE BORDER=0 CELLSPACING=0 CELLPADDING=16>"; while($row = mysql_fetch_row($result)) { echo "<TR ALIGN=Left VALIGN=Top><TD><a href=\"item_show2.php?code_no=$row[2]\" TARGET=\"main\"><IMG SRC=\"medium/$row[6]\" BORDER=\"0\"></A></TD> <TD WIDTH=\"100%\"><font size=\"2\" face=\"Verdana, Arial, Helvetica, sans-serif\"><B>$row[3]</B></FONT><P> <P> <font style=\"font-size: 10px; font-family: Verdana, Arial, Helvetica, sans-serif;\">$row[4]</FONT> <P> <TABLE border=0><TD><font style=\"font-size: 10px; font-family: Verdana, Arial, Helvetica, sans-serif;\"> <B>$txt_price $txt_currency:&nbsp;</B> $row[5]</FONT>&nbsp;&nbsp;<INPUT TYPE=\"hidden\" NAME=\"id$row[2]quant\" VALUE=\"1\" </TD><TD Valign=top><a href=\"Javascript:top.center.cart.addItem('$row[3]','$row[5]', document.itemsform.id$row[2]quant.value, '$row[2]', '$row[7]')\"><img src=\"images/buy.gif\" border=\"0\"></a></TD></TR></TABLE>"; } ?> </TABLE>[/code]
  2. Hi, I need help modifying this script so that it becomes possible to search multiple fields instead of just one field. As it is now I can search for one specific word (within a table row) but if I try and make a search for 2 words *with another word in between* it doesn't work. Hope I make som sense.. :P $searchstring = trim($searchstring);// remove leading and trailing blanks // Nu bestämmer vi antal per sida och kollar upp totala antalet $limit = 30; // Antal per sida $where = "$chose LIKE '%$searchstring%' OR item LIKE '%$searchstring%' OR code_no LIKE '%$searchstring%'"; $result = @mysql_query("SELECT COUNT(*) FROM products WHERE item LIKE '%$searchstring%' OR code_no LIKE '%$searchstring%'") or die("Error fetching number in DB<br>".mysql_error()); $numrows = @mysql_result($result, 0); // Antal i databasen
  3. Thanks! I'll go through that in the morning! :)
  4. Any way to set the size of the bullets in an <ul><li> list within the css?
  5. Problem solved :) Found some code on the net: html { overflow-x: hidden; overflow-y: auto; }
  6. One problem left... with the changes made I get a horizontal scrollbar at the bottom of the page in IE and I can't remove it.. How do I solve this?
  7. Thanks guys!! When I added that DOCTYPE line to all the pages (probably item_list.php that was important) the problem was solved!  :)
  8. Another thing I was wondering about.. I took a screenshot of the page I'm working with, to show how the bullets (diamonds) of the <ul><li> list in Firefox are tilted slightly upwards, in IE they appear right to the left of the text (as they should), what could be causing this?  :-\ Also Firefox seems to have a problem displaying a real disc instead of a "diamond", any way to solve this? The master_style.css contains: li{list-style: disc; }  [attachment deleted by admin]
  9. Thanx a million man!! Worked fine with a line-height of 150%, now the lists look the same in IE and FF!  :)
  10. No, I have no <p> or <br> within the tags, but I found out today that if I set the font size to 1, the lists look almost the same in IE anf FF.. But since I use a fixed size of 10px IE can't "delete" the whitespace in between.. and the list is as compact with size 1 as with a font size of 10 px.. :-\
  11. Have tried it now, but it makes now difference, the space between the lines are still there.. and the list is much more compact in Firefox..
  12. The list looks fine in Firefox, but in IE there are som gaps between the lines, the list is an ordinary: <ul><li> unordered list.. I'm trying to make the lists look identical in both browsers but it's much more compact in Firefox, and in IE there appears to be some "padding" or something around every textstring.. Have searched the net for a solution and heard of this bug in IE, does somene here have a solution for this problem? The CSS file look like this right now: li{list-style: disc; } li{margin: 0; padding: 0;}
  13. Hi, I need some help to modify this search script so that "whitespaces" (blanks) are removed when searching, I have tried with "trim" but can't seem to get it right, any help would be appreciated, the code looks like this: <?php // database connection mysql_connect("$host","$user","$pass"); // database selection mysql_select_db("$database"); // Nu bestämmer vi antal per sida och kollar upp totala antalet $limit = 40; // Antal per sida $where = "$chose LIKE '%$searchstring%' OR item LIKE '%$searchstring%' OR code_no LIKE '%$searchstring%'"; $result = @mysql_query("SELECT COUNT(*) FROM products WHERE item LIKE '%$searchstring%' OR code_no LIKE '%$searchstring%'") or die("Error fetching number in DB<br>".mysql_error()); $numrows = @mysql_result($result, 0); // Antal i databasen // Sedan kollar vi om startvariabeln är satt $start = isset($_GET['start']) && intval($_GET['start']) >= 0 ? intval($_GET['start']) : 0; // Då räknar vi ut hur många sidor det blev $pages = intval($numrows/$limit); if ($numrows % $limit) { $pages++; } $numlink = ''; // Hämta länk till föregående sida if ($start > 0) { $numlink .= '<a href="?start='.($start - $limit).'&amp;searchstring='.$searchstring.'"><font color="#2B65EC" style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px;">&laquo; </font></a> '; } else { $numlink .= '&laquo;  '; } // Hämta sidonummer for ($i = 1; $i <= $pages; $i++) { $newoffset = $limit*($i-1); if ($start == $newoffset) $numlink .= '<font style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px; padding: 0px 1"><b>'.$i.'</b></font> '; else $numlink .= '<a href="?start='.$newoffset.'&amp;searchstring='.$searchstring.'"><font style="color: #2B65EC;"><font style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px; padding: 0px 1"><u>'.$i.'</u></font></font></a> '; } // Hämta länk till nästa sida if ($numrows > ($start + $limit)) $numlink .= '<a href="?start='.($start + $limit).'&amp;searchstring='.$searchstring.'"><font color="#2B65EC" style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px;"> &raquo;</font></a> '; else $numlink .= ' &raquo; '; $numlink = ' <div style="font-size: 11px; font-family: Verdana, Arial, Helvetica, sans-serif; padding: 5px 0;"> '.$numlink.' </div> '; // Skriv ut sidorna echo $numlink; ?> <table cellpadding="2" cellspacing="1" border="1" frame="border" RULES="NONE" borderstyle="color: #D5E2EC;"> <TR><TD BGCOLOR="#D5E2EC"> <TD BGCOLOR="#D5E2EC" ALIGN="left"><font face="Verdana, Arial, Helvetica, sans-serif" size="-2" color="Black"><b> Art nr. </b></FONT></TD> <TD BGCOLOR="#D5E2EC" ALIGN="left"><font face="Verdana, Arial, Helvetica, sans-serif" size="-2" color="Black"><b> Titel </b></FONT></TD> <TD BGCOLOR="#D5E2EC" ALIGN="right"><font face="Verdana, Arial, Helvetica, sans-serif" size="-2" color="Black"><b> Pris SEK </b></FONT></TD> <TD BGCOLOR="#D5E2EC"></TD></TR> <?php // Nu kan vi hämta datan från databasen och skriva ut den $result = @mysql_query("SELECT * FROM products WHERE $where ORDER BY item ASC LIMIT $start, $limit") or die("Error fetching data<br>".mysql_error()); while ($row = @mysql_fetch_array($result)){ $color = ($coloralternator++ %2 ? "D5E2EC" : "EBF1F5"); echo "<TR BGCOLOR=\"#$color\"><TD ALIGN=\"middle\"><a href=\"item_show.php?code_no=$row[2]\" TARGET=\"main\"><IMG SRC=\"thumbs/$row[6]\" BORDER=\"0\"></a></TD>"; echo "<TD ALIGN=\"left\"><font style=\"font-size: 10px; font-family: Verdana, Arial, Helvetica, sans-serif;\"><a href=\"item_show.php?code_no=$row[2]\" TARGET=\"main\"> $row[2] </FONT></TD>"; echo "<TD ALIGN=\"left\"></a><font style=\"font-size: 10px; font-family: Verdana, Arial, Helvetica, sans-serif;\"><a href=\"item_show.php?code_no=$row[2]\" TARGET=\"main\"> $row[3] </FONT></TD>"; echo "<TD ALIGN=\"right\"></a><font style=\"font-size: 10px; font-family: Verdana, Arial, Helvetica, sans-serif;\"> $row[5] </font></TD>"; echo "<TD ALIGN=\"middle\"> <INPUT TYPE=\"hidden\" NAME=\"id$row[2]quant\" VALUE=\"1\"> <a href=\"Javascript:top.center.cart.addItem('$row[3]','$row[5]', document.itemsform.id$row[2]quant.value, '$row[2]', '$row[7]')\"><img src=\"images/buy.gif\" border=\"0\"></a>  </TD></TR>"; } "</center>" ?> </TABLE>
  14. thx for the tip, if you could please take a look at the code of the page and tell me where this 'chose=code_no' should be put in I'd be really grateful. I'm not sure where the "querystring" is.. The whole page (search_list.php) looks like this: <?php // required variables require("config.php"); $chose_allowed = array('item', 'maingroup', 'secondgroup'); $chose = isset($_GET['chose']) && in_array($_GET['chose'], $chose_allowed) ? $_GET['chose'] : $chose_allowed[1]; $searchstring = isset($_GET['searchstring']) ? mysql_escape_string($_GET['searchstring']) : ''; ?> <html> <head> <title>Search List</title> <link rel="stylesheet" HREF="master_style.css"> </HEAD> <BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#000000" VLINK="#000000" ALINK="#F70404"> <FORM NAME="itemsform"> <CENTER> <font style="font-size: 10px; font-family: Verdana, Arial, Helvetica, sans-serif;"> <?php echo $txt_search_result ?> "<?php echo $searchstring ?>"</FONT> <HR WIDTH=95% size=1 COLOR="#000000"> <center> <?php // database connection mysql_connect("$host","$user","$pass"); // database selection mysql_select_db("$database"); // Nu bestämmer vi antal per sida och kollar upp totala antalet $limit = 40; // Antal per sida $where = "$chose LIKE '%$searchstring%'"; $result = @mysql_query("SELECT COUNT(*) FROM products WHERE $where") or die("Error fetching number in DB<br>".mysql_error()); $numrows = @mysql_result($result, 0); // Antal i databasen // Sedan kollar vi om startvariabeln är satt $start = isset($_GET['start']) && intval($_GET['start']) >= 0 ? intval($_GET['start']) : 0; // Då räknar vi ut hur många sidor det blev $pages = intval($numrows/$limit); if ($numrows % $limit) {   $pages++; } $numlink = ''; // Hämta länk till föregående sida if ($start > 0) {   $numlink .= '<a href="?start='.($start - $limit).'&amp;searchstring='.$searchstring.'">&laquo;&nbsp;</a> '; } else {   $numlink .= '&laquo;&nbsp; '; } // Hämta sidonummer for ($i = 1; $i <= $pages; $i++) {   $newoffset = $limit*($i-1);   if ($start == $newoffset)     $numlink .= '<font style="color: #000000;" style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px;"><b>'.$i.'</b></font> ';   else     $numlink .= '<a href="?start='.$newoffset.'&amp;searchstring='.$searchstring.'"><font style="color: #2B65EC;" style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px;"><u>'.$i.'</u></font></a> '; } // Hämta länk till nästa sida if ($numrows > ($start + $limit))   $numlink .= '<a href="?start='.($start + $limit).'&amp;searchstring='.$searchstring.'">&nbsp;&raquo;</a> '; else   $numlink .= '&nbsp;&raquo; '; $numlink = ' <div style="font-size: 11px; font-family: Verdana, Arial, Helvetica, sans-serif; padding: 5px 0;">   '.$numlink.' </div> '; // Skriv ut sidorna echo $numlink; ?> <table cellpadding="2" cellspacing="1" border="1" frame="border" RULES="NONE" borderstyle="color: #D5E2EC;"> <TR><TD BGCOLOR="#D5E2EC"> <TD BGCOLOR="#D5E2EC" ALIGN="left"><font face="Verdana, Arial, Helvetica, sans-serif" size="-2" color="Black"><b>&nbsp;Art nr.&nbsp;</b></FONT></TD> <TD BGCOLOR="#D5E2EC" ALIGN="left"><font face="Verdana, Arial, Helvetica, sans-serif" size="-2" color="Black"><b>&nbsp;Titel&nbsp;</b></FONT></TD> <TD BGCOLOR="#D5E2EC" ALIGN="right"><font face="Verdana, Arial, Helvetica, sans-serif" size="-2" color="Black"><b>&nbsp;Pris&nbsp;SEK&nbsp;</b></FONT></TD> <TD BGCOLOR="#D5E2EC"></TD></TR> <?php // Nu kan vi hämta datan från databasen och skriva ut den $result = @mysql_query("SELECT * FROM products WHERE $where ORDER BY item ASC LIMIT $start, $limit") or die("Error fetching data<br>".mysql_error()); while ($row = @mysql_fetch_array($result)){ $color = ($coloralternator++ %2 ? "D5E2EC" : "EBF1F5"); echo "<TR BGCOLOR=\"#$color\"><TD ALIGN=\"middle\"><a href=\"item_show.php?code_no=$row[2]\" TARGET=\"main\"><IMG SRC=\"thumbs/$row[6]\" BORDER=\"0\"></a></TD>"; echo "<TD ALIGN=\"left\"><font style=\"font-size: 10px; font-family: Verdana, Arial, Helvetica, sans-serif;\"><a href=\"item_show.php?code_no=$row[2]\" TARGET=\"main\">&nbsp;$row[2]&nbsp;</FONT></TD>"; echo "<TD ALIGN=\"left\"></a><font style=\"font-size: 10px; font-family: Verdana, Arial, Helvetica, sans-serif;\"><a href=\"item_show.php?code_no=$row[2]\" TARGET=\"main\">&nbsp;$row[3]&nbsp;</FONT></TD>"; echo "<TD ALIGN=\"right\"></a><font style=\"font-size: 10px; font-family: Verdana, Arial, Helvetica, sans-serif;\">&nbsp;$row[5]&nbsp;</font></TD>"; echo "<TD ALIGN=\"middle\">&nbsp;<INPUT TYPE=\"hidden\" NAME=\"id$row[2]quant\" VALUE=\"1\"> <a href=\"Javascript:top.center.cart.addItem('$row[3]','$row[5]', document.itemsform.id$row[2]quant.value, '$row[2]', '$row[7]')\"><img src=\"images/buy.gif\" border=\"0\"></a>&nbsp;&nbsp;</TD></TR>"; } "</center>" ?> </TABLE>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.