Jump to content

harristweed

Members
  • Posts

    346
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by harristweed

  1. Could be a problem with array count not counting the values correctly, possible because the values in your array are not enclosed in quotes $color = array(red,green,blue); Should be: $color = array("red","green","blue");
  2. <?php $color = array(red,green,blue); $i=0; while ($row = mysql_fetch_assoc($exec)) { echo "<tr bgcolor=\"".$color[$i]."\">"; echo '<td>'.$row['brand_name'].'</td>'; echo '<td>'.$row['contact_name'].'</td>'; echo '<td>'.$row['contact_info'].'</td>'; echo '<td>'.$row['email'].'</td>'; echo '<td>'.$row['description'].'</td>'; echo '</tr>'; $i++; if($i==count($color))$i=0; } ?>
  3. try this: <?php $sql = "INSERT INTO rorligt ( arende, rumsnr, besk, adress, ejfakt, avslutad, best, rikt, listid) VALUES ( '{$arende[$x]}', '{$rumsnr[$x]}', '{$beskrivning[$x]}', '{$adress[$x]}', '{$ejfakturerat[$x]}', '{$avslutad[$x]}', 'best', '{$rikt}', '{$listid}')"; ?>
  4. note you have a tag mismatch "<name>CLueless</user>" <?php $xml_feed="<outer> <xml> <viewer> <user> <id>1245789</id> <name>CLueless</name> <business>none</business> </user> </viewer> </xml> </outer> "; if(!$xml = simplexml_load_string("$xml_feed")){ echo "Can't connect to feed $xml_feed"; }else{ foreach ($xml->xml->viewer->user as $value){ $id=$value->id; $name=$value->name; $biz=$value->business; echo"id=$id<br />\n"; echo"name=$name<br />\n"; echo"biz=$biz<br />\n"; } } ?>
  5. Leave page after doing whatever it is you do using something like: if(operation completed){ header("Location: send_me_back.php"); /* Redirect browser */ exit; } And have @send_me_back.php use same method to return to original page but without the $_GET
  6. have 'pencils' with a blank white area. Use CSS to position the text over the image.
  7. You can not parse php in a page with an HTML extension. Save the page with a PHP extension and try that!
  8. Without knowing what your code is and the structure of your database, how can anyone answer?
  9. split From manual> Warning This function has been DEPRECATED as of PHP 5.3.0. Relying on this feature is highly discouraged.
  10. I don't think mysql can use PHP arrays. You will need to build the query outside of mysql. Have a look at the PHP 'implode' function.
  11. To be sure which date format is intended, use a date picker for the input...http://jqueryui.com/demos/datepicker/
  12. I used a little known technique to find this: http://php.about.com/od/advancedphp/ss/php_file_upload.htm What I did was to type “php upload script” into a secret search engine called Google. Please keep this information secret otherwise people will use it and it will get overloaded, break and I won't be able to use it any more.
  13. INSERT INTO datain2.student(id,name) VALUES ( '{$query_row['id']}', '{$query_row['name']}');
  14. I’m sorry I was not able to resolve the problem for you. I am 64 years old and self taught. I do my best to help everybody, some times I give very poor advice but it is given with the best intentions. I am glad you were able to get assistance with your problem. Possibly it would help others if you posted the solution rather that poring scorn on those that are trying to help.
  15. Has the page got a .php extension?
  16. works for me! <?php if($xml = simplexml_load_file("http://mob-dynamic-lb4.mobsters09.com/mob/get_city_list?user_id=530830355&auth_key=d7240dc8bf350a48feb61eb04694bd67d5bc0cb1")){ echo"XML File Connected<br />\n"; ob_flush(); flush(); }else{ echo"Can't connect to feed"; exit; } foreach ($xml->xml->undeveloped_lands->land as $value){ $id=$value->id; echo"id=$id<br />\n"; } ?>
  17. This feed does not validate. line 3, column 0: Undefined root element: outer Should not stop it loading successfully. Give me a few moments, i'll try and parse it!
  18. If a page doesn't validate, you can't parse it with simplexml_load_file
  19. looking at the page source you have... <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> at the top and on line 206 <head> line 430 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> at the bottom of the page </body> </html> </div> <div id="FILTER_Compare_Bar_Bottom"></div> </div> <div id="content_bottom_bevel_light"></div> </div> <link href="stylesheet.css" rel="stylesheet" type="text/css"> <div id="footer"> <div align="center">© 2010 London Filter Company</div> </div> </body> </html> Just shows how good the Mozilla browsers are to display anything ..... Are you really using MSWord to create the page?
  20. does the xml page validate? http://validator.w3.org/feed/
  21. It is getting very different from your original question! foreach ($xml->outer->xml->undeveloped_lands->land as $value){
  22. I think they are error messages? but why they concern 'simplexml-load-string' and not 'simplexml_load_file' as I suggested you use, I have no idea!
×
×
  • 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.