Jump to content

rascle

Members
  • Posts

    178
  • Joined

  • Last visited

Everything posted by rascle

  1. Solved, thank you
  2. But it isn't listing them how I want it, I'll have to do some more research unless you have any insights?
  3. Using the php.net I have come up with the following, but it is probably rubbish!: function sortdtr($a,$B){ $a = explode('x^',$a); $b = explode('x^',$B); if($a==$B){ return 0; } else if($a>$B){ return -1;} else if($a<$B){ return 1; } } usort($dtr, "sortdtr"); echo "<br/>"; print_r($dtr);
  4. But what would the function be?
  5. I havent got a solution but I can change the values so that x is x^1 and a constant is x^0. This might make it easier, all I need to know is how to order based on the value after "x^"
  6. Hi I have an array (which is an equation) lets say it is Array ( [0] => 18x [1] => 10x^2 [2] => 17 ) I want to order the array in terms of the value after ^, so that the highest values after ^ are grouped first. Therefore the above array I want it sorted to become Array ( [0] => 10x^2 [1] => 18x [2] => 17 ) Does anyone have any idea how I would sort it? I have tried using php sort() to no avail. Thanks, Rhys
  7. Sorry, that was the character encoding
  8. BTW on the DOM Parser, there is an error "Parse error: syntax error, unexpected '=' in /home/b25rasc/public_html/test9.php on line 2"
  9. Ok Thanks
  10. Whats wrong with just using preg_match? As there is a lot less code?
  11. Thanks, sorry to be an idiot but how could I do that by getting the info from dump.text though? Thanks Rhys
  12. Thanks again, however I still cant get it to display anything, here is the code I am using: <?php $eurovalue = file_get_contents("dump.txt"); $eurovalue = htmlspecialchars($eurovalue); $pattern = '/<td><a.*>USD\/EUR<\/a><\/td>.*<td\s*\w*>\s*<img\s*[\w\d]*\s*\/>(\d+)<\/td>/si'; preg_match($pattern,$eurovalue,$euroarray); $euroresult = $euroarray[0]; echo $euroresult; ?> I dont know if there is any silly mistakes in there, dump.text is where the HTML is being loaded (and that is working fine). I use htmlspecialchars, as otherwise the output would be in HTML. I hope this doesnt affect the preg_match Thanks Again Rhys
  13. Thanks, but I've tried it and nothing is happening still. Unfortunately I dont know much about Regex and so cant see what you have done, but there are multiple <td></td> lines, does the provided code identify the one I want? <td><a href="/business/currencies/quote?srcAmt=1&srcCurr=USD&destAmt=&destCurr=EUR">USD/EUR</a></td> <td class="data changeUp"> <img width="9" height="10" src="/resources_v2/images/changeUp.gif" />0.69070</td> As there are similar bits of code, for example USD/GBP Thanks Rhys
  14. Basically the post with the long code isnt relevant, it is where the: <td><a href="/business/currencies/quote?srcAmt=1&srcCurr=USD&destAmt=&destCurr=EUR">USD/EUR</a></td> <td class="data changeUp"> <img width="9" height="10" src="/resources_v2/images/changeUp.gif" />0.69070</td> lies, basically I just want the code above to be found so need to create a regex to find the above code, in the long code, if that makes sense. Thanks Rhys
  15. AyKay47 - ???
  16. I then want preg_match to find: <td><a href="/business/currencies/quote?srcAmt=1&srcCurr=USD&destAmt=&destCurr=EUR">USD/EUR</a></td> <td class="data changeUp"> <img width="9" height="10" src="/resources_v2/images/changeUp.gif" />0.69070</td> Where 0.69070 is subject to change. Once this has happened I want it to save it to a variable called $eurovalue and then I will strip the tags and isolate the value (I can do this my self thanks) Its just the regex for the preg_match I need help with. I hope this is the info you needed. Thanks Rhys
  17. Basically the code below is what I need to get the information from: <html> <head> </head> <body> <div id="col03"> <input name="CurrenciesConversion:Convert" id="CurrenciesConversion_Convert" type="button" onclick="javascript:ConvertCurrency('/business/currencies/quote?srcAmt=[amt]&srcCurr=[from]&destAmt=&destCurr=[to]&historicalDate=[date]','CurrenciesConversion_ConversionAmount','CurrenciesConversion_FromCurrencies','CurrenciesConversion_ToCurrencies','CurrenciesConversion_HistoricalDate');" /> </div> <input name="CurrenciesConversion:HistoricalDate" type="hidden" id="CurrenciesConversion_HistoricalDate"/> <div id="converterFooter"> Exchange Rate For <span id="CurrenciesConversion_HistoricalDate_span">5 Jul 2011</span> <img src="/resources/images/icon_calendar.gif" border="0" id="calIcon" /> <div class="yuiCalContainer"> <div class="yui-skin-sam"> <div id="calContainer"></div> </div> </div> </div> </form> </div> </div> </div> <div class="linebreak"></div> <div class="linebreak"></div> <div class="module"> <div class="moduleBody"> <div class="moduleHeader"><h3>Overview</h3></div> <img src="http://charts.reuters.com/enhancements/chartapi/chart_api.asp?cmb=wsod&ord=16153921472&quoteCurrency=USD&baseCurrency=EUR&timezoneOffset=0&dateFormat=US&language=EN&symbol=EUR%3DX&headerType=legend&quoteType=last&width=540&height=339&duration=365&frequency=1week&display=mountain&uppers=&lowers=&event=&timezoneLabel=&compare=GBP%3D,GBPEUR=X" /> <br> </div> </div> <div class="module"> <div class="moduleHeader"> <h3> Currency Table</h3> </div> <div class="moduleBody"> <table width="100%" cellspacing="0" cellpadding="0" border="0" id="currPairs" class="dataTable"> <tbody><tr> <th width="60">Currency</th> <th width="70" class="data">Last</th> <th class="data">Day High</th> <th class="data">Day Low</th> <th class="data">% Change</th> <th class="data">Bid</th> <th class="data">Ask</th> </tr> <tr class="stripe"> <td><a href="/business/currencies/quote?srcAmt=1&srcCurr=GBP&destAmt=&destCurr=USD">GBP/USD</a></td> <td class="data changeUp"> <img width="9" height="10" src="/resources_v2/images/changeUp.gif" />1.6110</td> <td class="data"> 1.6127</td> <td class="data"> 1.5992</td> <td class="data changeUp"> <img width="9" height="10" src="/resources_v2/images/changeUp.gif" />+0.17%</td> <td class="data"> 1.6110</td> <td class="data"> 1.6114</td> </tr> <tr class=""> <td><a href="/business/currencies/quote?srcAmt=1&srcCurr=GBP&destAmt=&destCurr=EUR">GBP/EUR</a></td> <td class="data changeUp"> <img width="9" height="10" src="/resources_v2/images/changeUp.gif" />1.1130</td> <td class="data"> 1.1139</td> <td class="data"> 1.1052</td> <td class="data changeUp"> <img width="9" height="10" src="/resources_v2/images/changeUp.gif" />+0.63%</td> <td class="data"> 1.1130</td> <td class="data"> 1.1135</td> </tr> <tr class="stripe"> <td><a href="/business/currencies/quote?srcAmt=1&srcCurr=USD&destAmt=&destCurr=EUR">USD/EUR</a></td> <td class="data changeUp"> <img width="9" height="10" src="/resources_v2/images/changeUp.gif" />0.69070</td> <td class="data"> 0.69150</td> <td class="data"> 0.68730</td> <td class="data changeUp"> <img width="9" height="10" src="/resources_v2/images/changeUp.gif" />+0.47%</td> <td class="data"> 0.69070</td> <td class="data"> 0.69120</td> </tr> <tr class=""> <td><a href="/business/currencies/quote?srcAmt=1&srcCurr=GBP&destAmt=&destCurr=JPY">GBP/JPY</a></td> <td class="data changeUp"> <img width="9" height="10" src="/resources_v2/images/changeUp.gif" />130.54</td> <td class="data"> 130.82</td> <td class="data"> 129.77</td> <td class="data changeUp"> <img width="9" height="10" src="/resources_v2/images/changeUp.gif" />+0.48%</td> <td class="data"> 130.54</td> <td class="data"> 130.64</td> </tr> <tr class="stripe"> <td><a href="/business/currencies/quote?srcAmt=1&srcCurr=GBP&destAmt=&destCurr=CHF">GBP/CHF</a></td> <td class="data changeDown"> <img width="9" height="10" src="/resources_v2/images/changeDown.gif" />1.3622</td> <td class="data"> 1.3655</td> <td class="data"> 1.3513</td> <td class="data changeDown"> <img width="9" height="10" src="/resources_v2/images/changeDown.gif" />-0.09%</td> <td class="data"> 1.3622</td> <td class="data"> 1.3632</td> </tr> <tr class=""> <td><a href="/business/currencies/quote?srcAmt=1&srcCurr=GBP&destAmt=&destCurr=AUD">GBP/AUD</a></td> <td class="data changeUp"> <img width="9" height="10" src="/resources_v2/images/changeUp.gif" />1.5055</td> <td class="data"> 1.5070</td> <td class="data"> 1.4968</td> <td class="data changeUp"> <img width="9" height="10" src="/resources_v2/images/changeUp.gif" />+0.52%</td> <td class="data"> 1.5055</td> <td class="data"> 1.5065</td> </tr> </tbody></table> </div> </div> <div class="linebreak"></div> <div class="sectionDivider"></div> <div class="module"> <div class="moduleBody"> <div class="topStory"><h1><a href="/article/2011/07/05/markets-sterling-idUKL6E7I50E420110705" >Sterling jumps on unexpected rise in UK services PMI</a> </h1><p> * Sterling hits day's high vs dollar, euro, UK services PMI rises</p> <div class="actionButton breaking"><a href="/article/2011/07/05/markets-sterling-idUKL6E7I50E420110705" >Continue Reading</a> </div> </div></div> </div> <div id="moreSectionNews"><div class="module"> <div class="moduleBody"> <div class="feature"><h2><a href="/article/2011/07/05/idUKL6E7I506V20110705" >Sterling rises after stronger-than expected UK PMI</a> </h2><div class="relatedInfo"> <span class="timestamp">9:40am BST</span></div> </div><div class="feature"><h2><a href="/article/2011/07/05/idUKL6E7I506620110705" >Sterling rises after stronger-than expected UK PMI</a> </h2><div class="relatedInfo"> <span class="timestamp">9:39am BST</span></div> </div><div class="feature"><h2><a href="/article/2011/07/05/markets-sterling-open-idUKL6E7I503M20110705" >Sterling slips, risks more losses on UK services PMI</a> </h2><div class="relatedInfo"> <span class="timestamp">9:07am BST</span></div> </div><div class="feature"><h2><a href="/article/2011/07/04/markets-sterling-close-idUKL6E7I41N920110704" >Sterling flat, risks selling as UK economy struggles</a> </h2><div class="relatedInfo"> <span class="timestamp">04 Jul 2011</span></div> </div><div class="feature"><h2><a href="/article/2011/07/04/markets-sterling-idUKL6E7I40DT20110704" >Sterling supported as risk recovers, outperforms euro</a> </h2><div class="relatedInfo"> <span class="timestamp">04 Jul 2011</span></div> </div></div> </div> </div><script type="text/javascript" src="/resources_v2/js/rcom-next20.js"></script> <script type="text/javascript"> Reuters.n20s.init("ukPoundRpt", ""); </script> <div class="ad"><iframe valign="middle" width="540" height="120" marginheight=0 marginwidth=0 frameborder=0 vspace=0 hspace=0 scrolling=NO src="http://www.dianomioffers.co.uk/smartads.epl?id=599"></iframe></div><div class="linebreak"></div> <div class="linebreak"></div> <div class="ad" id="googleAd"> <script type="text/javascript" src="/resources_v2/js/googleAd.js"></script> <script type="text/javascript"> <!-- var googleAdTitle = new Array("Ads by Google", "What's This?", "320", "330"); var googleAdAlign = "left"; google_ad_client = 'ca-pub-9112069016589411'; google_ad_output = 'js'; google_max_num_ads = 3; google_safe = 'high'; google_feedback = 'on'; google_ad_type = 'text'; google_color_line = 'ff0000'; google_encoding = 'utf8'; google_language='en'; google_ad_channel = 'UK_Site'; if ((typeof (hideAllAds) == 'undefined' || hideAllAds == false) && (typeof (hideGoogleAds) == 'undefined' || hideGoogleAds == false)) { document.write('<scr' + 'ipt language="javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></scr' + 'ipt>'); } --> </script> </div> <div class="linebreak"></div> </div> <div class="column2 gridPanel grid4"> <div class="ad"> <script language="javascript" type="text/javascript"> // krux kseg and kuid from krux header tag var kruxvars = (typeof(kseg)=='undefined'?'':kseg) + (typeof(kuid)=='undefined'?'':kuid); var adsrc = 'uk.reuters/bizfinance/currencies;' +(typeof(n_pbt)=='undefined'?'':n_pbt) +(typeof(srnd)=='undefined'?'':srnd) + kruxvars + (typeof(seg)=='undefined'?'':seg) + 'type=mpu;sz=300x250;tile=2;ord=' + (typeof(tmstmp)!='undefined'?tmstmp:12345) + '?'; if ( typeof(AD_TRACKER) != 'undefined' ) { adsrc = AD_TRACKER.processAdSrcType(adsrc); } if ((typeof (hideAllAds) == 'undefined' || hideAllAds == false) && (typeof (AD_TRACKER) == 'undefined' || AD_TRACKER.isAdHidden('mpu') == false) && (typeof (hideAd_10033242) == 'undefined' || hideAd_10033242 == false)) { document.write('<scri' + 'pt language="javascript" type="text/javascript" src="http://ad.doubleclick.net/adj/' + adsrc + '"></scri' + 'pt>'); if ((!document.images && navigator.userAgent.indexOf("Mozilla/2.") >= 0) || navigator.userAgent.indexOf("WebTV") >= 0) { /* Looks like we don't need this dart, and we are seeing weird clients with Mozilla/2. userAgent*/ //document.write('<a href="http://ad.doubleclick.net/jump/uk.reuters/bizfinance/currencies;' + (typeof(seg)=='undefined'?'':seg) + 'type=mpu;sz=300x250;tile=2;ord=' + (typeof(tmstmp)=='undefined'?12345:tmstmp) + '?" target="_blank">'); //document.write('<img src="http://ad.doubleclick.net/ad/uk.reuters/bizfinance/currencies;' + (typeof(seg)=='undefined'?'':seg) + 'type=mpu;sz=300x250;tile=2;ord=' + (typeof(tmstmp)=='undefined'?12345:tmstmp) + '?" width="300" height="250" border="0" alt=""></a>'); } } </script> <noscript> <a href="http://ad.doubleclick.net/jump/uk.reuters/bizfinance/currencies;type=mpu;sz=300x250;tile=2;ord=0441?" target="_blank"> <img src="http://ad.doubleclick.net/ad/uk.reuters/bizfinance/currencies;type=mpu;sz=300x250;tile=2;ord=0441?" width="300" height="250" border="0" alt=""> </a> </noscript> </div> <div id="box-for-rbox"></div> <script type="text/javascript"> function rboxReady(evnt) { TRC.drawRBox({mode:'section-vertical',container:'box-for-rbox',category:'auto'}); } Reuters.utils.loadTaboolaWidget = function() { var taboolaLoader = document.createElement('script'); taboolaLoader.async = true; document.getElementsByTagName('head')[0].appendChild(taboolaLoader); if (taboolaLoader.attachEvent) { // support Internet Explorer taboolaLoader.attachEvent("onactivate", rboxReady); } else { taboolaLoader.addEventListener("activate", rboxReady, false); } taboolaLoader.type="text/javascript"; taboolaLoader.src="http://cdn.taboolasyndication.com/libtrc/reuters/rbox.js?dynamic&category"; } if (Reuters.utils.getQueryStringParameter(location.href, "taboola") == "true") { Reuters.utils.loadTaboolaWidget(); } Reuters.utils.loadTaboolaWidget(); </script><div class="linebreak"></div> <div class="ad"><iframe valign="middle" width="300" height="130" marginheight=0 marginwidth=0 frameborder=0 vspace=0 hspace=0 scrolling=NO src="http://www.dianomioffers.co.uk/smartads.epl?id=612"></iframe> </div><div class="linebreak"></div> <div class="linebreak"></div> <div class="section" id="markets-module"> <div class="sectionContent"> <link href="/resources_v2/css/rcom-markets-module.css" rel="stylesheet" /><div class="linebreak"></div> <div id="mm-header"><div class="module"> <div class="moduleHeader"><h3>Markets</h3></div> </div></div><!-- otherwise tab1Name is empty --> <!-- otherwise tab1Target is empty --> <script src="/resources_v2/js/tabs.js"></script> <div class="linebreak"></div> <div id="mm-tabs"><div class="tabs"> <ul> <li id="MM-tabs_0" class=""><span class="hrefClone">Europe</span></li> <li id="MM-tabs_1" class=""><span class="hrefClone">U.S.</span></li> <li id="MM-tabs_2" class=""><span class="hrefClone">Asia</span></li> <li id="MM-tabs_3" class=""><span class="hrefClone">Sectors</span></li> </ul> <script type="text/javascript"> RTR_Tabs.addTabGroup("MM-tabs", "", "standard", "", "", ""); RTR_Tabs.addTab("MM-tabs_0", "tab1"); RTR_Tabs.addTab("MM-tabs_1", "tab2"); RTR_Tabs.addTab("MM-tabs_2", "tab3"); RTR_Tabs.addTab("MM-tabs_3", "tab4"); RTR_Tabs.init("MM-tabs"); </script> </div> <script type="text/javascript"> RTR_Tabs.hiLiteTab("MM-tabs_0"); </script> </div><style> .marketslogo{ z-index:1000000; background-color:#eaf5f6; /* padding: 12px 12px 12px 125px; */ padding-left:10px; } </style><div class="marketslogo"> <script language="javascript" type="text/javascript"> // krux kseg and kuid from krux header tag var kruxvars = (typeof(kseg)=='undefined'?'':kseg) + (typeof(kuid)=='undefined'?'':kuid); var adsrc = 'uk.reuters/bizfinance/currencies;' +(typeof(n_pbt)=='undefined'?'':n_pbt) +(typeof(srnd)=='undefined'?'':srnd) + kruxvars + (typeof(seg)=='undefined'?'':seg) + 'type=marketslogo;sz=1x1;taga=aaaaaaaaa;ord=' + (typeof(tmstmp)!='undefined'?tmstmp:12345) + '?'; if ( typeof(AD_TRACKER) != 'undefined' ) { adsrc = AD_TRACKER.processAdSrcType(adsrc); } if ((typeof (hideAllAds) == 'undefined' || hideAllAds == false) && (typeof (AD_TRACKER) == 'undefined' || AD_TRACKER.isAdHidden('marketslogo') == false) && (typeof (hideAd_14718067) == 'undefined' || hideAd_14718067 == false)) { document.write('<scri' + 'pt language="javascript" type="text/javascript" src="http://ad.doubleclick.net/adj/' + adsrc + '"></scri' + 'pt>'); if ((!document.images && navigator.userAgent.indexOf("Mozilla/2.") >= 0) || navigator.userAgent.indexOf("WebTV") >= 0) { /* Looks like we don't need this dart, and we are seeing weird clients with Mozilla/2. userAgent*/ //document.write('<a href="http://ad.doubleclick.net/jump/uk.reuters/bizfinance/currencies;' + (typeof(seg)=='undefined'?'':seg) + 'type=marketslogo;sz=1x1;taga=aaaaaaaaa;ord=' + (typeof(tmstmp)=='undefined'?12345:tmstmp) + '?" target="_blank">'); //document.write('<img src="http://ad.doubleclick.net/ad/uk.reuters/bizfinance/currencies;' + (typeof(seg)=='undefined'?'':seg) + 'type=marketslogo;sz=1x1;taga=aaaaaaaaa;ord=' + (typeof(tmstmp)=='undefined'?12345:tmstmp) + '?" width="1" height="1" border="0" alt=""></a>'); } } </script> <noscript> <a href="http://ad.doubleclick.net/jump/uk.reuters/bizfinance/currencies;type=marketslogo;sz=1x1;taga=aaaaaaaaa;ord=4701?" target="_blank"> <img src="http://ad.doubleclick.net/ad/uk.reuters/bizfinance/currencies;type=marketslogo;sz=1x1;taga=aaaaaaaaa;ord=4701?" width="1" height="1" border="0" alt=""> </a> </noscript> </div> <div id="tab1"><div class="module"> <div class="moduleHeader"> <h3> <a href="/business/markets/indices?blob="> Market Indices</a> </h3> </div> <div class="moduleBody"> <link href="/resources_v2/css/rcom-stockSearch.css" rel="stylesheet" /> <div class="module investingControlsContainer"> <div class="moduleBody investingControls"> <script language="javascript" type="text/javascript"> function OnClickGo(inputs, symbol) { try { if(inputs.length) { for(var i = 0;i < inputs.length;i++) { if(inputs[i].checked) { var url = inputs[i].value; url = url.replace("[ric]", symbol); document.location.href = url; break; } } } else { var url = inputs.value; url = url.replace("[ric]", symbol); document.location.href = url; } }catch(e){} } function OnStockSearchSubmit(sId) { var stockSearch = 'stockSearch_'+sId; var stockSearchSymbol = 'stockSearchSymbol_'+sId; var stockSearchType = 'stockSearchType_'+sId; try { var symbol = document.getElementById(stockSearchSymbol).value; if(symbol === "" || symbol === "Enter company name or Symbol") { return false; } else { eval('OnClickGo(document.forms["'+stockSearch+'"].'+stockSearchType+', encodeURIComponent(symbol))'); } }catch(e){} } </script> <form name="stockSearch_270" > <div class="stockSearchContainer"> <div class="searchInput"> <input type="hidden" name="stockSearchType_270" value="/business/quotes/lookup?searchType=any&search=[ric]" checked="checked" /> <span class="uppercase bold label">Stock Search</span> </div> <div class="searchInput2"> <div class="searchbox"> <input type="text" class="searchfield" id="stockSearchSymbol_270" name="stockSearchSymbol" value="Enter company name or Symbol" /> <input type="image""class="searchbutton" src="/resources_v2/images/btn_header_go.gif" id="btnStockSearchSubmit_270"/> </div> </div> </div> </form> </div> </div> <script language="javascript" type="text/javascript"> function searchSubmit_270() { OnStockSearchSubmit('270'); return false; } Reuters.utils.enableSearchBox('stockSearchSymbol_270', 'Enter company name or Symbol', searchSubmit_270); document.getElementById('btnStockSearchSubmit_270').onclick = searchSubmit_270; </script><table width="100%" cellpadding="0" cellspacing="0" border="0" class="dataTable"> <tbody class="dataSmall"> <tr class="stripe"><td valign="middle"><a href="/business/markets/index?symbol=gb%21ftse">FTSE 100</a></td> <td class="data size8" valign="middle">6,035.82</td> <td class="data dataUp" valign="middle" ><img height="6" width="11" src="/resources_v2/images/arrowPos.gif"> +18.28</td> <td class="data" valign="middle">+0.30%</td> </tr> <tr><td valign="middle"><a href="/business/markets/index?symbol=de%21daxx">DAX</a></td> <td class="data size8" valign="middle">7,464.96</td> <td class="data dataUp" valign="middle" ><img height="6" width="11" src="/resources_v2/images/arrowPos.gif"> +22.00</td> <td class="data" valign="middle">+0.30%</td> </tr> <tr class="stripe"><td valign="middle"><a href="/business/markets/index?symbol=fr%21CAC">CAC 40</a></td> <td class="data size8" valign="middle">3,990.63</td> <td class="data dataDown" valign="middle" ><img height="6" width="11" src="/resources_v2/images/arrowNeg.gif"> -12.48</td> <td class="data" valign="middle">-0.31%</td> </tr> <tr><td valign="middle"><a href="/business/markets/index?symbol=US%21TRCONTEU.U"> TR Europe</a></td> <td class="data size8" valign="middle">163.04</td> <td class="data dataDown" valign="middle" ><img height="6" width="11" src="/resources_v2/images/arrowNeg.gif"> -0.95</td> <td class="data" valign="middle">-0.58%</td> </tr> </table> <div class="moreLink"> <a href="/business/markets/indices?blob=">&#187; All Indices</a></div></div> </div> <div class="linebreak"></div> <div class="mm-currencies"><div class="module"> <div class="moduleHeader"> <h3> <a href="/business/currencies?blob="> Currencies</a> </h3> </div> <div class="moduleBody"> <table cellspacing="1" cellpadding="1" width="100%" border="0" id="currPairs" class="dataTable"> <tr class=""> <td><a href="/business/currencies/quote?srcAmt=1&srcCurr=GBP&destAmt=&destCurr=USD">GBP/USD</a></td> <td class="data bold"> 1.6110</td> <td class="data dataUp bold"> +0.17%</td> </tr> <tr class="stripe"> <td><a href="/business/currencies/quote?srcAmt=1&srcCurr=GBP&destAmt=&destCurr=EUR">GBP/EUR</a></td> <td class="data bold"> 1.1130</td> <td class="data dataUp bold"> +0.63%</td> </tr> <tr class=""> <td><a href="/business/currencies/quote?srcAmt=1&srcCurr=EUR&destAmt=&destCurr=USD">EUR/USD</a></td> <td class="data bold"> 1.4471</td> <td class="data dataDown bold"> -0.45%</td> </tr> </tbody></table> <div class="moreLink"> <a href="/business/currencies?blob=">&#187; All Currencies</a></div></div> </div> </div> <div class="linebreak"></div> <div class="mm-commodities"><div class="module"> <div class="moduleHeader"> <h3> <a href="/business/commodities?blob="> Commodities</a> </h3> </div> <div class="moduleBody"> <table width="100%" cellpadding="0" cellspacing="0" border="0" class="dataTable"><tbody class="dataSmall"> <tr> </tr> <tr> <td valign="top"> <a href="/business/[email protected]"> Gold</a></td> <td class="data" valign="top"> 1,510.30</td> <td class="data changeUp" nowrap="nowrap" valign="top"> +27.70</td> <td class="data changeUp" nowrap="nowrap" valign="top"> +1.83%</td> </tr> <tr class="stripe"> <td valign="top"> <a href="/business/[email protected]"> Oil</a></td> <td class="data" valign="top"> 96.61</td> <td class="data changeUp" nowrap="nowrap" valign="top"> +1.67</td> <td class="data changeUp" nowrap="nowrap" valign="top"> +1.73%</td> </tr> <tr> <td valign="top"> <a href="/business/[email protected]"> Corn</a></td> <td class="data" valign="top"> 606.75</td> <td class="data changeNone" nowrap="nowrap" valign="top"> +0.00</td> <td class="data changeNone" nowrap="nowrap" valign="top"> +0.00%</td> </tr> </table> <div class="moreLink"> <a href="/business/commodities?blob=">&#187; All Commodities</a></div></div> </div> </div> <div class="linebreak"></div> </div><div id="tab2" class="hidden"><div class="module"> <div class="moduleHeader"> <h3> <a href="/business/markets/indices?blob="> Market Indices</a> </h3> </div> <div class="moduleBody"> <link href="/resources_v2/css/rcom-stockSearch.css" rel="stylesheet" /> <div class="module investingControlsContainer"> <div class="moduleBody investingControls"> <script language="javascript" type="text/javascript"> function OnClickGo(inputs, symbol) { try { if(inputs.length) { for(var i = 0;i < inputs.length;i++) { if(inputs[i].checked) { var url = inputs[i].value; url = url.replace("[ric]", symbol); document.location.href = url; break; } } } else { var url = inputs.value; url = url.replace("[ric]", symbol); document.location.href = url; } }catch(e){} } function OnStockSearchSubmit(sId) { var stockSearch = 'stockSearch_'+sId; var stockSearchSymbol = 'stockSearchSymbol_'+sId; var stockSearchType = 'stockSearchType_'+sId; try { var symbol = document.getElementById(stockSearchSymbol).value; if(symbol === "" || symbol === "Enter company name or Symbol") { return false; } else { eval('OnClickGo(document.forms["'+stockSearch+'"].'+stockSearchType+', encodeURIComponent(symbol))'); } }catch(e){} } </script> <form name="stockSearch_690" > <div class="stockSearchContainer"> <div class="searchInput"> <input type="hidden" name="stockSearchType_690" value="/business/quotes/lookup?searchType=any&search=[ric]" checked="checked" /> <span class="uppercase bold label">Stock Search</span> </div> <div class="searchInput2"> <div class="searchbox"> <input type="text" class="searchfield" id="stockSearchSymbol_690" name="stockSearchSymbol" value="Enter company name or Symbol" /> <input type="image""class="searchbutton" src="/resources_v2/images/btn_header_go.gif" id="btnStockSearchSubmit_690"/> </div> </div> </div> </form> </div> </div> <script language="javascript" type="text/javascript"> function searchSubmit_690() { OnStockSearchSubmit('690'); return false; } Reuters.utils.enableSearchBox('stockSearchSymbol_690', 'Enter company name or Symbol', searchSubmit_690); document.getElementById('btnStockSearchSubmit_690').onclick = searchSubmit_690; </script><table width="100%" cellpadding="0" cellspacing="0" border="0" class="dataTable"> <tbody class="dataSmall"> <tr class="stripe"><td valign="middle"><a href="/business/markets/index?symbol=us%21dji">DOW</a></td> <td class="data size8" valign="middle">12,564.15</td> <td class="data dataDown" valign="middle" ><img height="6" width="11" src="/resources_v2/images/arrowNeg.gif"> -18.62</td> <td class="data" valign="middle">-0.15%</td> </tr> <tr><td valign="middle"><a href="/business/markets/index?symbol=us%21spx">S&P 500</a></td> <td class="data size8" valign="middle">1,339.57</td> <td class="data dataDown" valign="middle" ><img height="6" width="11" src="/resources_v2/images/arrowNeg.gif"> -0.10</td> <td class="data" valign="middle">-0.01%</td> </tr> <tr class="stripe"><td valign="middle"><a href="/business/markets/index?symbol=us%21comp">NASDAQ</a></td> <td class="data size8" valign="middle">2,811.31</td> <td class="data dataDown" valign="middle" ><img height="6" width="11" src="/resources_v2/images/arrowNeg.gif"> -4.72</td> <td class="data" valign="middle">-0.17%</td> </tr> <tr><td valign="middle"><a href="/business/markets/index?symbol=US%21TRXUS">TR US Index</a></td> <td class="data size8" valign="middle">122.29</td> <td class="data dataDown" valign="middle" ><img height="6" width="11" src="/resources_v2/images/arrowNeg.gif"> -0.34</td> <td class="data" valign="middle">-0.28%</td> </tr> </table> <div class="moreLink"> <a href="/business/markets/indices?blob=">&#187; All Indices</a></div></div> </div> <div class="linebreak"></div> <div class="mm-currencies"><div class="module"> <div class="moduleHeader"> <h3> <a href="/business/currencies?blob="> Currencies</a> </h3> </div> <div class="moduleBody"> <table cellspacing="1" cellpadding="1" width="100%" border="0" id="currPairs" class="dataTable"> <tr class=""> <td><a href="/business/currencies/quote?srcAmt=1&srcCurr=GBP&destAmt=&destCurr=USD">GBP/USD</a></td> <td class="data bold"> 1.6110</td> <td class="data dataUp bold"> +0.17%</td> </tr> <tr class="stripe"> <td><a href="/business/currencies/quote?srcAmt=1&srcCurr=GBP&destAmt=&destCurr=EUR">GBP/EUR</a></td> <td class="data bold"> 1.1130</td> <td class="data dataUp bold"> +0.63%</td> </tr> <tr class=""> <td><a href="/business/currencies/quote?srcAmt=1&srcCurr=EUR&destAmt=&destCurr=USD">EUR/USD</a></td> <td class="data bold"> 1.4471</td> <td class="data dataDown bold"> -0.45%</td> </tr> </tbody></table> <div class="moreLink"> <a href="/business/currencies?blob=">&#187; All Currencies</a></div></div> </div> </div> <div class="linebreak"></div> <div class="mm-commodities"><div class="module"> <div class="moduleHeader"> <h3> <a href="/business/commodities?blob="> Commodities</a> </h3> </div> <div class="moduleBody"> <table width="100%" cellpadding="0" cellspacing="0" border="0" class="dataTable"><tbody class="dataSmall"> <tr> </tr> <tr> <td valign="top"> <a href="/business/[email protected]"> Gold</a></td> <td class="data" valign="top"> 1,510.30</td> <td class="data changeUp" nowrap="nowrap" valign="top"> +27.70</td> <td class="data changeUp" nowrap="nowrap" valign="top"> +1.83%</td> </tr> <tr class="stripe"> <td valign="top"> <a href="/business/[email protected]"> Oil</a></td> <td class="data" valign="top"> 96.61</td> <td class="data changeUp" nowrap="nowrap" valign="top"> +1.67</td> <td class="data changeUp" nowrap="nowrap" valign="top"> +1.73%</td> </tr> <tr> <td valign="top"> <a href="/business/[email protected]"> Corn</a></td> <td class="data" valign="top"> 606.75</td> <td class="data changeNone" nowrap="nowrap" valign="top"> +0.00</td> <td class="data changeNone" nowrap="nowrap" valign="top"> +0.00%</td> </tr> </table> <div class="moreLink"> <a href="/business/commodities?blob=">&#187; All Commodities</a></div></div> </div> </div> <div class="linebreak"></div> </div><div id="tab3" class="hidden"><div class="module"> <div class="moduleHeader"> <h3> <a href="/business/markets/indices?blob="> Market Indices</a> </h3> </div> <div class="moduleBody"> <link href="/resources_v2/css/rcom-stockSearch.css" rel="stylesheet" /> <div class="module investingControlsContainer"> <div class="moduleBody investingControls"> <script language="javascript" type="text/javascript"> function OnClickGo(inputs, symbol) { try { if(inputs.length) { for(var i = 0;i < inputs.length;i++) { if(inputs[i].checked) { var url = inputs[i].value; url = url.replace("[ric]", symbol); document.location.href = url; break; } } } else { var url = inputs.value; url = url.replace("[ric]", symbol); document.location.href = url; } }catch(e){} } function OnStockSearchSubmit(sId) { var stockSearch = 'stockSearch_'+sId; var stockSearchSymbol = 'stockSearchSymbol_'+sId; var stockSearchType = 'stockSearchType_'+sId; try { var symbol = document.getElementById(stockSearchSymbol).value; if(symbol === "" || symbol === "Enter company name or Symbol") { return false; } else { eval('OnClickGo(document.forms["'+stockSearch+'"].'+stockSearchType+', encodeURIComponent(symbol))'); } }catch(e){} } </script> <form name="stockSearch_306" > <div class="stockSearchContainer"> <div class="searchInput"> <input type="hidden" name="stockSearchType_306" value="/business/quotes/lookup?searchType=any&search=[ric]" checked="checked" /> <span class="uppercase bold label">Stock Search</span> </div> <div class="searchInput2"> <div class="searchbox"> <input type="text" class="searchfield" id="stockSearchSymbol_306" name="stockSearchSymbol" value="Enter company name or Symbol" /> <input type="image""class="searchbutton" src="/resources_v2/images/btn_header_go.gif" id="btnStockSearchSubmit_306"/> </div> </div> </div> </form> </div> </div> <script language="javascript" type="text/javascript"> function searchSubmit_306() { OnStockSearchSubmit('306'); return false; } Reuters.utils.enableSearchBox('stockSearchSymbol_306', 'Enter company name or Symbol', searchSubmit_306); document.getElementById('btnStockSearchSubmit_306').onclick = searchSubmit_306; </script><table width="100%" cellpadding="0" cellspacing="0" border="0" class="dataTable"> <tbody class="dataSmall"> <tr class="stripe"><td valign="middle"><a href="/business/markets/index?symbol=jp%21n225">Nikkei</a></td> <td class="data size8" valign="middle">9,972.46</td> <td class="data dataUp" valign="middle" ><img height="6" width="11" src="/resources_v2/images/arrowPos.gif"> +7.37</td> <td class="data" valign="middle">+0.07%</td> </tr> <tr><td valign="middle"><a href="/business/markets/index?symbol=hk%21hsi">Hang Seng</a></td> <td class="data size8" valign="middle">22,747.95</td> <td class="data dataDown" valign="middle" ><img height="6" width="11" src="/resources_v2/images/arrowNeg.gif"> -22.52</td> <td class="data" valign="middle">-0.10%</td> </tr> <tr class="stripe"><td valign="middle"><a href="/business/markets/index?symbol=in%21sen"> Sensex</a></td> <td class="data size8" valign="middle">18,744.56</td> <td class="data dataDown" valign="middle" ><img height="6" width="11" src="/resources_v2/images/arrowNeg.gif"> -69.92</td> <td class="data" valign="middle">-0.37%</td> </tr> <tr></tr> </table> <div class="moreLink"> <a href="/business/markets/indices?blob=">&#187; All Indices</a></div></div> </div> <div class="linebreak"></div> <div class="mm-currencies"><div class="module"> <div class="moduleHeader"> <h3> <a href="/business/currencies?blob="> Currencies</a> </h3> </div> <div class="moduleBody"> <table cellspacing="1" cellpadding="1" width="100%" border="0" id="currPairs" class="dataTable"> <tr class=""> <td><a href="/business/currencies/quote?srcAmt=1&srcCurr=GBP&destAmt=&destCurr=USD">GBP/USD</a></td> <td class="data bold"> 1.6110</td> <td class="data dataUp bold"> +0.17%</td> </tr> <tr class="stripe"> <td><a href="/business/currencies/quote?srcAmt=1&srcCurr=GBP&destAmt=&destCurr=EUR">GBP/EUR</a></td> <td class="data bold"> 1.1130</td> <td class="data dataUp bold"> +0.63%</td> </tr> <tr class=""> <td><a href="/business/currencies/quote?srcAmt=1&srcCurr=EUR&destAmt=&destCurr=USD">EUR/USD</a></td> <td class="data bold"> 1.4471</td> <td class="data dataDown bold"> -0.45%</td> </tr> </tbody></table> <div class="moreLink"> <a href="/business/currencies?blob=">&#187; All Currencies</a></div></div> </div> </div> <div class="linebreak"></div> <div class="mm-commodities"><div class="module"> <div class="moduleHeader"> <h3> <a href="/business/commodities?blob="> Commodities</a> </h3> </div> <div class="moduleBody"> <table width="100%" cellpadding="0" cellspacing="0" border="0" class="dataTable"><tbody class="dataSmall"> <tr> </tr> <tr> <td valign="top"> <a href="/business/[email protected]"> Gold</a></td> <td class="data" valign="top"> 1,510.30</td> <td class="data changeUp" nowrap="nowrap" valign="top"> +27.70</td> <td class="data changeUp" nowrap="nowrap" valign="top">
  18. Have you tried that code? You should be able to use "" because PHP is a server side script and so the information is parsed before the Javascript is meaning the "" dont affect the javascript could. Hope this helps Rhys
  19. I use the same method to get information from a different website (with HTML) that works fine (see http://www.phpfreaks.com/forums/index.php?topic=328096.msg1544543#msg1544543, topic was solved by MrXHellboy), so I am pretty sure it is possible to do it, I just have something wrong with my code. Thanks Rhys
  20. Hi, Basically I am taking some data from a website, and am storing it in a file called dump.text, I am then using preg_match to find a line in the file, that I need to get some variable information from. I have managed to get the file working but cant seem to get the preg_match bit working: preg_match('/<td><a href="/business/currencies/quote?srcAmt=1&srcCurr=GBP&destAmt=&destCurr=EUR">GBP/EUR<\/a><\/td>\s+ <td\s+class="data changeUp"> \s+ <img\s+width="9"\s+height="10"\s+src="/resources_v2/images/changeUp.gif"\s+\/>(.*?)<\/td>/si', $eurovalue, $euroarray); does anyone know what is wrong with it, all I want it to do is to find that line and then below that I echo it, however it doesnt display anything (I would expect it to display the line above). I have checked my dump.text file and the it is working from that end. I have added in things such as /'s, \'s and +si, I dont really know what they are for but have used them in previous codes. Can anyone tell me what I am doing wrong (before you ask I have looked at the php documentation for this but couldnt really see any answer) Thanks Rhys
  21. I know the basics of JQuery but still dont know how to do what I want above, I have looked at the documentation, and dont know what I should be looking at, any ideas? Thanks
  22. Hi, I am trying to create some code with either AJAX or preferable JQuery. Basically I want it so that when someone clicks on a link ("Add to Favourites") the JQuery sends the data to a seperate page, using GET and on the current page displays a confirmation message ("Successfully Added to Favourites"). I want this to happen without going to a new page. I have managed to do this using HTML and PHP but dont know how to go about getting the JQuery to do what I want above. I have looked on Google for tutorials but couldnt find any that fit my criteria. Does anyone have any ideas what I should do, and if this is even possible? Thanks Rhys
  23. ok thanks
  24. Hi, I currently have a home server (my old PC with Apache HTTP Server installed) and a virtual hosting server. I have all my files such as music and word documents on my home server which will be shown by my virtual hosting server which has php files to display the documents. I was wondering if it was possible to upload files to my home server using some kind of code on my virtual hosting server. This would mean the code can access my external server. Is this possible? If so can anyone explain how I should do it or some links with tutorials. Also would this be secure and would other people be able to do this (without a password). I hope this makes sense. Thanks Rhys
  25. What errors are you getting?
×
×
  • 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.