Jump to content

piznac

Members
  • Posts

    261
  • Joined

  • Last visited

Everything posted by piznac

  1. Not sure if this is what you want but try this: <?php if(empty($website)){ echo "N/A"; }else{ echo "<a href=\"$website\"class=\"style3\" target=\"_blank\">Link</a> ";}?> Sorry had to modify,.. Im a bit slow this afternoon LOL
  2. ok even more to think about,. thanks man!
  3. Ok,.. cant seem to wrap my head around this. If I had a string,.. say: $string ="<body bgcolor="#CCCCCC" onLoad="MM_preloadImages('images/more_details_over.jpg')"> <table width="750" border="0" align="center" cellpadding="0" cellspacing="0" > <tr> <td colspan="8"><img src="images/top_logo.jpg" alt="Embroidery Services, Custom Embroidery, Corporate Apparel & Promotion/Corporate Apparel" width="750" height="104"></td> </tr> </table> <table width="750" border="0" align="center" bgcolor="#830000"> <tr> <td width="49"> </td> <td width="65" class="nav"> <div align="center"><a href="index.php">HOME</a></div></td> <td width="112" class="nav"> <div align="center"><a href="digitizing.php">DIGITIZING</a></div></td> <td width="97" class="nav"> <div align="center"><a href="pricing.php">PRICING</a></div></td> <td width="114" class="nav"> <div align="center"><a href="ordering.php">ORDERING</a></div></td> <td width="204" class="nav"> <div align="center"><a href="production_schedule.php?n=<?php if(isset($_SESSION['MM_Username'])){echo $user;}?>">PRODUCTION SCHEDULE</a></div></td> <td width="86" class="nav"> <div align="center"><a href="contact.php">CONTACT</a></div></td> <td width="48"> </td> </tr> </table> <!-- InstanceBeginEditable name="maincontent" --> <table width="749" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF"> <!--DWLayoutTable--> <tr> <td height="19" valign="top"><!--DWLayoutEmptyCell--> </td> <td colspan="7" valign="top"><div align="center" class="orlist"> <div align="right"><a href="reg.php">Register</a> | <a href="client.php">Log In</a> | <a href="index.php?o=0">Log Out</a> | <a href="ch_pass.php">Change Password</a> </div> </div></td> </tr> <tr> <td width="12" height="37" valign="top"><!--DWLayoutEmptyCell--> </td> <td colspan="4" valign="top"><br> <?php if(isset($_SESSION['MM_Username'])){ $user = $_SESSION['MM_Username']; require_once("/var/www/html/include/classes/csv_upload.inc.php"); $this = new Csv(); $this->cust_bar($user);" Or something like that. How would I pull all the "<a href=''>blah</a>" out of it and apply them to an array or something?
  4. Yep that seems to work,.. hey thanks man,..
  5. Yeah the alerts work,.. and I do have it setup like the 2nd example,.. I'll change it to a "button" and give that a go. Thanks,.. I'll report back,...
  6. Would a iframe within an iframe work?.. Not sure if thats possible but it might work,..
  7. Not sure but not this script continues to send the form even though I have it to return false,.. very new to js,. any help would be nice: <script language="javascript" type="text/javascript"> function valid(){ if(document.or.cust_name.value == ""){ alert('Customer name must be filled out.'); return false; }else if(document.or.add1.value == ""){ alert('Address must be filled out.'); return false; }else if(document.or.state.value == ""){ alert('State must be filled out.'); return false; }else if(document.or.city.value == ""){ alert('City must be filled out.'); return false; }else if(document.or.zip.value == ""){ alert('Zipcode must be filled out.'); return false; }else if(document.or.p_name.value == ""){ alert('Project name must be filled out.'); return false; }else if(document.or.date.value == ""){ alert('Date needed must be filled out.'); return false; }else{ return true; } } </script> This is set on an "onsubmit" btw
  8. Ahhh that does look alot more simple,.. Im so new to JS but Im assuming "cloneNode" will clone the input tags?.. If so thats nice man. I might have to use that next time,.. but I already retyped my select,..lol
  9. DOOOH!!,... LOL,.. thanks a bunch man,... Also does the setting of the class for all inputs work in IE? I've always heard that it didn't?
  10. Ok,.. I have this script that will add a row to my table. This works fine,. but it wont seem to regonize the "class" attribute. Is this becuase "class" is not a proper attribute? If so,. is there a work around for this?.. As you can see I tried e1.class = 'texta' & e1.className = 'texta',... the first one gives me an error of expected indentifier,.. the 2nd one tells me e1 is not defined,.. here is the script,.. and a link to a the page itself: <script language="javascript" type="text/javascript"> <!-- function addRowToTable() { var tbl = document.getElementById('it'); var lastRow = tbl.rows.length; // if there's no header row in the table, then iteration = lastRow + 1 var iteration = lastRow; var row = tbl.insertRow(lastRow); // left cell var cellRight = row.insertCell(0); var el = document.createElement('input'); el.type = 'text'; el.name = 'item_num'; el.id = 'item_num'; el.size = 12; //e1.className = 'texta'; cellRight.appendChild(el); // next cell var cellnext = row.insertCell(1); var e2 = document.createElement('input'); e2.type = 'text'; e2.name = 'item_desc'; e2.id = 'item_desc'; e2.size = 90; //e2.className = 'texta'; cellnext.appendChild(e2); // select cell var cellRightSel = row.insertCell(2); var sel = document.createElement('select'); sel.name = 'size'; sel.id = 'size'; //sel.class = 'texta'; sel.options[0] = new Option('ONE SIZE'); sel.options[1] = new Option('XS'); sel.options[2] = new Option('S'); sel.options[3] = new Option('M'); sel.options[4] = new Option('L'); sel.options[5] = new Option('XL'); sel.options[6] = new Option('2XL'); sel.options[7] = new Option('3XL'); sel.options[8] = new Option('4XL'); sel.options[9] = new Option('1X'); sel.options[10] = new Option('2X'); sel.options[11] = new Option('3X'); sel.options[12] = new Option('4X'); sel.options[13] = new Option('5X'); sel.options[14] = new Option('6X'); sel.options[15] = new Option('YXS'); sel.options[16] = new Option('YS'); sel.options[17] = new Option('YM'); sel.options[18] = new Option('YL'); sel.options[19] = new Option('YXL'); sel.options[20] = new Option('6M'); sel.options[21] = new Option('12M'); sel.options[21] = new Option('T2'); sel.options[23] = new Option('T4'); sel.options[24] = new Option('XXL'); sel.options[25] = new Option('XXXL'); sel.options[26] = new Option('XXXXL'); sel.options[27] = new Option('XXXXXL'); sel.options[28] = new Option('XXXXXXL'); sel.options[29] = new Option('OSFM'); sel.options[30] = new Option('OSFA'); sel.options[31] = new Option('1XL'); sel.options[32] = new Option('SMALL'); sel.options[33] = new Option('MEDIUM'); sel.options[34] = new Option('LARGE'); sel.options[35] = new Option('5XL'); sel.options[36] = new Option('0'); sel.options[37] = new Option('0-6M'); sel.options[38] = new Option('12-18M'); sel.options[39] = new Option('18-24M'); sel.options[40] = new Option('2'); sel.options[41] = new Option('2T'); sel.options[42] = new Option('3-6M'); sel.options[43] = new Option('3T'); sel.options[44] = new Option('4'); sel.options[45] = new Option('4T'); sel.options[46] = new Option('6'); sel.options[47] = new Option('6-12M'); sel.options[48] = new Option('8'); sel.options[49] = new Option('L-XL'); sel.options[50] = new Option('Plus2X'); sel.options[51] = new Option('Plus3X'); sel.options[52] = new Option('Plus4X'); sel.options[53] = new Option('S-M'); sel.options[54] = new Option('XXS'); sel.options[55] = new Option('10-12Y'); sel.options[56] = new Option('14-16'); sel.options[57] = new Option('18-20'); sel.options[58] = new Option('18M'); sel.options[59] = new Option('24M'); sel.options[60] = new Option('2XG'); sel.options[61] = new Option('5-6Y'); sel.options[62] = new Option('6-8Y'); sel.options[63] = new Option('7Y'); sel.options[64] = new Option('AO'); sel.options[65] = new Option('2XL-3XL'); sel.options[66] = new Option('6XL'); sel.options[67] = new Option('Plus1X'); sel.options[68] = new Option('W27'); sel.options[69] = new Option('W28'); sel.options[70] = new Option('W29'); sel.options[71] = new Option('W30'); sel.options[72] = new Option('W31'); sel.options[73] = new Option('W32'); sel.options[74] = new Option('W33'); sel.options[75] = new Option('W34'); sel.options[76] = new Option('W35'); sel.options[77] = new Option('W36'); sel.options[78] = new Option('W37'); sel.options[79] = new Option('W38'); sel.options[80] = new Option('W40'); sel.options[81] = new Option('W42'); sel.options[82] = new Option('W44'); sel.options[83] = new Option('W46'); sel.options[84] = new Option('W48'); sel.options[85] = new Option('W50'); sel.options[86] = new Option('W52'); sel.options[87] = new Option('W54'); sel.options[88] = new Option('W56'); sel.options[89] = new Option('W58'); sel.options[90] = new Option('W60'); cellRightSel.appendChild(sel); // right cell var cellfarRight = row.insertCell(3); var e4 = document.createElement('input'); e4.type = 'text'; e4.name = 'qty'; e4.id = 'qty'; //e4.class = 'texta'; cellfarRight.appendChild(e4); } http://www.sewnice.biz/ordering3.php If you go to the example and click "add row" you will see my problem,. the add row works but does not keep the style,.. any help would be great thanks!
  11. It looks good to me,... Do{ }while will run the statement once even if the while is not true.
  12. try this: $MSRPQUERY="SELECT `MSRP` FROM SIPRODUCTTABLE WHERE `CAMERAMODEL` = '$CAMERAMODEL'"; Might work Whoops to late
  13. I found this article to be entertaining: http://www.unixwiz.net/techtips/sql-injection.html
  14. Well its semms I have over complicated this,.. all I want is to update multiple records at once. I had this before: <?php function insert_rows($item_num,$item_desc,$item_qty,$emb_loc1,$num,$size,$artwork,$num2){ $flds = array( 'item_num' , 'item_desc' , 'item_qty' , 'emb_loc1', 'num', 'size', 'artwork'); for($i=0;$i<count($num2);$i++) { $qtmp = array(); foreach($flds as $fld){ if (trim(stripslashes($_POST[$fld][$i])) != ''){ $qtmp[] = $fld . " = '" . mysql_escape_string(trim(stripslashes($_POST[$fld][$i]))) . "'"; } } $q = "UPDATE c_or_details SET " . implode(', ',$qtmp) . " WHERE `subitemnum` = '$num2'"; $rs = mysql_query($q) or die ('Problem with 1 the query: ' . $q . '<br>' . mysql_error()); echo "$q<br /> <br />"; } } ?> But it would simply use "array" as $num2 var over and over again. Producing these results: UPDATE c_or_details SET item_num = '1', item_desc = '2', item_qty = '2', emb_loc1 = 'Left Chest', size = 'ONE SIZE', artwork = 'DSCN3361.jpg' WHERE `subitemnum` = 'Array' UPDATE c_or_details SET item_num = '2', item_desc = '2', item_qty = '2', emb_loc1 = 'Left Chest', size = 'ONE SIZE', artwork = 'DSCN3361.jpg' WHERE `subitemnum` = 'Array' I just need to be able to loop through all the records and update WHERE `subitemnum` = '$num2'
  15. There are two different functions here,... the last example I gave is of the first function. $num2 is my primary key in that table. And its retrieved the same way the "$subnum" was.
  16. with or without the curly braces,.. it produces the same results. <?php //insert secondary order info function insert_rows($item_num,$item_desc,$item_qty,$emb_loc1,$num,$size,$artwork,$num2){ print_r($num2); $flds = array( 'item_num' , 'item_desc' , 'item_qty' , 'emb_loc1', 'num', 'size', 'artwork'); for($i=0;$i<count($num2);$i++) { $qtmp = array(); foreach($flds as $fld){ if (trim(stripslashes($_POST[$fld][$i])) != ''){ $qtmp[] = $fld . " = '" . mysql_escape_string(trim(stripslashes($_POST[$fld][$i]))) . "'"; } } foreach($num2 as $num3){ $q = "UPDATE c_or_details SET " . implode(', ',$qtmp) . " WHERE `subitemnum` = '$num3'"; $rs = mysql_query($q) or die ('Problem with 1 the query: ' . $q . '<br>' . mysql_error()); echo "$q<br /> <br />"; } } }?> <?php //insert secondary order info function insert_rows($item_num,$item_desc,$item_qty,$emb_loc1,$num,$size,$artwork,$num2){ print_r($num2); $flds = array( 'item_num' , 'item_desc' , 'item_qty' , 'emb_loc1', 'num', 'size', 'artwork'); for($i=0;$i<count($num2);$i++) { $qtmp = array(); foreach($flds as $fld) if (trim(stripslashes($_POST[$fld][$i])) != '') $qtmp[] = $fld . " = '" . mysql_escape_string(trim(stripslashes($_POST[$fld][$i]))) . "'"; foreach($num2 as $num3){ $q = "UPDATE c_or_details SET " . implode(', ',$qtmp) . " WHERE `subitemnum` = '$num3'"; $rs = mysql_query($q) or die ('Problem with 1 the query: ' . $q . '<br>' . mysql_error()); echo "$q<br /> <br />"; } } } ?> both produce this: Array ( [0] => 234 [1] => 235 ) UPDATE c_or_details SET item_num = '1', item_desc = '2', item_qty = '2', emb_loc1 = 'Left Chest', size = 'ONE SIZE', artwork = 'DSCN3361.jpg' WHERE `subitemnum` = '234' UPDATE c_or_details SET item_num = '1', item_desc = '2', item_qty = '2', emb_loc1 = 'Left Chest', size = 'ONE SIZE', artwork = 'DSCN3361.jpg' WHERE `subitemnum` = '235' UPDATE c_or_details SET item_num = '2', item_desc = '2', item_qty = '2', emb_loc1 = 'Left Chest', size = 'ONE SIZE', artwork = 'DSCN3361.jpg' WHERE `subitemnum` = '234' UPDATE c_or_details SET item_num = '2', item_desc = '2', item_qty = '2', emb_loc1 = 'Left Chest', size = 'ONE SIZE', artwork = 'DSCN3361.jpg' WHERE `subitemnum` = '235'
  17. Man it gets all messed up when I try that,..lol How would you go about updating multiople rows at once? Like if you had item1[],item2[],item3[] ect,.. and a corresponding table?
  18. Ok when I run the first function,.. for the var $num2 I get this: Array ( [0] => 216 [1] => 217 [2] => 218 [3] => 219 ) So it would appear that its only running it once,.. but it still does the sql statement times the amount of entries,.. twice. So if there are four records it runs it 16 times. Like this: Array ( [0] => 216 [1] => 217 [2] => 218 [3] => 219 ) UPDATE c_or_details SET item_num = '1', item_desc = '2', item_qty = '2', emb_loc1 = 'Left Chest', size = 'ONE SIZE', artwork = 'Winter.jpg' WHERE `subitemnum` = '216' UPDATE c_or_details SET item_num = '1', item_desc = '2', item_qty = '2', emb_loc1 = 'Left Chest', size = 'ONE SIZE', artwork = 'Winter.jpg' WHERE `subitemnum` = '217' UPDATE c_or_details SET item_num = '1', item_desc = '2', item_qty = '2', emb_loc1 = 'Left Chest', size = 'ONE SIZE', artwork = 'Winter.jpg' WHERE `subitemnum` = '218' UPDATE c_or_details SET item_num = '1', item_desc = '2', item_qty = '2', emb_loc1 = 'Left Chest', size = 'ONE SIZE', artwork = 'Winter.jpg' WHERE `subitemnum` = '219' UPDATE c_or_details SET item_num = '2', item_desc = '3', item_qty = '3', emb_loc1 = 'Left Chest', size = 'ONE SIZE', artwork = 'Winter.jpg' WHERE `subitemnum` = '216' UPDATE c_or_details SET item_num = '2', item_desc = '3', item_qty = '3', emb_loc1 = 'Left Chest', size = 'ONE SIZE', artwork = 'Winter.jpg' WHERE `subitemnum` = '217' UPDATE c_or_details SET item_num = '2', item_desc = '3', item_qty = '3', emb_loc1 = 'Left Chest', size = 'ONE SIZE', artwork = 'Winter.jpg' WHERE `subitemnum` = '218' UPDATE c_or_details SET item_num = '2', item_desc = '3', item_qty = '3', emb_loc1 = 'Left Chest', size = 'ONE SIZE', artwork = 'Winter.jpg' WHERE `subitemnum` = '219' UPDATE c_or_details SET item_num = '3', item_desc = '2', item_qty = '2', emb_loc1 = 'Left Chest', size = 'ONE SIZE', artwork = 'Winter.jpg' WHERE `subitemnum` = '216' UPDATE c_or_details SET item_num = '3', item_desc = '2', item_qty = '2', emb_loc1 = 'Left Chest', size = 'ONE SIZE', artwork = 'Winter.jpg' WHERE `subitemnum` = '217' UPDATE c_or_details SET item_num = '3', item_desc = '2', item_qty = '2', emb_loc1 = 'Left Chest', size = 'ONE SIZE', artwork = 'Winter.jpg' WHERE `subitemnum` = '218' UPDATE c_or_details SET item_num = '3', item_desc = '2', item_qty = '2', emb_loc1 = 'Left Chest', size = 'ONE SIZE', artwork = 'Winter.jpg' WHERE `subitemnum` = '219' UPDATE c_or_details SET item_num = '4', item_desc = '3', item_qty = '3', emb_loc1 = 'Left Chest', size = 'ONE SIZE', artwork = 'Winter.jpg' WHERE `subitemnum` = '216' UPDATE c_or_details SET item_num = '4', item_desc = '3', item_qty = '3', emb_loc1 = 'Left Chest', size = 'ONE SIZE', artwork = 'Winter.jpg' WHERE `subitemnum` = '217' UPDATE c_or_details SET item_num = '4', item_desc = '3', item_qty = '3', emb_loc1 = 'Left Chest', size = 'ONE SIZE', artwork = 'Winter.jpg' WHERE `subitemnum` = '218' UPDATE c_or_details SET item_num = '4', item_desc = '3', item_qty = '3', emb_loc1 = 'Left Chest', size = 'ONE SIZE', artwork = 'Winter.jpg' WHERE `subitemnum` = '219' As you can see it's running it once perfect,.. and if it would stop there it would be great,.. but it continues to run it 4 more times. This has to be something with the double foreach statement right?
  19. hmm,.. yeah ,.. wonder why though.
  20. well on that particular one yes,.. most of the times it would be a array of numbers. Here is one with actual records,.. this is for two records. Does this mean it is repeating that var? Array ( [0] => 2 [1] => 3 ) Array ( [0] => 2 [1] => 3 )
  21. With one record = Array ( [0] => ) Array ( [0] => )
×
×
  • 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.