Jump to content

Jalz

Members
  • Posts

    62
  • Joined

  • Last visited

    Never

Everything posted by Jalz

  1. Hi Guys, I have the following script which works fine for GoogleMaps <?php require'EasyGoogleMap.class.php'; $gm = & new EasyGoogleMap("rYvyXhRFPYW5tkV_IE5hWxecUidHAYjJhBSp59xzQuNZcoxNYCiaum4_Xb66Fw"); $gm->SetMarkerIconStyle('STAR'); $gm->SetMapZoom(10); $gm->SetAddress("10 market st, san francisco"); $gm->SetInfoWindowText("This is the address # 1."); $gm->SetAddress("Manila, Philippines"); $gm->SetInfoWindowText("This is Philippine Country."); $gm->SetSideClick('Philippines'); ?> <html> <head> <title>EasyGoogleMap</title> <?php echo $gm->GmapsKey(); ?> </head> <body> <?php echo $gm->MapHolder(); ?> <?php echo $gm->InitJs(); ?> <?php echo $gm->GetSideClick(); ?> <?php echo $gm->UnloadMap(); ?> </body> </html> I've now coded that static page to take the following, and within the GoogleMaps database field entered in exactly the following $gm->SetAddress("10 market st, san francisco"); $gm->SetInfoWindowText("This is the address # 1."); $gm->SetAddress("Manila, Philippines"); $gm->SetInfoWindowText("This is Philippine Country."); $gm->SetSideClick('Philippines'); <?php $maps_find = $OO_Open->newFindCommand('Maps'); $maps_find->AddFindCriterion('AccountName','xx'); $maps_result = $maps_find->execute(); $maps_row = current($maps_result->getRecords()); $Gdata = $maps_row->getField('GoogleMaps'); //echo $Gdata; //exit; ?> <?php require'EasyGoogleMap.class.php'; $gm = & new EasyGoogleMap("my key"); $gm->SetMarkerIconStyle('GT_FLAT'); $gm->SetMapZoom(10); $gm->SetMapWidth(1080); # default = 300 $gm->SetMapHeight(550); # default = 300 echo $maps_row->getField('GoogleMaps'); //eval("\$Gdata = \"$Gdata\";"); ?> <html> <head> <title>EasyGoogleMap</title> <?php echo $gm->GmapsKey(); ?> </head> <body> <?php echo $gm->MapHolder(); ?> <?php echo $gm->InitJs(); ?> <?php echo $gm->GetSideClick(); ?> <?php echo $gm->UnloadMap(); ?> </body> </html> Is there way of getting the $maps_row->getField('GoogleMaps'); command to behave as if it was php (when I echo it, it does display the code as text). I'm not using the FileMaker db to store the code, I thought eval function was the answer but not had much luck. Many Thanks for the advice Jalz
  2. Thanks Guys, Especially mjdamato for the solution which works. I'll take your and Pikachu2000 advice and as phase two normalize my database so I store each dietary options as records rather than single field. Cheers again Jalz
  3. Hi ldb358, Short answer is no. The list can contain from 1 to 3 words. I'll list them below, of course this can change depending on the end users. no wheat no sugar no red meat no cheese no dairy no pork vegetarian gluten free no fish no nuts (allergy) Thanks Jalz
  4. Hi Guys, I have a field within the the database that is outputting the following data "no wheat no sugar no pork" as a string. What I would like to do is is break that string down so its more readable with a character which I havent decided but lets say its the pipe, so the output would say no wheat | no sugar | no pork etc. Theres about 12 different options it could be, and I'm guessing I would probably have to use regex to identify them. Anyhelp would be much appreciated. Jalz
  5. Hi Guys, We've got a windows based network here and everything here has Single Sign On enabled so the user enters in their credentials once and it gets them through to all the things they should have access to. I've designed a database with lost and found items - fairly simple at this stage with one table, and within my database I have another table with usernames and a hashed password. What I would like to do in the long run is remove this table and allow my users to add/edit etc based on their windows login. What technologies do I need to look at in php that will enable me to do this? At present the pseudo code of when the user enters in the username and password on my form is as follows: Enter Username and Password click on Submit Check within database to see if credentials match If credentials match retrieve the membership category and store in a session variable else go back to login page and request a username and password Anyone help me with the concepts to understand this - we've got a partially working system using Moodle which I can 'lift' the Active directory settings, but I have no idea how the SSO will work. Anyone care to chip in with topics I should read up or sample tutorials to get me started reading the directory as I am a complete beginner and Im trying to replace an asp/access database that had all of this built in... Many Thanks for the advice - p.s no doubt there will be lots more questions from me on this subject. I'll keep it all in this thread so someone else may find it useful Jalz
  6. Hi Guys, Currently I have some code which I wrote long hand which works, however I would like to code it more elgantly using a loop. The only difference between the lines underneath is the variable name, each variable as a different number attached to it. if($order == 0) $event_edit->setField('DietaryRequirements',fmsCheckboxCombine($dietReqs0)); if($order == 1) $event_edit->setField('DietaryRequirements',fmsCheckboxCombine($dietReqs1)); if($order == 2) $event_edit->setField('DietaryRequirements',fmsCheckboxCombine($dietReqs2)); if($order == 3) $event_edit->setField('DietaryRequirements',fmsCheckboxCombine($dietReqs3)); if($order == 4) $event_edit->setField('DietaryRequirements',fmsCheckboxCombine($dietReqs4)); if($order == 5) $event_edit->setField('DietaryRequirements',fmsCheckboxCombine($dietReqs5)); if($order == 6) $event_edit->setField('DietaryRequirements',fmsCheckboxCombine($dietReqs6)); if($order == 7) $event_edit->setField('DietaryRequirements',fmsCheckboxCombine($dietReqs7)); if($order == $event_edit->setField('DietaryRequirements',fmsCheckboxCombine($dietReqs8)); if($order == 9) $event_edit->setField('DietaryRequirements',fmsCheckboxCombine($dietReqs9)); So the loop that I managed to come up with is as follows as I wont need the if statement from my original code: //recid is a array variable I've set up foreach($recid as $order => $recid1) { $dietReqs = '$dietReqs'.$order; $event_edit->setField('DietaryRequirements',fmsCheckboxCombine($dietReqs)); } However this doesn't seem to work. It doesn't show up an error message, but nether does it write the contents of variable $dietReqs0..9 in my database field where as my long hand does.I've tried putting echo just before the variable name, that does produce an error. Any ideas what I could be doing wrong? I could keep the long code as it works, but would love to simplify it ideally. Many Thanks to all that help
  7. Thanks andrewgauger, That works perfectly. On another issue, once I have added the data back to my database, I want to remove the value from the FirstName and Membership array as I have a mixture of old records and new records I am posting. I've searched the web, and I rekon I should be using the unset($FirstName[$key]) command. I've tried this and it doesn't want to remove the value, is there another remove command I should be using to remove values from the the array. Thanks for helping me get teh arrays in there in the first place, the search on google continues. Jalz
  8. Hi Andrew, Unfortunately, both snippets didnt make a difference (well they did, I've now got an array called Membership but the values from row one and two a coming in mixed). I'll try and explain what I have on my form, I have a input field called FirstName which is where I type in the firstname of a person. I then have some checkboxes beside this field, which contain upto 9 options. To get the 9 options to display, I've used an array like you have suggested below to display the checkboxes name=\"Membership[]\" The problem is, lets say I have two rows of data being displayed , i,m using | character as the checkbox separator: FirstName Membership Steve Jobs Apple|CEO|iPad|iphone Bill Gates Microsoft|Office|Kin When I submit my form, the values for Bill Gates get sent in the same array as the values for Steve Jobs. I would like to create an array called Membership and within that have another array for the values for Steve jobs and anolther array for the values of the second row Bill Gates. If I can do this, I know when I am writing a record back to the database (I have the correct values each member has chosen in the checkboxes). Hope that makes sense. Thanks for your help Jalz
  9. Hi all, I've set up a form with inputs which I am going to pass on in arrays as I have up to 10 repetitions. Below I've got a snippet of code from two input fields. When I send the data across, the FirstName input text field I have seems to be fairly easy to process back into my database as the ouput I get is fairly simple. I'm having trouble with the Membership field which involves checkboxes. Each checkbox that gets submitted to my request page is already in an array, but I can't seem to work out which value belongs to which member. I was thinking of grouping the values together, so i'll have an array called Membership and in each key I will have another array of values passed on from my form. Hope that makes sense. Its so I can later work out Steve has membership only to apple. I've out put under the code the output I am getting. Thanks to all that respond <li><input type="text" id="FirstName_<?php echo $portal ?>" name="FirstName[]" /></li> <li><?php foreach(fmsValueListItems($OO_Secure,'Web_Tickets','Dietary Requirements',"") as $list_item_key=>$list_item) { if($list_item == "") { echo "<input id=\"Membership{$list_item_key}\" name=\"Membership{$list_item_key}[]\" type=\"checkbox\" value=\"{$list_item}\" checked=\"checked\">{$list_item}\n"; } else { echo "<input id=\"Membership{$list_item_key}\" name=\"Membership{$list_item_key}[]\" type=\"checkbox\" value=\"{$list_item}\">{$list_item}\n"; } } ?> </li> output using the [] in the name field Array ( [FirstName] => Array ( [0] => Steve [1] => Bill [2] => Edward ) [Membership2] => Array ( [0] => Microsoft ) [Membership3] => Array ( [0] => Apple ) [Membership4] => Array ( [0] => Oracle ) [Membership5] => Array ( [0] => Google ) )
  10. Blimey - That works! So its because I had seperate bits of php code that was causing teh error.......dont understand it???? Thank you all very much for taking the time out helping me to identify the problem - this is a great community, would never of sussed it as I've got lots of pages with seperate bits of code like that all on one page. Now I need to move that test code onto the server and into my real php pages Cheers J
  11. This is my entire php file which I am using to test this feature. It may look a little strange, as it is connecting to a FileMaker database, but the connection etc all work; Just cant get the image to display <?php ini_set("display_errors", "1");error_reporting(E_ALL); require_once('Connections/dbConnect.php'); ?> <?php $MyDetails_find = $OO_Secure->newFindCommand('Members'); $MyDetails_find->AddFindCriterion('MemberID',$_SESSION['memberid']); $MyDetails_result = $MyDetails_find->execute(); if(FileMaker::isError($MyDetails_result)) fmsTrapError($MyDetails_result,"error.php"); $MyDetails_row = current($MyDetails_result->getRecords()); // FMStudio v1.0 - do not remove comment, needed for DreamWeaver support ?> <?php $filePath = $MyDetails_row->getField('ImageURL'); //$filePath = 'ajktest.png'; header('Content-type: image/png'); header('Content-length:' . filesize($filePath)); echo file_get_contents($filePath); ?>
  12. Hi PFMaBiSmAd, The magic_quotes_runtime setting is switched to off. Copied the exact image into my webfolder and changed the filepath so it is 'ajkimage.png'. With the headers commented out, I get the gibberish, with them included in the code I get a red cross. This is in I.E 8. FireFox says the image in http://localhost/folder/testdisplayimage.php cannot be displayed as it contains errors. I get the same results when I try a change the filePath to the image that is outside the webroot.
  13. Hi again, Yes, its ultimately out of the webfolder due to security. I'll have to check the permissions of the folder and make sure IIS users have read permissions. Do you think they will need something else? Jalz
  14. ok here goes, this is from the jpeg version as the png dont even display this but works ok when the png is in the webroot folder I'll only attach a page worth of garbage as im sure you dont want all of it? Thanks all again ÿØÿàJFIFHHÿá®ExifMM*bj(1r2Ž‡i¤Ð ü€' ü€'Adobe Photoshop CS3 Windows2010:04:23 13:02:43 Ö &(.xHHÿØÿàJFIFHHÿíAdobe_CMÿîAdobed€ÿÛ„ ÿÀ+ "ÿÝ ÿÄ? 3!1AQa"q2‘¡±B#$RÁb34r‚ÑC%’Sðáñcs5¢²ƒ&D“TdE£t6ÒUâeò³„ÃÓuãóF'”¤…´•ÄÔäô¥µÅÕåõVfv†–¦¶ÆÖæö7GWgw‡—§·Ç×ç÷5!1AQaq"2‘¡±B#ÁRÑð3$bár‚’CScs4ñ%¢²ƒ&5ÂÒD“T£dEU6teâò³„ÃÓuãóF”¤…´•ÄÔäô¥µÅÕåõVfv†–¦¶ÆÖæö'7GWgw‡—§·ÇÿÚ?ÊoÕÞ°^­ €a¶>¦Œ±ß÷ÔFýZêÏqÚÊìv€·{xìàáù‹ªÆÇ7[E,k=[ cÙ$†ºÝ³ýJÖƒúF]uÙcv1¬a/s¶8éîq~áÿ~U‘Ô«pðÇBǺ¦=˜½Vú.o§m>×°þk‡æ¨0°·Ê~Œr~—µo}yé·¬fÌf¶×åc×{«dHÚÏJÛ!¤·gè4ãe.÷·ná-âîæv»û*hë|òù›aÍk¤KgXCÄnëعÁ¢u]ùüûSŒ†8¶±¡$4Èît•§Ð1.¯¨YŒôZí¯sijw¨k¨¿¥g»Õúýž¢= ¢.A>WIÍ¡þ¥”œÌbgsZCˆ˜-{gô^àªUÐ_‹Mw]‹Huµmõvmmý)eo}5»ôŸ¾»ŒÌ^›õzÜ‹Y™Ó ½”Uê6ÆÝc†Ìv6¼íù>Ýk¶Yú/ç=K=J×-Òq²nÇ·2îcì™ ª_sXÆï¯~ö;Òö;zhâÔŽŒ²kt~µ}Y£§ôÜ{1jÍõé±µ]n[Úí­õ¿#~8cŸüÆÍ–¬—Cœ×I‡Äêþêéþ¿dõ,z0:xõëé×T.smq±Û›S+ÈŸµµú5ÛUO}žû=[žû–Õ¾œü̯LZ1i6mȽà¸5°Øk)öî³wç»ù´<6VH:}'.ì‹šç;qnÖ´a­ãvÈ>ýîÜ»«®¹õúnªÂÚÛ\櫓¯e>›¿GOÐwæ³þ s¹?Qs°rVæêA—:ç ÖRïgÚéì¦ßOÕoæzÕÚ·c)¿Qr¬i»Ê1M-¶ßlÛ¸ þϵﻦÌûgØš`dA®‹âc›ÐÚùÇTeæåg‡ÐËžcCZ>—æ1›}Ÿ˜ÅRª®tÖÀ_k†Ö°N³ôyZtl¼‚Â×c¸9ÛM6XXö’}1»c}»Ÿüß»ÓWú%UfŠ3hs¡®9°÷?éz›v4ú;w{íÛìÿH¤7ÃñK³[¦õ“m®Ãsê£vŒ-iœË\í¯þ¯Ó]Fú›Óº¯KÕmyŽ’ÖÏL8ôÝTz›?—½7X¥9”1•Zþ“cñn·WcÖ—^ױͯ{vnº¬Š?Gú;>¥×HÌÍ ;Ë趻1ÃXÞXE·U½ÛÚëjvËm¯ù»í¥$Øg5oœöàe6’ïUÍÕ䈇ìh?ÊoÒZØfü7Ó_¨ëðì–šß´¸¬©çý£õ| ™.êö¸9ÙÕ´µÌØ7oôÚ^_ù¿¢]WHÃÊéÞ¥MÈÙM¦ÊØç—ÔøüëÙº¼zgþÿ]@Fš¤@îM:lµ´Øñé87G¸ßú …®h‰]ÚÛ»Ûô”¨‘[}¤5¡®[mÔB#m€;¾–âHŸÞŸA2ÓOÿÐØeùms 9>¬$6Æ‚þÅ»OM•·é½¿A[}dvy²%ÓUm–þ{}˜¬ÿ³›XµÇÖ$¹Î/¬ŠÉçÝîm›ìPê é9î©âÛN-¢‘¡#ÙgcÝùߺ©‰ 4~QR§ƒÅÏÊëŸY}{2/Úí}ï 6ºkþlƒký*kck¯ü%«wë¯ÕþƒÓ:^5˜[}ksÈ%ÌÉe–Q“鵕ÑO¿ô‹àíX_TrÛÒ:î.sîkqÜÈsÃE­q{-¨Ã·Væî]?׎°léýùÍê7é•}•–Vêz2ú›üåÖ} œ®šÿOüã÷­ ©¯Â8ŽöñظؖÛ.$À&8;{(.‹ê†ÙýG3 ‡Vës±_fÌ’çT÷±Í5`õ=Žµïÿ·-ŠýŽÆk´5ퟎÕÐýWêé6ÝKÞÛ|6½©çOå¹·)Æ›07úÎAÉè2¼†MÌ·'}–<Ûpu"¼m¾óo§S,²ÖUé»Ñ³Óõë­?Õ|ºè§©â\FìÜ>Ïke¶ëcÿ™u>æ:ê]gÑú~‡¥þYu=3êýùY~f}™§dÒw;ôcô;%´Wÿj>õú7þ’Ï´.[Ö¿ §i>>”ÿ'`NœDNŸbé|Ö÷]S¡çt,7de:«q0™KâÐíïs^û}ORÇUëc?ÞÇú4ƒ¦°zhÆ¢¬<zìn-98ïê^ö nÛU[7V÷Ué×ûÿáU~§˜ü®Ôí,-f54`V]ùÏ~U™×Ÿëm¶¯ü…ͪý3©çÙÑ™ŒÇX[X, ÁsNæ>\ãí©þsr¦xŒ²\¸¢$îþ®2¯ù̸èKmuüßJ=Y®Äk®±·qM&’ÆäTMôîyýb·í¿Ù²¿F¶,«ðÀé½ËÆÚn~ÛŒO¥Hõ[‹¾ÂßS"Æú[ýŸ£V3l£/¥¬7}ŸpƳkE[žo©›?šôØÊýûóââú÷[~G]fV)sqñHƱÚFÇ}¢ë=¿ðÎÛ¿þ Xå ȸŒ@óFzÒ©U}/>ú1rÅÃÀ)̭›¶ÆYì67ôW}6ÿ!G*є̧½Óu¦ŒË(pÜk†O®Æ·gÒ±¯üÿJßÌY)×u<çîõ.ºÍÍ:û·ä¹jýVêdWWX`n'¼7!íÒšßéZvû÷WßÑ]`:­‰pÈ6èýuêÂìŒ,jìµØ­uÙÙÜðëZÚ»iÛ^=3»fïðŠ?Púë:U½A¶:¶å =Lg[%¶;}˜²Ò×z—ûEŸñý"—SÅè½S¥Y×qÞê›[N5,x.psØÖdjïO'7w­³êõ¾•É2 Æš÷5´™²}ÆaÛ!21¯¾ôfeÃ~’c®IO^·+$âT]}zÁÆ7h]ú-ÁþŸé½7ú›Wm_YÆÃúµC¬u‡?©°‡ÜÿI£ôÖ×ù¿fôÜÖÓÿu~§é½Eä¸6º»Zö»c†¡Üí#ÜÉÚ½OêwÖŸÔÔlÈÄ;±ë'9¢ÏÔqÚÊÙŠïðûÏ«{?Â]“ÿm¾…“KŒ¿Wu2?dxxZ8Zo¥ÖWuM±€–µÀíx`ÓgzìýÏrßÇÉ£.¦ÝAý –¾FÒ#Ô­áÏsWžg[XËcªo§KÈ5Ö$íiu—Šÿ;vÏjé¾­fX×e³kì§ÑìgÒ/ÏMü÷ÜÏ Ïß­E–È ¥Øæx¨›·ÿÑØkØZI2ÐÇö=«ë?YôÁéØÎsr/¥¿hy ºÜL1Ýeíoç5Jé³Öª=O?¥ÿGwæþæÕÀ}cùÇ—¢)‰™þn¿æ÷{½?몘¸x½TÝËÅÁé߯“Ÿ^U½®pmåÇÙ¸†Ã™ïÚÍ›~“W_õÛ;£õ~™W£NV=ØC6€ú©·óžü{–Ïìz«’oÐtÄzµý/£ßùˆ÷úë­Åßÿ2}³?µ³ÕÙ¶vûþË¿ó¶Iõ¿Gý#Ðý2´xzUÓZH$D‘Ät~‘ÿóëců§]FÀßpk‡ýxÜKs«h.f¶°Ï-×Ýë±TgôÖñ_xQÿÍþvÏÜܬëédÿžcŽó‰ñ»ÑÕ«©÷ô±Ÿ½ØXÕ²»És½l—{ÓÛôÿà™éªÝUø·u\öbí¶mk ck5ie©¿›^öûzcÒí>Œø~wç$ÍÞµñº=*ÿ›Û·ó¿{ß·ÿR¡;÷ •ñQ±ú;ÿÒ]¯ Ð|Ûþ“Ÿö«êmxÆçýÁŽºãé’é5ý?kX½‹êñé}êO~{Ûv[mȱÎüûŸúW·ÑöÖÖ3þ.•ãþ–ÉŽ*ø}ø/Rê_gÿ˜½#í_eÙö†ú´ýoKvË£Ñý›úoKý7ÚWô=_ø4ÃÃGÏZî¨ñq ߣ¡×Ós:ŸA»=ƒ#¦f2ꨂëm4ú7µŽôÿ@ÿÑW[ÿ?Õõ?›÷¯9êõbŽ¥—V){h§!ì«|µá­qcØæŸøFþzï¿ÆTþ×è_Ol»ˆô§ÔÇúŸêï¿ü"ó«çí?J~Ñw1»é÷þWúDÜ_Îún¸GøÜLÙ?™UÅÄtþ¯òÿ˜ÑÈsCÚóíôçÌ™.çúʹÌÂô›~A»ÿꞟ/éÙýFqÏÒ?IW?Ì~›¿êX§•Û]í:ìÛºx¹‘[ufËIÛ¸l¶¦5öƒ«Ô£nåÎdšVg¢©ÖX*:’æ¯Tj?£Ùüìog?Ìsoó_þ·ª/Ÿ±[áëwŽdÿ5ùßñ¿˜£¯Q6vÛôQ áÐúäoô¿ºªÜ [õ_¨ÙÑïǶêf.V-•¸VFíö»½¯-öúmbã‡þ¨ü‹¯³Šøüߣô~æßSÅ¥Ïêv=·áÖçmÄ<hHhK_5ÕýI³}¶z‡GQïùZÐ×7Ÿ¡½qcúf/<;Ž{.‹ê«¶Ý¾´úVDz{ãu_ÍïöìÿK»ßüâƒ?µ>š´¶H|ÁÿÙÿíÞPhotoshop 3.08BIM%8BIM/JÿÿHHÐ@dÀ°'llun×8BIMíHH8BIM&?€8BIM x8BIM8BIMó 8BIM 8BIM' 8BIMõH/fflff/ff¡™š2Z5-8BIMøpÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿèÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿèÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿèÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿè8BIM8BIM8BIM08BIM-8BIM@@8BIM8BIMI Ö Untitled-1Ö nullboundsObjcRct1Top longLeftlongBtomlong RghtlongÖslicesVlLsObjcslicesliceIDlonggroupIDlongoriginenumESliceOrigin autoGeneratedTypeenum ESliceTypeImg boundsObjcRct1Top longLeftlongBtomlong RghtlongÖurlTEXTnullTEXTMsgeTEXTaltTagTEXTcellTextIsHTMLboolcellTextTEXT horzAlignenumESliceHorzAligndefault vertAlignenumESliceVertAligndefaultbgColorTypeenumESliceBGColorTypeNone topOutsetlong leftOutsetlongbottomOutsetlongrightOutsetlong8BIM(?ð8BIM8BIM” +àP xÿØÿàJFIFHHÿíAdobe_CMÿîAdobed€ÿÛ„ ÿÀ+ "ÿÝ ÿÄ? 3!1AQa"q2‘¡±B#$RÁb34r‚ÑC%’Sðáñcs5¢²ƒ&D“TdE£t6ÒUâeò³„ÃÓuãóF'”¤…´•ÄÔäô¥µÅÕåõVfv†–¦¶ÆÖæö7GWgw‡—§·Ç×ç÷5!1AQaq"2‘¡±B#ÁRÑð3$bár‚’CScs4ñ%¢²ƒ&5ÂÒD“T£dEU6teâò³„ÃÓuãóF”¤…´•ÄÔäô¥µÅÕåõVfv†–¦¶ÆÖæö'7GWgw‡—§·ÇÿÚ?ÊoÕÞ°^­ €a¶>¦Œ±ß÷ÔFýZêÏqÚÊìv€·{xìàáù‹ªÆÇ7[E,k=[ cÙ$†ºÝ³ýJÖƒúF]uÙcv1¬a/s¶8éîq~áÿ~U‘Ô«pðÇBǺ¦=˜½Vú.o§m>×°þk‡æ¨0°·Ê~Œr~—µo}yé·¬fÌf¶×åc×{«dHÚÏJÛ!¤·gè4ãe.÷·ná-âîæv»û*hë|òù›aÍk¤KgXCÄnëعÁ¢u]ùüûSŒ†8¶±¡$4Èît•§Ð1.¯¨YŒôZí¯sijw¨k¨¿¥g»Õúýž¢= ¢.A>WIÍ¡þ¥”œÌbgsZCˆ˜-{gô^àªUÐ_‹Mw]‹Huµmõvmmý)eo}5»ôŸ¾»ŒÌ^›õzÜ‹Y™Ó ½”Uê6ÆÝc†Ìv6¼íù>Ýk¶Yú/ç=K=J×-Òq²nÇ·2îcì™ ª_sXÆï¯~ö;Òö;zhâÔŽŒ²kt~µ}Y£§ôÜ{1jÍõé±µ]n[Úí­õ¿#~8cŸüÆÍ–¬—Cœ×I‡Äêþêéþ¿dõ,z0:xõëé×T.smq±Û›S+ÈŸµµú5ÛUO}žû=[žû–Õ¾œü̯LZ1i6mȽà¸5°Øk)öî³wç»ù´<6VH:}'.ì‹šç;qnÖ´a­ãvÈ>ýîÜ»«®¹õúnªÂÚÛ\櫓¯e>›¿GOÐwæ³þ s¹?Qs°rVæêA—:ç ÖRïgÚéì¦ßOÕoæzÕÚ·c)¿Qr¬i»Ê1M-¶ßlÛ¸ þϵﻦÌûgØš`dA®‹âc›ÐÚùÇTeæåg‡ÐËžcCZ>—æ1›}Ÿ˜ÅRª®tÖÀ_k†Ö°N³ôyZtl¼‚Â×c¸9ÛM6XXö’}1»c}»Ÿüß»ÓWú%UfŠ3hs¡®9°÷?éz›v4ú;w{íÛìÿH¤7ÃñK³[¦õ“m®Ãsê£vŒ-iœË\í¯þ¯Ó]Fú›Óº¯KÕmyŽ’ÖÏL8ôÝTz›?—½7X¥9”1•Zþ“cñn·WcÖ—^ױͯ{vnº¬Š?Gú;>¥×HÌÍ ;Ë趻1ÃXÞXE·U½ÛÚëjvËm¯ù»í¥$Øg5oœöàe6’ïUÍÕ䈇ìh?ÊoÒZØfü7Ó_¨ëðì–šß´¸¬©çý£õ| ™.êö¸9ÙÕ´µÌØ7oôÚ^_ù¿¢]WHÃÊéÞ¥MÈÙM¦ÊØç—ÔøüëÙº¼zgþÿ]@Fš¤@îM:lµ´Øñé87G¸ßú …®h‰]ÚÛ»Ûô”¨‘[}¤5¡®[mÔB#m€;¾–âHŸÞŸA2ÓOÿÐØeùms 9>¬$6Æ‚þÅ»OM•·é½¿A[}dvy²%ÓUm–þ{}˜¬ÿ³›XµÇÖ$¹Î/¬ŠÉçÝîm›ìPê é9î©âÛN-¢‘¡#ÙgcÝùߺ©‰ 4~QR§ƒÅÏÊëŸY}{2/Úí}ï 6ºkþlƒký*kck¯ü%«wë¯ÕþƒÓ:^5˜[}ksÈ%ÌÉe–Q“鵕ÑO¿ô‹àíX_TrÛÒ:î.sîkqÜÈsÃE­q{-¨Ã·Væî]?׎°léýùÍê7é•}•–Vêz2ú›üåÖ} œ®šÿOüã÷­ ©¯Â8ŽöñظؖÛ.$À&8;{(.‹ê†ÙýG3 ‡Vës±_fÌ’çT÷±Í5`õ=Žµïÿ·-ŠýŽÆk´5ퟎÕÐýWêé6ÝKÞÛ|6½©çOå¹·)Æ›07úÎAÉè2¼†MÌ·'}–<Ûpu"¼m¾óo§S,²ÖUé»Ñ³Óõë­?Õ|ºè§©â\FìÜ>Ïke¶ëcÿ™u>æ:ê]gÑú~‡¥þYu=3êýùY~f}™§dÒw;ôcô;%´Wÿj>õú7þ’Ï´.[Ö¿ §i>>”ÿ'`NœDNŸbé|Ö÷]S¡çt,7de:«q0™KâÐíïs^û}ORÇUëc?ÞÇú4ƒ¦°zhÆ¢¬<zìn-98ïê^ö nÛU[7V÷Ué×ûÿáU~§˜ü®Ôí,-f54`V]ùÏ~U™×Ÿëm¶¯ü…ͪý3©çÙÑ™ŒÇX[X, ÁsNæ>\ãí©þsr¦xŒ²\¸¢$îþ®2¯ù̸èKmuüßJ=Y®Äk®±·qM&’ÆäTMôîyýb·í¿Ù²¿F¶,«ðÀé½ËÆÚn~ÛŒO¥Hõ[‹¾ÂßS"Æú[ýŸ£V3l£/¥¬7}ŸpƳkE[žo©›?šôØÊýûóââú÷[~G]fV)sqñHƱÚFÇ}¢ë=¿ðÎÛ¿þ Xå ȸŒ@óFzÒ©U}/>ú1rÅÃÀ)̭›¶ÆYì67ôW}6ÿ!G*є̧½Óu¦ŒË(pÜk†O®Æ·gÒ±¯üÿJßÌY)×u<çîõ.ºÍÍ:û·ä¹jýVêdWWX`n'¼7!íÒšßéZvû÷WßÑ]`:­‰pÈ6èýuêÂìŒ,jìµØ­uÙÙÜðëZÚ»iÛ^=3»fïðŠ?Púë:U½A¶:¶å =Lg[%¶;}˜²Ò×z—ûEŸñý"—SÅè½S¥Y×qÞê›[N5,x.psØÖdjïO'7w­³êõ¾•É2 Æš÷5´™²}ÆaÛ!21¯¾ôfeÃ~’c®IO^·+$âT]}zÁÆ7h]ú-ÁþŸé½7ú›Wm_YÆÃúµC¬u‡?©°‡ÜÿI£ôÖ×ù¿fôÜÖÓÿu~§é½Eä¸6º»Zö»c†¡Üí#ÜÉÚ½OêwÖŸÔÔlÈÄ;±ë'9¢ÏÔqÚÊÙŠïðûÏ«{?Â]“ÿm¾…“KŒ¿Wu2?dxxZ8Zo¥ÖWuM±€–µÀíx`ÓgzìýÏrßÇÉ£.¦ÝAý –¾FÒ#Ô­áÏsWžg[XËcªo§KÈ5Ö$íiu—Šÿ;vÏjé¾­fX×e³kì§ÑìgÒ/ÏMü÷ÜÏ Ïß­E–È ¥Øæx¨›·ÿÑØkØZI2ÐÇö=«ë?YôÁéØÎsr/¥¿hy
  15. Hi litebearer, Your code works ok, when the image is in the same folder as the script. Jalz
  16. Hello again, I'm back and i've decided to change the imagetype to jpg for testing purposes to see if it behaves differerently. my new code is now $filePath = $MyDetails_row->getField('ImageURL'); header('Content-type: image/jpg'); header('Content-length:' . filesize($filePath)); echo file_get_contents($filePath); I've also turned errors on the page like PFMaBiSmAd suggested. In I.E 8 I do get garbarge like what you showed but no image. In FireFox I just get http://localhost/foldername/testdisplayimage.php displayed in my browser. When you did your test, were your images outside the webroot folder? Thanks Jalz
  17. Hi Guys, This is what the output is saying.... <HTML><HEAD> <META content="text/html; charset=windows-1252" http-equiv=Content-Type></HEAD> <BODY><IMG src="http://localhost/the_folder/testdisplayimage.php"></BODY></HTML> I'll put the errors messages on and test with some other images; got to head out for a meeting now thank you so much for your helps guys - hoping to suss this out later.....
  18. ignore what i just said - headers were still commented out.....let me try again Mmm.... viewing source only has the following ‰PNG
  19. Yes if I comment out the headers, it does have gibberish...
  20. Thanks de.monkeyz, should have looked harder at the headers- had a feeling it was there. OK, got rid of the garbage but now I get the infamous red cross (which you get on sites with images missing). again checked filePath to make sure it has "c:\myImages\myimagename.png" in it, which it does. Any else Im doing which I shouldn't be? J
  21. Hi Guys, Thanks for this, sorry the echo $filePath; was there as a mistake, just making sure it had the correct path. Tried both of the code options and both interestingly give me the same 'garbage' briefly looking at it. I definately have png file stored in that location as I thought it was the header details. Any other ideas? This is what I have tried so far Many Thanks $filePath = $MyDetails_row->getField('ImageURL'); header('Content-type: image/png'); header('Content-length' . filesize($filePath)); echo stream_get_contents(fopen($filePath, "r")); or $filePath = $MyDetails_row->getField('ImageURL'); header('Content-type: image/png'); header('Content-length' . filesize($filePath)); echo file_get_contents($filePath);
  22. Hi all, Just wanted to know if you can point us in the right direction. I have created a folder on the c drive outside my wwwroot folder called myImages and am trying to output the data on my webpage. The ImageURL field contains the pathname, so it would contain "c:\myImages\nameofimage.png" I have the following code, and the webpage is just showing garbage, any ideas what I am doing wrong? Many Thanks all J <?php $filePath = $MyDetails_row->getField('ImageURL'); echo $filePath; header('Content-type: image/png'); header('Content-length' . filesize($filePath)); readfile($filePath); ?>
  23. OK, Just realised if I open my browser and point to the relevant location to the uploaded file, the image does display OK in the browser. If that is the case I think I may be worrying about something I dont need to worry about. Ill see if the database can acces sthe files uploaded and if they can then I'm back in business. Thanks Jalz
  24. Hello all, I have a weird problem. I have the following code which processes the uploaded file into the relevant location. <?php $blacklist = array(".txt",".php", ".phtml"); foreach ($blacklist as $item) { if(preg_match("/$item\$/i", $_FILES['userfile']['name'])) { echo "We do not allow uploading PHP files\n"; exit; } } $uploaddir = 'Images/'; $uploadfile = $uploaddir . basename($_FILES['userfile']['name']); if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) { echo "File is valid, and was successfully uploaded.\n"; } else { echo "File uploading failed.\n"; } ?> I know the script is far from secure, but Im working through an example which will eventually add hashing to filename and do a more thorough check on the filetypes allowed etc. My question is, this script at present obtains the file I have selected and places it in the images folder. However when I navigate to that folder and double click on the file I've uploaded, the dialog prompt opens up and says "program name" can't open this picture because you dont have permission to access the file location - or a pdf would say error opening document - Access denied. When I manually copy a file or image to the same location using the Windows environment, it seems to work fine? Anyone shed some light on this please? Thanks Jalz
×
×
  • 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.