Jump to content

dennismonsewicz

Members
  • Posts

    1,136
  • Joined

  • Last visited

Everything posted by dennismonsewicz

  1. Array ( [0] => C211PTT [1] => C211RED [2] => C211PTT )
  2. yeah they do... I did a print_r on the array and the post data shows up
  3. I have the following foreach statement: $modOne = $_POST['modelone']; $modTwo = $_POST['modeltwo']; $modThree = $_POST['modelthree']; $array = Array($modOne, $modTwo , $modThree); foreach($array as $r) { $man_db =& JFactory::getDBO(); $man_db->setQuery("SELECT * FROM tblName WHERE model = '$r'"); $man_rows = $man_db->loadObjectList(); foreach($man_rows as $row) { $deduct = $row->deductible; if($deduct == '89.99') { $prem = '6.00'; } elseif($deduct == '39.99') { $prem = '4.49'; } } } It is only hitting the first variable in the array... how can I make this go through each array var?
  4. Does anyone know a good tutorial on setting up PHP com objects? I am wanting to create an outlook script that sends out a meeting request with an email.
  5. hmmm thanks! The problem is that I am retrieving this from a database, how can I change that on the fly (the hypens to underscores)?
  6. here is the XML string that is coming back <?xml version='1.0' encoding='UTF-8'?><root available-locales="en_US" default-locale="en_US"><static-content language-id="en_US"><![CDATA[<div style="width: 800px;"><div style="float: left;"><img border="0" src="/image/image_gallery?uuid=1223947d-4f92-4531-b790-3cdfb0276b41&groupId=14&t=1243886532560" alt="" /></div> <div style="float: right;"><img border="0" src="/image/image_gallery?uuid=cdf5279a-8d6b-421e-9984-860b9f679632&groupId=14&t=1243886532561" alt="" /></div> <br /> <table width="100%" cellpadding="2" bordercolor="#a9a9a9" border="1"> <tbody> <tr> <td>For customers who enroll in the <strong>metroGuard</strong> program on or after November 1, 2004, the equipment deductible is based on your phone model per the schedule below:</td> </tr> </tbody> </table> <table border="0"> <tbody> <tr> <td> </td> </tr> </tbody> </table> <table width="100%" cellpadding="2" bordercolor="#a9a9a9" border="1"> <tbody> <tr bordercolor="#000000"> <th align="left">Program A</th> <th align="left">Program B</th> <th align="left">Program C</th> </tr> <tr bordercolor="#000000"> <th align="left">$50 Deductible</th> <th align="left">$85 Deductible</th> <th align="left">$35 Deductible</th> </tr> <tr> <td>Audiovox 8500, 8615</td> <td>Audiovox 8900, 8910, 8932</td> <td> </td> </tr> <tr> <td> </td> <td>Blackberry 8330</td> <td> </td> </tr> <tr> <td>Ericsson T206, T61C</td> <td> </td> <td> </td> </tr> <tr> <td>Huawei M328</td> <td> </td> <td>Huawei M318</td> </tr> <tr> <td>LG/LX 1200, 5400, 3200</td> <td> </td> <td> </td> </tr> <tr> <td>Kyocera K312, K312P, Rave(KX433C),<br /> KE433C, S14, S4000, 1155, 2235</td> <td>Kyocera Slider(SE47), K612(Strobe), E2000</td> <td>Kyocera Melo</td> </tr> <tr> <td>Nokia 2270, 2865, 3585, 3585i, 3586i,<br /> 3589i, 6015, 6015i, 2116i</td> <td>Nokia 3205, 6225, 6235, 6255, 6265, 8265i</td> <td>Nokia 1006, 1606, 2125i, 2135</td> </tr> <tr> <td>Motorola V262, VE240, W315, W385</td> <td>Motorola Hint, V266, V323i, KRZR <br /> K1m, RAZRV3, RAZR V3a, RAZRV3M, RAZRV3C, <br /> RAZRV3CMR,RAZRVCMS, RAZRV3S, K1M,<br /> SLVR L7C, Z6m</td> <td> </td> </tr> <tr> <td>Samsung N330, A570, A645, R300, R430</td> <td>Samsung A610, A670, A850, A870, Finesse, R400, <br /> R410, R450, U520</td> <td>Samsung R210 SPEX</td> </tr> <tr> <td>UTStarcom CDM 7025, 7126, 1450</td> <td>UTStarcom 8932</td> <td> </td> </tr> <tr> <td>ZTE C78, ZTEC79, ZTEC88</td> <td> </td> <td> </td> </tr> </tbody> </table> <table border="0"> <tbody> <tr> <td> </td> </tr> </tbody> </table> <table width="100%" cellpadding="2" bordercolor="#a9a9a9" border="1"> <tbody> <tr> <td bgcolor="#c0c0c0"><strong>metroGUARD</strong> is a service provided to subscribers of MetroPCS, administered by Asurion Insurance Services,Inc. and<br /> Old Republic Insurance Company</td> </tr> </tbody> </table></div>]]></static-content></root>
  7. Hello yall, I am a complete NEWB to simplexml, so, sorry for this post... here is my simplexml code to display content: $xml = simplexml_load_string($row->content); var_dump($xml); output to browser: object(SimpleXMLElement) (2) { ["@attributes"]=> array(2) { ["available-locales"]=> string(5) "en_US" ["default-locale"]=> string(5) "en_US" } ["static-content"]=> object(SimpleXMLElement) (2) { ["@attributes"]=> array(1) { ["language-id"]=> string(5) "en_US" } ["#cdata-section"]=> object(SimpleXMLElement) (0) { } } } how do I parse the above to display the static-content?
  8. I got it fixed. I had to escape the $ symbol updated code: foreach($deduct_rows as $rows) { $deduct = $rows->deductible; echo '<div style="padding-top:20px;">'; echo '<span class="maintitle" style="font-size: 30px !important; display: block;">Your deductible is \$'. $rows->deductible .'</span>'; echo '<span class="maintitle" style="font-size: 20px; !important; display: block; padding-top: 20px;">Your bundle price is \$' . $rows->bundle . '</span>'; echo '<span class="maintitle" style="font-size: 20px; !important; display: block; padding-top: 10px;">Your insurance price is \$' . $rows->insurance . '</span>'; echo '<span class="maintitle" style="font-size: 20px; !important; display: block; padding-top: 10px;">Your warranty price is \$' . $rows->warranty . '</span>'; echo '</div>'; }
  9. <div class="maintitle" style="font-size: 30px ! important;">Your Deductible is .00</div> I have it boiled down to if I include an HTML $ symbol then it doesn't display the characters before the decimal for some reason
  10. yeah I noticed that and that didn't fix the problem updated code: foreach($deduct_rows as $rows) { echo '<div style="padding-top:20px;">'; echo '<span class="maintitle" style="font-size: 30px !important;">Your deductible is $' . $rows->deductible . '</span>'; echo $rows->deductible; echo '</div>'; } If I echo out the deductible and it is not inside the span tag then everything displays like it should
  11. All of them... and if I print_r($rows); then the results display as they should. For some reason the Span tag is messing everything up
  12. Code: foreach($deduct_rows as $rows) { echo '<div style="padding-top:20px;">'; echo '<span class="maintitle" style="font-size: 30px !important; display: block;">Your deductible is $'. $rows->deductible .'</span>'; echo '<span class="maintitle" style="font-size: 20px; !important; display: block; padding-top: 20px;">Your bundle price is $' . $rows->bundle . '</span'; echo '<span class="maintitle" style="font-size: 20px; !important; display: block; padding-top: 10px;">Your insurance price is $' . $rows->insurance . '</span'; echo '<span class="maintitle" style="font-size: 20px; !important; display: block; padding-top: 10px;">Your warranty price is $' . $rows->warranty . '</span'; echo '</div>'; } The results come back as the following: $.99 when in the DB the actual row is 5.99 So its cutting off the first character.... any ideas?
  13. I have this code: <?php $url = $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']; $find = false; $aryCarriers = array('cat', 'dog'); foreach($aryCarriers as $carrier) { if(strpos($url, $carrier)) { $find = "http://localhost/web/pcc/" . $carrier; } else { $find = "ERROR"; } } echo $find; ?> If dog is the last string in the array and is in the url (http://localhost/web/pcc/dog/page.php) everything works fine! But if dog is anywhere else in the array it does not work. Any suggestions on this?
  14. changed my code yet again: $url = $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']; $arr = array("dog", "cat"); $explode = explode("/", $url); foreach($arr as $val){ if(in_array($val, $explode)) { $find = $val; } else { $find = "NOPE!"; } } if in the url cat is found and cat happens to be last in the array then it works... but if cat is in the url but is first in the array then it does not work
  15. ok so I am completely lost and am racking the hell out of my brain... any suggestions?
  16. ok so I have changed the code up a little bit $url = $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']; $arr = array("dog", "cat"); $find = count($arr); for($i > 0; $i > $find; $i++) { $find = strstr($url, $arr[$i]); } echo '<p>' . $find . '</p>'; it echoes out the actual numbered position of the value in the array (EX: cat equates to position 2; dog equates to position 1)
  17. your code works on one page but not on a another so if I have the url of http://localhost/cat/page.php (and then evaluate the url using the code it does not work) but if i have http://localhost/dog/page.php (it works) so its like its only finding the first variable in the array
  18. wow that worked perfectly lol... can you explain your code versus mine?
  19. sorry guys... It is not echoing out the $find. And if I echo out $key then I get the last variable in the array. so if dog and cat are in the array and then I echo out $key, I get cat. I need for this script to search through the URL I am grabbing for each of the values in the array. If it finds one then it will be set to a variable that I will then use to pass into my switch. I am just running some dummy code now to get the foreach statement working... Did any of that make sense? Sorry if it didn't... if you are still confused I will try to explain in more detail updated code <?php $url = $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']; $arr = array("dog", "cat"); $find = ''; foreach($arr as $key => $val) { $find = strstr($url, $val); } ?> <p><?php echo $find; ?></p>
  20. that still didn't work... I am trying to search the URL for a particular value and then I am going to create a switch.
  21. I have the following code: $url = $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']; $arr = array("dog", "cat"); foreach($arr as $key) { $find = strstr($url, $key); } echo $find; it isn't working... any suggestions?
  22. Cool! No problem bud! This is a REALLY awesome forum for learning PHP!
×
×
  • 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.