Jump to content


  • Posts

  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

jwwceo's Achievements

Advanced Member

Advanced Member (4/5)



  1. I just built a series of pulldowns to send data to my homepage. It works fine...but I also have affiliates who link to my site...and their links go first to another directory and then forwarded to my home page. I want to offer my affiliates the chance to put these pulldowns on their site to increase their sales. When I point the "action" part of the form to the affiliate url, I need the form values from the pulldowns to automatically get passed through to my home page where they can be read. But heres the tricky, part. I can't see the affiliate code because it's encoded in base 64... I decoded it, but it's still pretty cryptic code...uses all their own functions and things. So I want to build a script that will catch the post data and then forward it on to the the next page without interfering with the affiliate script. Is this possible. It all needs to happen automatically...
  2. Check out this page...[url=http://www.liquidcotton.com]www.liquidcotton.com [/url] there is a roll over menu on each item...the javascript I used uses absolute positioning from the top left, so I need to figure out the top and left values for each keyword icon and tell the menus to start there... I know where the first menu goes, as well as how far between them...so I should be able to figure out the top and left values for every shirt on a page...
  3. I am having a hard time wrapping my head around the logic fort this problem. It's probably super easy but I'm new at this so I'm not sure if I'm going in the right direction... I need to find the row and column number for every image in a product gallery. what's the best way to do this.. I know I can start with a while loop for every item in the database...and... $row = 0; $column = 0; and increment based on some if statements..but the exact syntax is evading me.. any help would be great!
  4. I am trying to insert a variable directly into a line of HTML, with no spaces... the line of code I've got looks like this: [code] $selectedshirtid = $info['shirt_id']; echo "<DIV class=menuContainer id=menu'$selectedshirtid'Container>[/code] but this outputs <DIV class=menuContainer id=menu'3'Container> It's not supposed  have the single quote around the variable...should look like this... <DIV class=menuContainer id=menu3Container> if I just put the php variable on it's own with no quotes..it doesn't read at all... Also- can php be used in the HTML header? I can't think of why it wouldn't be able to...but for some reason I remember reading that it can't...
  5. I may not be using that foreach right. The idea is that I store all the keywords and their keyword id's that apply to a shirt in an array called $keywords. Then for each item in the array I output another row in the table... would a while loop be better????
  6. I  am trying to make a product page that will create custom javascript menus for each item on the page. There will be a little icon that once rolled over will make a pop up menu with the keywords for that shirt. The javascript menu I'm using has a block of HTML in the body for each menu. The following code is what I've came up with to build these HTML tables for each menu. I only posted the relevant code...I think.... I think once I get his part done I can get the rest.... I get major parse errors... any ideas....is the logic even right??? [code] //CREATES A LOOP THAT OUTPUTS THE FOLLOWING HTML FOR EACH ROW IN THE DATABASE while($info = mysql_fetch_array($data)){ //PULLS THE KEYWORD DATA FOR EACH ITEM(ROW) $data1 = mysql_query("SELECT * FROM shirtkeywords WHERE shirt_id ='".$info['shirt_id']."') or die(mysql_error()); $keywords = mysql_fetch_array( $data1 )); //BUILD THE JAVASCRIPT HEADER  FOR EACH MENU "<DIV class=menuContainer id=menu$info[shirt_id]Container> <DIV class=menu id=menu$info[shirt_id]Content> <DIV class=menuInsert style='HEIGHT: 180px'> <TABLE class=menuTable cellSpacing=0 cellPadding=0 border=0> <TBODY>"; //BUILD THE TABLE ROWS FOR EACH KEYWORD ASSOCIATED WITH A PRODUCT foreach ($keywords[] as $keyword_id) { echo "<TR>     <TD><IMG height=4 src='menu_script/spacer.gif' width=1></TD></TD>   <TR>     <TD><A class=menuLink href='link'>".keywords['keyword']."</A></TD></TR>     </TBODY> </TABLE></DIV></DIV></DIV>"; } [/code]
  7. I will put my page online and post again in a few hours...
  8. Hello, I designed this little php page to add edit or delete colors(table 1) and keywords( table 2) to or from a databse a database. The color and keywords are then assigned to shirts in a third and fourth table. I just added dumped my databse to to do some testing and when I add in data to the color and keyword tables using this page for some reason they don't show up where they are supposed to be listed unless I refresh my page. But when I refesh sometimes it will add a duplicate entry to my database. I know there is some wierdness going on...but I'm not good enough at this yet to nail it down... any glaring problems...Thanks in advance!!!! JW [code]<html> <link href="style.css" rel="stylesheet" type="text/css"> <link rel="stylesheet" type="text/css" href="ds.css"> <head> <title>LiquidCotton.com Admin - Add Edit Delete Colors/Keywords</title> </head> <body bgcolor="#FFFFFF"> <a href='admin.php'><img src='images/logo.gif' border='0'></a><br> <p><b>ADD EDIT OR DELETE COLORS AND KEYWORDS</b></p> <?php include 'library/config.php'; include 'library/opendb.php'; error_reporting(0); if(isset($_POST['keyupdate'])) { $keyword_id=$_POST['keyword_id']; $newkeyword=$_POST['newkeyword'];   $query="UPDATE keywords SET keyword='$newkeyword' WHERE keyword_id ='$keyword_id'";   $result = mysql_query($query) or die("Error: ". mysql_error(). " with query ". $query); } elseif(isset($_POST['keydelete'])) { $keyword_id=$_POST['keyword_id'];   $query = "DELETE from keywords WHERE keyword_id='$keyword_id'";   $result = mysql_query($query) or die("Error: ". mysql_error(). " with query ". $query);   mysql_query("DELETE FROM shirtkeywords WHERE keyword_id = '$keyword_id'") or die (mysql_query()); } if(isset($_POST['update'])) { $color_id=$_POST['color_id']; $newcolor=$_POST['newcolor'];   $query="UPDATE colors SET color='$newcolor' WHERE color_id ='$color_id'";   $result = mysql_query($query) or die("Error: ". mysql_error(). " with query ". $query); } elseif(isset($_POST['delete'])) { $color_id=$_POST['color_id'];   $query = "DELETE from colors WHERE color_id='$color_id'";   $result = mysql_query($query) or die("Error: ". mysql_error(). " with query ". $query);   mysql_query("DELETE FROM shirtcolors WHERE color_id = '$color_id'") or die (mysql_query()); } if(isset($_POST['submitcolor'])) {   $color=$_POST['color'];   $query="INSERT INTO colors (color)  VALUES ('$color')";     $result = mysql_query($query) or die("Eror: ". mysql_error(). " with query ". $query);     } elseif (isset($_POST['submitkeyword'])) {   $keyword=$_POST['keyword'];   $query="INSERT INTO keywords (keyword)  VALUES ('$keyword')";     $result = mysql_query($query) or die("Eror: ". mysql_error(). " with query ". $query);     } echo "<form method='post' action='addcf.php']'> <TABLE> <TR>   <TD><INPUT TYPE='text' NAME='color' class='cartForm'  size=30></TD>   <td align='left'><INPUT TYPE='submit' name='submitcolor' class='cartForm'  value='Add this Color' size='30'></td> </TR> <TR>   <TD><INPUT TYPE='TEXT' NAME='keyword' class='cartForm'  size=30></TD>   <td align='left'><INPUT TYPE='submit' name='submitkeyword' class='cartForm'  value='Add this Keyword' size='30'></td> </TR> <tr><td colspan='2'><hr></td></tr> <tr><td colspan='2'> <table> <tr><td valign='top'> <table> <tr><td colspan='3' align='center' width=150><b>COLORS</b></td></tr>"; $data = mysql_query('SELECT * FROM colors ORDER BY color ASC') or die(mysql_error()); $info = mysql_fetch_array( $data ); while($info = mysql_fetch_array( $data )) { echo "<form method='post' action =\"$PHP_SELF\"> <tr><td><input type=text name ='newcolor' class='cartForm' value='".$info['color']."' size='15'></td> <td><input type='submit' class='cartForm' name='update' value='update'></td> <td><input type='submit' class='cartForm' name='delete' value='delete'></td>     <input type='hidden' name ='color_id' value='".$info['color_id']."' </tr> </form>"; } echo "</table> </td> <td valign='top'><table> <tr><td colspan='3' align='center' width=150><b>KEYWORDS</b></td></tr>"; $keydata = mysql_query('SELECT * FROM keywords ORDER BY keyword ASC') or die(mysql_error()); $keyinfo = mysql_fetch_array( $keydata ); while($keyinfo = mysql_fetch_array( $keydata )) { echo "<form method='post' action =\"$PHP_SELF\"> <tr><td><input type=text name ='newkeyword' class='cartForm' value='".$keyinfo['keyword']."' size='15'></td> <td><input type='submit' class='cartForm' name='keyupdate' value='update'></td> <td><input type='submit' class='cartForm' name='keydelete' value='delete'></td>     <input type='hidden' name ='keyword_id' value='".$keyinfo['keyword_id']."' </tr> </form>"; } echo "</table> </td> </tr> </table> </tr> </TABLE> </form>"; ?> </body> </html>[/code]
  9. I already have a Style sheet applied...will this style sheet overide the other one for containers of the same type.... how do you make sure that for items like <html> or <p> the right style sheet is being used...
  10. I like the last menu...thanks..1 question.... This may sound stupid..but I don't want to jarble up my <head> with all that css and script data.. can I make one big php file to echo the whole thing and just plop it into my header...and just include the php file.... JW
  11. The menus are supposed to pop up when a link is hovered on, not just change color.... can this be done with CSS??? sorry for not being clear...
  12. I have a databse with three tables. shirts, colors, and shirtcolors. Shirtcolors has 2 fields for the primary keys for both shirts and colors, linking up shirts and what colors thet come in... my customers are going to be selecting a color from a pulldown and I want to have a search results page display all the shirts that have that color... I have never pulled data from 2 tables before...what's the best way to do this????
  13. I want to add some javascript rollover menus to my php pages. But the javascript menu items will be pulled from my MySQL databse. I usually have a seperate .js file which I link in at the top of my HTML... but if this seperate document is a php doc (that outputs javascript) will this still work.. what's the best way to go about this????
  14. I have 3 tables in my databse...shirts, colors, and shirtcolor. The third table, shirtcolor, has just 2 columns; the shirt_id from shirts and color_id from colors. Whenever I delete a shirt I also want to delete all the rows from shirtcolor where there is a row with the same shirt_id. Likewise, if I delete a color I want all references to it in shirtcolor to be deleted as well.... Do I need to set up foreign keys in my third table or can I just make the delete queries on my own manually. if I can do them manually what is the point of the foreign keys? if I assigna foreign key, will the related rows be deleted automatically???
  15. Thank you Liam! You have been very helpful on this part of my project...arrays are still a little confusing and I don't know that many commands to work with them...you've shown me some cool things!!! thanks! James
  • 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.