Jump to content

awebbdesign

Members
  • Posts

    28
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

awebbdesign's Achievements

Member

Member (2/5)

0

Reputation

  1. Well I have tried reading the manual, might as well of been in Japanese. I want to convert the following: pages.php?name=introduction.htm&id=47 into: introduction.htm As you can see the name of the file is in the 1st bit, so I tried: RewriteRule (.*)\ /pages.php?name=$1&id=$2 [L] But it didn't work, if someone can correct the code pattern for it to work I would be most grateful. Andy
  2. I need the following XML code http://primarymortgages.co.uk/dev/property-xml-donotdelete.xml to be entered into the database, while I have done the first bit... <code> # address - basic info if(is_object($xml->address)) { foreach($xml->address as $address) { $name = $address->name; $street = $address->street; $locality = $address->locality; $town = $address->town; $county = $address->county; $postcode = $address->postcode; $custom_location = $address->custom_location; $display = $address->display; $insertS = "INSERT INTO $tablec (pal, afield, bfield, cfield, dfield, efield, ffield, hfield, ifield, jfield) VALUES (110, '$bD->afield', '$name', '$street', '$locality', '$town', '$county', '$postcode', '$custom_location', '$display')"; $insertQ = mysql_query($insertS); $iid = mysql_insert_id(); } } # property - basic info if(is_object($xml)) { $long = $xml->longitude; $lat = $xml->latitude; $type = $xml->type; $furnished = $xml->furnished; $bedrooms = $xml->bedrooms; $bathrooms = $xml->bathrooms; $description = $xml->description; $updateS = "UPDATE $tablec SET kfield = '$long', lfield = '$lat', mfield = '$type', nfield = '$furnished', ofield = '$bedrooms', pfield = '$bathrooms', atext = '$description' WHERE pal = 110 AND id = $iid"; $updateQ = mysql_query($updateS); } </code> I need to be able to get the paragraphs... <paragraph id="1" type="0"> <name>DESCRIPTION</name> <file /><dimensions> <metric /> <imperial /> <mixed /> </dimensions> <text>Primary are pleased to offer this two bedroom first floor maisonette in Wootton Bassett. The accommodation comprises of private entrance hall, lounge, kitchen, two bedrooms and bathroom. The property also benefits from uPVC double glazing, central heating and two allocated parking spaces. No onward chain.</text> </paragraph> <paragraph id="2" type="0"> <name>PRIVATE ENTRANCE PORCH</name> <file /> <dimensions> <metric /> <imperial /> <mixed /> </dimensions> <text>Storage cupboard.</text> </paragraph> <paragraph id="3" type="0"> <name>PRIVATE ENTRANCE HALL</name> <file /> <dimensions> <metric /> <imperial /> <mixed /> </dimensions> <text>Stairs leading to first floor. Radiator.</text> </paragraph> etc, etc... However the following code isn't working for me... <code> # paragraphs print_r ($xml->paragraph); foreach($xml->paragraph as $paragraph) { $thetitle = $paragraph->title; $thetext = $paragraph->text; $insertS = "INSERT INTO $tablec (pal, afield, bfield, atext) VALUES (111, '$iid', '$thetitle', '$thetext')"; $insertQ = mysql_query($insertS); print "<p>$insertS</p>"; } </code> Can someone adjust the # paragraphs code for me so it can work Many Thanks.
  3. Your a star! I just couldn't see it. Many thanks for your help.
  4. The values you've mentioned don't work. I suspect it's this bit... <code> if(is_object($xml)) { foreach($xml as $property) { //print_r($property); $long = $property->longitude; $lat = $property->latitude; $type = $property->type; $furnished = $property->furnished; $bedrooms = $property->bedrooms; $bathrooms = $property->bathrooms; $description = $property->description; $updateS = "UPDATE $tablec SET kfield = '$long', lfield = '$lat', mfield = '$type', nfield = '$furnished', ofield = '$bedrooms', pfield = '$bathrooms', atext = '$description' WHERE pal = 110 AND id = $iid"; $updateQ = mysql_query($updateS); print "<p>Furnished: $furnished</p>"; } } </code> Either... if(is_object($xml)) { Or.. foreach($xml as $property) { needs changing; I'm just not sure, any ideas?
  5. I have the following xml file... <property id="21179035" propertyid="111290" system="A" firmid="11548" branchid="1" database="1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xsi:noNamespaceSchemaLocation="http://webservices.vebra.com/export/xsd/v1/exportapi.xsd"> <reference> <agents>11290</agents> </reference> <address> <name>16</name> <street>Bardsey Close</street> <locality>Wootton Bassett</locality> <town>Swindon</town> <county>Wilts</county> <postcode>SN4 8NA</postcode> <custom_location>West of Swindon</custom_location> <display>Wootton Bassett, Swindon</display> </address> <price qualifier="" currency="GBP">107750</price> <rm_qualifier>0</rm_qualifier> <available>01/01/1900</available> <uploaded>04/08/2010</uploaded> <longitude>-1.886723</longitude> <latitude>51.54373</latitude> <easting>407855</easting> <northing>182820</northing> <web_status>1</web_status> <custom_status /> <comm_rent /> <premium /> <service_charge /> <rateable_value /> <type>Maisonette</type> <type /> <furnished>3</furnished> <rm_type>0</rm_type> <let_bond>0</let_bond> <rm_let_type_id>0</rm_let_type_id> <bedrooms>2</bedrooms> <receptions>0</receptions> <bathrooms>1</bathrooms> <userfield1 /> <userfield2>0</userfield2> <area measure="metric" unit="sqm"> <min>0</min> <max>0</max> </area> <area measure="imperial" unit="sqft"> <min>0</min> <max>0</max> </area> <description>Primary are pleased to offer this two bedroom first floor maisonette in Wootton Bassett. The accommodation comprises of private entrance hall, lounge, kitchen, two bedrooms and bathroom. The property also benefits from uPVC double glazing, central heating and two allocated parking spaces. No onward chain. </description> <hip> <energy_performance> <energy_efficiency> <current>67</current> <potential>77</potential> </energy_efficiency> <environmental_impact> <current>67</current> <potential>80</potential> </environmental_impact> </energy_performance> </hip> <paragraphs> <paragraph id="1" type="0"> <name>DESCRIPTION</name> <file /> <dimensions> <metric /> <imperial /> <mixed /> </dimensions> <text>Primary are pleased to offer this two bedroom first floor maisonette in Wootton Bassett. The accommodation comprises of private entrance hall, lounge, kitchen, two bedrooms and bathroom. The property also benefits from uPVC double glazing, central heating and two allocated parking spaces. No onward chain. </text> </paragraph> <paragraph id="2" type="0"> <name>PRIVATE ENTRANCE PORCH</name> <file /> <dimensions> <metric /> <imperial /> <mixed /> </dimensions> <text>Storage cupboard.</text> </paragraph> <paragraph id="3" type="0"> <name>PRIVATE ENTRANCE HALL</name> <file /> <dimensions> <metric /> <imperial /> <mixed /> </dimensions> <text>Stairs leading to first floor. Radiator.</text> </paragraph> <paragraph id="4" type="0"> <name>FIRST FLOOR</name> <file /> <dimensions> <metric /> <imperial /> <mixed /> </dimensions> <text>Landing: Loft access (part boarded), built in storage cupboard with hanging rail, airing cupboard. Doors leading to lounge, bathroom and both bedrooms.</text> </paragraph> <paragraph id="5" type="0"> <name>LIVING ROOM</name> <file ref="1" /> <dimensions> <metric /> <imperial /> <mixed>5.05m(16'7'') x 3.43m(11'3'')</mixed> </dimensions> <text>uPVC double glazed window to front elevation. TV point. Telephone point. Radiator. Door leading to:</text> </paragraph> <paragraph id="6" type="0"> <name>KITCHEN</name> <file ref="2" /> <dimensions> <metric /> <imperial /> <mixed>2.57m(8'5'') x 2.54m(8'4'')</mixed> </dimensions> <text>uPVC double glzed window to rear elevation. Wall and base units with rolled edge work surfaces over. Wall mounted central heating boiler and thermostat. Space for fridge freezer, oven and washer drier. Tiled splashbacks.</text> </paragraph> <paragraph id="7" type="0"> <name>BEDROOM ONE</name> <file ref="3" /> <dimensions> <metric /> <imperial /> <mixed>3.76m(12'4'') x 3.05m(10'0'')</mixed> </dimensions> <text>uPVC double glazed window to front elevation. Built in double wardrobe. Telephone extension. Radiator.</text> </paragraph> <paragraph id="8" type="0"> <name>BEDROOM TWO</name> <file /> <dimensions> <metric /> <imperial /> <mixed>3.71m(12'2'') x 2.26m(7'5'')</mixed> </dimensions> <text>uPVC double glazed window to rear elevation. Radiator.</text> </paragraph> <paragraph id="9" type="0"> <name>BATHROOM</name> <file /> <dimensions> <metric /> <imperial /> <mixed /> </dimensions> <text>Obscure uPVC double glazed window to rear elevation. White suite comprising of panel bath with shower over, pedestal hand wash basin and low level WC. Radiator.</text> </paragraph> <paragraph id="10" type="0"> <name>VIEWING</name> <file /> <dimensions> <metric /> <imperial /> <mixed /> </dimensions> <text>Strictly via our Swindon office telephone (01793) 641641, out of office hours Dawn Graham 07887763163.</text> </paragraph> <paragraph id="11" type="0"> <name>MORTGAGES</name> <file /> <dimensions> <metric /> <imperial /> <mixed /> </dimensions> <text>If you would like independent mortgage advice please call Primary Mortgage Centre on (01793) 616617. Home visits available.</text> </paragraph> <paragraph id="12" type="0"> <name>MONEY LAUNDERING</name> <file /> <dimensions> <metric /> <imperial /> <mixed /> </dimensions> <text>Intending purchasers will be asked to produce identification documentation at a later stage and we would ask for your co-operation in order that there will be no delay in agreeing the sale.</text> </paragraph> <paragraph id="13" type="2"> <name /> <file /> <dimensions> <metric /> <imperial /> <mixed /> </dimensions> <text>This footer paragraph is an example only and should not be relied upon as complying with current legislation. These particulars, whilst believed to be accurate are set out as a general outline only for guidance and do not constitute any part of an offer or contract. Intending purchasers should not rely on them as statements of representation of fact, but must satisfy themselves by inspection or otherwise as to their accuracy. No person in this firms employment has the authority to make or give any representation or warranty in respect of the property.<br/></text> </paragraph> </paragraphs> <bullets> <bullet id="1">First Floor Maisonette</bullet> <bullet id="2">Two Bedrooms</bullet> <bullet id="3">Lounge</bullet> <bullet id="4">Kitchen</bullet> <bullet id="5">Private Entrance</bullet> <bullet id="6">Allocated Parking</bullet> <bullet id="7">Good Location</bullet> <bullet id="8">No Onward Chain</bullet> </bullets> <files> <file id="0" type="0"> <name /> <url>http://images.vebra.com/images/1548/001/type1/bardse~1.jpg</url> <updated>30/08/2011 17:03:00</updated> </file> <file id="1" type="0"> <name>LIVING ROOM</name> <url>http://images.vebra.com/images/1548/001/type1/bardse~2.jpg</url> <updated>30/08/2011 17:03:00</updated> </file> <file id="2" type="0"> <name>KITCHEN</name> <url>http://images.vebra.com/images/1548/001/type1/bardse~3.jpg</url> <updated>30/08/2011 17:03:00</updated> </file> <file id="3" type="0"> <name>BEDROOM ONE</name> <url>http://images.vebra.com/images/1548/001/type1/bardse~4.jpg</url> <updated>30/08/2011 17:03:00</updated> </file> <file id="4" type="9"> <name>Energy efficiency chart</name> <url>http://images.vebra.com/home/hip/EE_0275_067_077.png</url> </file> <file id="5" type="9"> <name>Environmental impact chart</name> <url>http://images.vebra.com/home/hip/EI_0275_067_080.png</url> </file> </files> </property> I have the following code... # address - basic info if(is_object($xml->address)) { foreach($xml->address as $address) { //print_r($property); $name = $address->name; $street = $address->street; $locality = $address->locality; $town = $address->town; $county = $address->county; $postcode = $address->postcode; $custom_location = $address->custom_location; $display = $address->display; $insertS = "INSERT INTO $tablec (pal, afield, bfield, cfield, dfield, efield, ffield, hfield, ifield, jfield) VALUES (110, '$bD->afield', '$name', '$street', '$locality', '$town', '$county', '$postcode', '$custom_location', '$display')"; $insertQ = mysql_query($insertS); $iid = mysql_insert_id(); } } # property - basic info if(is_object($xml)) { foreach($xml as $property) { //print_r($property); $long = $property->longitude; $lat = $property->latitude; $type = $property->type; $furnished = $property->furnished; $bedrooms = $property->bedrooms; $bathrooms = $property->bathrooms; $description = $property->description; $updateS = "UPDATE $tablec SET kfield = '$long', lfield = '$lat', mfield = '$type', nfield = '$furnished', ofield = '$bedrooms', pfield = '$bathrooms', atext = '$description' WHERE pal = 110 AND id = $iid"; $updateQ = mysql_query($updateS); print "<p>$updateS</p>"; } } The first bit is working fine (# address - basic info) and I am able to get the information out, however the longitude and latitude bit I'm struggling with (# property - basic info) Any help would be much appreciated.
  6. It printed out the following... SimpleXMLElement Object ( [name] => Swindon [firmid] => 11548 [branchid] => 1 => http://webservices.vebra.com/export/primaryexechomesAPI/v1/branch/3762 ) Name: SimpleXMLElement Object ( [name] => Swindon [firmid] => 17548 [branchid] => 11 => http://webservices.vebra.com/export/primaryexechomesAPI/v1/branch/10061 ) Name: Im trying to get each of the object names into variables so I tried... if( is_object($xml->branch) ) { echo '<pre>'; foreach( $xml->branch as $branch ) { print_r( $branch ); $name = $branch['name']; print "<p>Name: $name</p>"; } echo '</pre>'; } It didn't assign the name Swindon to $name!
  7. I have got some xml which I have ran $xml = simplexml_load_string($result); Now I need to be able to access the values in a for loop, I've done this before, but it escapes me. The XML code is as follows... <?xml version="1.0" encoding="iso-8859-1" standalone="yes"?> <branches xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xsi:noNamespaceSchemaLocation="http://webservices.vebra.com/export/xsd/v1/exportapi.xsd"> <branch> <name>Swindon</name> <firmid>11548</firmid> <branchid>1</branchid> <url>http://webservices.vebra.com/export/primaryexechomesAPI/v1/branch/3762</url> </branch> <branch> <name>Swindon</name> <firmid>17548</firmid> <branchid>11</branchid> <url>http://webservices.vebra.com/export/primaryexechomesAPI/v1/branch/10061</url> </branch> </branches> My code for trying to get the values when in a for loop is... # format xml and insert the different branches into the db $xml = simplexml_load_string($result); # loop through the number of branches //$branches = count($xml); for($b = 0; $b < count($xml); $b++) { //$name = $xml->name; //$name = $xml->['name']; //$name = $xml['name']; //$name = $xml['branch']; //$name = $xml->['branch']['name']; //$name = $xml[$b]->['branch']['name']; $name = $xml->['branch']['name']; print "<h1>Name</h1>"; } As you can see I've tried to get the value out, just cant seem to do it. Any help will be much appreciated!
  8. Hi All, Below I have the following code... RewriteEngine On RewriteCond %{HTTPS} off RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} Which works fine on he domain, however when I go into a subfolder it says... Too many redirects occurred trying to open “https://purple-orchid.co.uk/test/index.php”. This might occur if you open a page that is redirected to open another page which then is redirected to open the original page. Can anyone modify my code so that subfolder don't cause an issue (and sub-sub folder i.e https://www.purple-orchid.co.uk/test/admin/) Much appreciated
  9. Many thanks. Just what I was looking for.
  10. I am currently recoding a website from ASP to PHP. The aim is for a customer to add items to a cart, fill in their credit card details. Then an email is encrypted (on the secure website) and sent to the client. The client then opens the email on her PC and it is decoded either when she opens the e-mail, or downloads an attachment that can be opened by a program that requires a password. Once entered the order is revealed, the e-mail is decrypted. I just wondered if anyone has any link to sites where I can download the de-crypting software to install on the clients machine. Or any other ideas on sending an encrypting email and decrypting on the recipients computer. Many thanks.
  11. 15 min break and I have fixed the error.... <?php header("Content-type: image/jpeg"); error_reporting(E_ALL); ini_set("display_errors", 1); include('../../connect.php'); $bid = $_GET['bid']; $imgS = "SELECT * FROM $table WHERE iid = '8' AND id = '$bid'"; $imgQ = mysql_query($imgS); $imgD = mysql_fetch_object($imgQ); print "$imgD->ablob"; ?> It had nothing to do with the blob page, believe it or not my connect file was to blame as my <?php start tag had a space before it, causing a header error. I removed the space and now works perfectly. Thanks for all your help dude. http://www.awebbdesign.com
  12. I have had some luck recreating the script in a seperate folder... <?php include('connect.php'); $bid = $_GET['bid']; $imageS = "SELECT * FROM phpblob WHERE id = '$bid'"; $imageQ = mysql_query($imageS); $imageD = mysql_fetch_object($imageQ); header("Content-type: image/jpeg"); print "$imageD->bbblob"; ?> The weird thing is, this now works, but not on the site that I am trying to get to work, it doesn't. I may have to take a break and look at this another time.
  13. Example below[clip]: ÿØÿà�JFIF��H�H��ÿÛ�C� !"$"$ÿÛ�CÿÀ��p�Ñ"�ÿÄ����������� ÿÄ�µ���}�!1AQa"q2‘¡#B±ÁRÑð$3br‚ %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyzƒ„…†‡ˆ‰Š’“”•–—˜™š¢£¤¥¦§¨©ª²³´µ¶·¸¹ºÂÃÄÅÆÇÈÉÊÒÓÔÕÖ×ØÙÚáâãäåæçèéêñòóôõö÷øùúÿÄ�������� ÿÄ�µ��w�!1AQaq"2B‘¡±Á #3RðbrÑ $4á%ñ&'()*56789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz‚ƒ„…†‡ˆ‰Š’“”•–—˜™š¢£¤¥¦§¨©ª²³´µ¶·¸¹ºÂÃÄÅÆÇÈÉÊÒÓÔÕÖ×ØÙÚâãäåæçèéêòóôõö÷øùúÿÚ���?�ú‚¹‹+Õ<áy5ë =Zc›¤kÏ Æœ�ÃåmÜž•ÖÊéM$Œb{Ö¼w⎴/ü ñ…æŠ× ¢yÓDSsnR úŠøªQ¼–šî“H·Æé?™Úü)ñ^©ãO¦¿¡Ç£Ársj‹yç™Xü«·‘Ò°¼ñfËÄßuŸÅ§ˆ?³ÄžMßÚ7} ÆÁXmÚ6õ=ÏJ©ðç[Ã_³VŸ®È@šSʹîÁ›hüNxƒoî<'ãok×:&©¦—”Ũ^]ŵ.üé—SÜß"º#IIËOCÑ¥ƒ§RU4Úê>¨úƒâ¯Œïüi¤ÿ�eè ¬ÞjwÂÎe¹òNâ¬ÙÎÖþïµp!øÝâíÄ6>Õ>µ;ð¦ÚÝ5¥‘Ÿsv3ŽAë^©ã‹OÐå×uÈ­Ì:H7qK"183ÑŽvŒz׋|´m_Õ>5xÖH­­÷˜ôá3b8;w‚z�>QîXÔAÇ•¹GEù˜á¡Mʤoo[¶öJÇâïˆ^"ÓÕœgeÌã®ßðMcNŠ¢ç(kk-îÝ®Þû#Ñ~!뺆ü){­éºBjÒY¡šXçÈýÒ‚YƒmlLs\§Ã"ñ‡/üQiàèañaj€ý¬©"@[Ë1ŒƒŸlWAñ~ø©A¦\ ÿ�¿M\gìÆøø`Ÿí]ÿ�Šrƒ§ÍÖç=*Pt\ÜnÔ’ë±›ðïãÕÇŒõ[½ÛÂ1ÛêKjóYÀú—ËrêFcÜcxÉÏ=+½øGãSÆþ:åï‡ÓG¶•ÊÚyç™B³+“ò®Ü2‘ï_/k7žÒ<ñ#N‹fwE6Þ7I®yÿ�y _¢×Ñ¿³ŒÁþhŸòÑ®Jƒïs)­kF‡4Q×ÂR…/iN:7mÞ^ÿ�‘sâÄ3áïé^Ñô†ÖuíL†ÜÎ!gæw àpÝðš§añÄÑø÷LðŸˆüºdš‚HñÝŨyаEÉÛòŸPpGkœøåà+ßxªËVð~½ŸŠô›Uv·3yr‹6Ç>ï;Ç<çƒðÓâ'ì~&iþ ø“¦E%ì¹wRB‚h˜ƒ†¿++m##ó§EÂëþ •<59Ñæ‚M¤î›iú®–:Ý+âLj.>(7o¼oeuó&˜êÁ”C€ÛÔycwÊsŒúú¯¦ümŸTðˆüA¦xb)Žƒu²xQ ¾q(>_\ŒmÇã\§í1q7ƒ~(øsÇ6ˆOi5¬¸îUHçð“ÿ�¯0Ðì5 ^¸ðùÿ� M¾˜$>›Ú)[òÌ‹ZF”%+]NšX*5))¨¥tžï£×©ôÖ»ã¿éSÆw ‡ÎP&¸±þÓ�Åoòù<Œ®8Ï^* üCñ&¹ð¾ëÆÐx:(­-µ¡Õg‰ Þû¼¿”§8­/ŽŠ«ðsÄŠ {€aÅsß¿äÚm?ìuüä¬R‹íÔãŒ)J—?*¿5ºí½·2< ñêoEªÁaáãÕ,í~Õohú—(ó�sÚ@9>ÕÔé>?ñ£ð®oÇàØUÂ5Ä6_Úƒ2Û¨ËI¿ËàðØ\sÏ5ó¯‰-.|wà_éñbßRÑ¡
  14. Hi All, I have done some script inserting a jpeg into a longblob, I know this works because I can see the image in the blob field using 'Navicat' however when trying to get the image out in PHP all I get is garbage. INDEX.PHP print "<img src='pages/portfolio/blob.php?id=$portD->id' alt='IMG' width='200' height='100' />"; BLOB.PHP include('../../connect.php'); $id = 140; $portS = "SELECT ablob FROM $table WHERE iid = '8' AND id = '$id'"; $portQ = mysql_query($portS); $portD = mysql_fetch_object($portQ); header("Content-type: image/jpeg"); print $portD->ablob; HELP!! I have googled everywhere, but it hust wont work, any pointers would be great.
  15. I have just solved it using... $start = '000000000000000000000000'; $end = 999999999999999999999999; /* started at 0 */ for($i = 0; $i < 1000; $i++) { printf("%024s", $i); print "<br />"; } Many thanks for your help dude.
×
×
  • 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.