Jump to content

MadTechie

Staff Alumni
  • Posts

    9,409
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by MadTechie

  1. try changing <a href="#" onclick="this.style.display='none'; document.getElementById('block').style.display='inline'">Phone</a> <span class="db_list_text" style="padding-left:5px; padding-right:2px;"><span id="block" style="display:none"><?=$rs_prop["home_no"]; ?></span> </span></td> to <a href="#" onclick="this.style.display='none'; document.getElementById('<?= $rs_prop["name"]; ?>').style.display='inline'">Phone</a> <span class="db_list_text" style="padding-left:5px; padding-right:2px;"><span id="<?= $rs_prop["name"]; ?>" style="display:none"><?=$rs_prop["home_no"]; ?></span> </span></td> basically giving unique ID's i used $rs_prop["name"] but $rs_prop["ID"] would be better (if it exists) the Unique from the database
  2. it must be the execution timeingout.. how long does it take for the script to run..?
  3. ok heres a few global register are on. you not testing the e mail address this mass mailing can be done. you filtering POST but actions are GET.
  4. remove the whitespace from the top change <?php $hostname= "localhost"; to <?php $hostname= "localhost"; remove the tab and the return
  5. i think the problem is the logic.. do you have a UniqueID for each record ? i'll take a guess and assume its product_code ok the logic should be something like this. First a word of warning it 4am here and i am about to go to sleep so please backup your database first and read the comments and make sense of the logic <?php // CSCart DB Info $hostcs = "localhost"; $usercs = "user"; $passcs = "pass"; $dbnamecs = "cscart0"; // OSC DB Info $hostosc = "192.168.6.2"; $userosc = "user"; $passosc = "pass"; $dbnameosc = "shop0"; // Connect to cscart $handlecscart = mysql_connect($hostcs, $usercs, $passcs); // Connect to osc $handleosc = mysql_connect($hostosc, $userosc, $passosc); // Select the cscart database mysql_select_db($dbnamecs,$handlecscart) or die("Couldn't connect to DB"); // Select the osc database mysql_select_db($dbnameosc,$handleosc) or die("Couldn't connect to DB"); // Query OSC $selectosc = "SELECT products_model, products_price FROM products "; if (!$selectosc) { die('<p>Error performing query: ' . mysql_error() . '</p>'); } //****DON'T NEED TO PULL DATE FROM HERE YET***** // Query CSCART //$selectcs = "SELECT product_code, price, product_id FROM cscart_products, cscart_product_prices"; // if (!$selectcs) { // die('<p>Error performing query: ' . mysql_error() . '</p>'); // } // CSCART results //$resultcs = mysql_query($selectcs,$handlecscart); // if (!$resultcs) { // die('<p>Error performing query: ' . mysql_error() . '</p>'); // } //******************************** // OSC Results $resultosc = mysql_query($selectosc,$handleosc); if (!$resultosc) { die('<p>Error performing query: ' . mysql_error() . '</p>'); } //*******ONLY LOOP ONE //while ( $rowcs = mysql_fetch_array($resultcs) AND $rowosc = mysql_fetch_array($resultosc) ) while ( $rowcs = mysql_fetch_array($resultcs) ) { $cspart = $rowcs['product_code'] ; $csprice = $rowcs['price']; $csPID = $rowcs['product_id'] ; //Find the New Product price etc $selectosc = "SELECT products_model, products_price FROM products WHERE products_id = $csPID"; $resultcs = mysql_query($selectcs,$handlecscart); $rowosc = mysql_fetch_array($resultosc) $oscpart = $rowosc['products_model']; $oscprice = $rowosc['products_price']; echo "<p>Part $cspart is being updated to $oscprice" . "<br />"; $result = mysql_query("UPDATE cscart_product_prices SET price='$oscprice' WHERE cscart_products.product_id = $csPID",$handlecscart) or die(mysql_error()); } ?>
  6. simple one <?php $var = "metallica"; $data = file_get_contents("http://www.last.fm/music/" . $var); if (preg_match('/<h5 class="subhead">([0-9,]*) plays scrobbled/im', $data, $regs)) { $result = $regs[1]; } echo $result; ?>
  7. ok quick note.. change uploader.inc to uploader.inc.php and rename the file to suite
  8. OK.. so whats the problem ? what are you expecting to happen ?
  9. seams ok add echo "Done"; to the end of the code.. doe it get their ?
  10. you can't really best bet is merge the html into the php
  11. correct syntax header ("Location: http://b.html");
  12. extract($HTTP_GET_VARS); extract($HTTP_POST_VARS); changes $_GET['comment'] to $comment etc so if the name of the Captcha is Cap then it will be $Cap.. hope that helps the form is at the bottom
  13. <?php $data = 'xxxyyyvvvhttp://www.website.com/bbbb/id=1234zzzaaa'; preg_match_all('/((?:https?):\/\/(?:[a-z0-9]){3,3}?[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/i', $data, $result, PREG_PATTERN_ORDER); $result = $result[1]; print_r($result) ?> works well for me for a know website use $data = 'xxxyyyvvvhttp://www.website.com/bbbb/id=1234zzzaaa xxxyyyvvvhttp://www.website.com/bbbb/id=1234zzzaaa '; preg_match_all('%(http://www\.website\.com/[\S]*)%i', $data, $result, PREG_PATTERN_ORDER); $result = $result[0]; print_r($result)
  14. Move to CSS/javascript section this is NOT a PHP question
  15. would help if you knew that the "problem" is ?
  16. what do you mean "in the right place" if you mean sorting then search the forum their was a post about that a day or so ago!
  17. move echo ("User Exists"); down a few lines. also some sql injection protection wouldn't be a bad idea!
  18. have you tried $query = "SELECT *, sum(quan) as Qty from baskettemp WHERE sess = '$sessid'"; EDIT: lemmin is a more complete reply!
  19. i really can't see the fault.. the code i wrote seams to work on my server.. ??? will take a look in the morning
  20. try this $SQL .= sprintf("UPDATE productprice SET (Cost='%s', PriceRetail='%s', PriceSell='%s', PriceHold='%s', PriceDate='%s') WHERE ProductId=%s AND Pcode=%s;", GetSQLValueString($_POST[PriceRetail][$n],"decimal"), GetSQLValueString($_POST[PriceSell][$n],"decimal"), GetSQLValueString($_POST[PriceHold][$n],"decimal"), GetSQLValueString($_POST[Cost][$n],"decimal"), GetSQLValueString(date('YmdHis'),"text")); added ( and '
  21. for for PM (private messages) try here for emails then phpmailer
  22. There is a difference between the two, but speed-wise it should be irrelevant which one you use. print() behaves like a function in that you can do: $ret = print "Hello World";And $ret will be 1That means that print can be used as part of a more complex expression where echo cannot. print is also part of the precedence table which it needs to be if it is to be used within a complex expression. It is just about at the bottom of the precendence list though. Only "," AND, OR and XOR are lower.echo is marginally faster since it doesn't set a return value if you really want to get down to the nitty gritty.If the grammar is: echo expression [, expression[, expression] ... ]Then echo ( expression, expression ) is not valid. ( expression ) reduces to just an expression so this would be valid: echo ("howdy"),("partner");but you would simply write this as: echo "howdy","partner"; if you wanted to use two expression. Putting the brackets in there serves no purpose since there is no operator precendence issue with a single expression like that.
  23. forgotten.. the fact is we get a lot of members who want a full site to make them cash but costs them nothing.. in your opening post you basical say and so face it you have no intrest in learning to code but want the code pre-written for you.. so to sum up read the RULES & GUIDELINES: thank you for visting have a nice day
  24. opps for($n=0,$n<count($_POST[PriceRetail]),$n++)
  25. please click topic solved
×
×
  • 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.