-
Posts
9,409 -
Joined
-
Last visited
-
Days Won
1
Everything posted by MadTechie
-
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
-
it must be the execution timeingout.. how long does it take for the script to run..?
-
[SOLVED] Spam-proof tell a friend form - not working
MadTechie replied to alex tj's topic in PHP Coding Help
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. -
remove the whitespace from the top change <?php $hostname= "localhost"; to <?php $hostname= "localhost"; remove the tab and the return
-
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()); } ?>
-
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; ?>
-
[SOLVED] $_SESSION variables dissapear after IF statement
MadTechie replied to vajra_hendry's topic in PHP Coding Help
ok quick note.. change uploader.inc to uploader.inc.php and rename the file to suite -
OK.. so whats the problem ? what are you expecting to happen ?
-
seams ok add echo "Done"; to the end of the code.. doe it get their ?
-
you can't really best bet is merge the html into the php
-
correct syntax header ("Location: http://b.html");
-
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
-
<?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)
-
Move to CSS/javascript section this is NOT a PHP question
-
would help if you knew that the "problem" is ?
-
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!
-
move echo ("User Exists"); down a few lines. also some sql injection protection wouldn't be a bad idea!
-
have you tried $query = "SELECT *, sum(quan) as Qty from baskettemp WHERE sess = '$sessid'"; EDIT: lemmin is a more complete reply!
-
i really can't see the fault.. the code i wrote seams to work on my server.. ??? will take a look in the morning
-
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 '
-
for for PM (private messages) try here for emails then phpmailer
-
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.
-
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
-
opps for($n=0,$n<count($_POST[PriceRetail]),$n++)
-
please click topic solved