harristweed
Members-
Posts
346 -
Joined
-
Last visited
-
Days Won
1
Everything posted by harristweed
-
Generate different colors on table rows using array
harristweed replied to rocky_88's topic in PHP Coding Help
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"); -
change: To:
-
Generate different colors on table rows using array
harristweed replied to rocky_88's topic in PHP Coding Help
<?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; } ?> -
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}')"; ?>
-
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"; } } ?>
-
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
-
have 'pencils' with a blank white area. Use CSS to position the text over the image.
-
Using a HTML template with includes can't read from $_GET
harristweed replied to rpmorrow's topic in PHP Coding Help
You can not parse php in a page with an HTML extension. Save the page with a PHP extension and try that! -
Need little help with idea for event calendar
harristweed replied to tslid's topic in PHP Coding Help
Without knowing what your code is and the structure of your database, how can anyone answer? -
Write each textarea line as a new row in database
harristweed replied to perky416's topic in PHP Coding Help
split From manual> Warning This function has been DEPRECATED as of PHP 5.3.0. Relying on this feature is highly discouraged. -
MySQL UPDATE query using field names/values from array
harristweed replied to RLJ's topic in PHP Coding Help
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. -
To be sure which date format is intended, use a date picker for the input...http://jqueryui.com/demos/datepicker/
-
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.
-
Sessions?
-
Column count doesn't match value count at row 1
harristweed replied to sunilpaladugu's topic in MySQL Help
INSERT INTO datain2.student(id,name) VALUES ( '{$query_row['id']}', '{$query_row['name']}'); -
UTF-8 encoding not working on select pages
harristweed replied to Minklet's topic in PHP Coding Help
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. -
Has the page got a .php extension?
-
Email the page function adds + in between each word
harristweed replied to craigtolputt's topic in PHP Coding Help
ask for your money back! -
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"; } ?>
-
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!
-
If a page doesn't validate, you can't parse it with simplexml_load_file
-
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?
-
does the xml page validate? http://validator.w3.org/feed/
-
It is getting very different from your original question! foreach ($xml->outer->xml->undeveloped_lands->land as $value){
-
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!