Jump to content

Search the Community

Showing results for tags 'webservice'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to ProcessWire
    • News & Announcements
    • Showcase
    • Wishlist & Roadmap
  • Community Support
    • Getting Started
    • Tutorials
    • FAQs
    • General Support
    • API & Templates
    • Modules/Plugins
    • Themes and Profiles
    • Multi-Language Support
    • Security
    • Jobs
  • Off Topic
    • Pub
    • Dev Talk

Product Groups

  • Form Builder
  • ProFields
  • ProCache
  • ProMailer
  • Login Register Pro
  • ProDrafts
  • ListerPro
  • ProDevTools
  • Likes
  • Custom Development

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests

Found 2 results

  1. I'm building a custom web service to service a mobile app from a PW site. I'm very exited to extend the site's functionality with PW's flexibility. I would like to check if what I'm doing is 'safe' and I'm not overexposing the site to vulnerabilities. 1. The site should serve a json file when accessing a specific URL. I like to keep my site's URLs with a /json to keep everything mirrored in my template files. products.php ?php /** * Productos template * */ if ($page->name == 'productos' AND $input->urlSegment(1) == 'json' ) { include("./productos.json.php"); die(); } if ($page->name == 'categorias' AND $input->urlSegment(1) == 'json' ) { include("./categorias.json.php"); die(); } include("./head.inc"); ?> // ... GOES ON 2. The template in charge of generating the JSON output. Loosely based in Ryan's web service plugin. Is there something dangerous in here? products.json.php <?php /** * Productos JSON * */ // $_GET Variables from URL $types = array( 'limit' => $input->get->limit, 'sort' => $input->get->sort ); $params = array(); foreach($types as $name => $type) { $value = $input->get->$name; if($value === null) continue; // not specified, skip over if(is_string($type)) $params[$name] = $sanitizer->text($value); // sanitize as string else $params[$name] = (int) $value; // sanitizer as int } // Set defaults if(empty($params['sort'])) $params['sort'] = '-modified'; // set a default if(empty($params['limit'])) $params['limit'] = 10; // set a default $params['template'] = 'producto'; // Build query string to search $new_query_string = http_build_query($params, '', ','); // Find $q = $pages->find($new_query_string); // Results $result = array( 'selector' => $new_query_string, 'total' => $q->count(), 'limit' => (int)$params['limit'], 'start' => 0, 'matches' => array() ); $categorias = $pages->get("/categorias/"); $soluciones = $pages->get("/soluciones/"); foreach ($q as $i) { // ... // PREPARING some variables // ... $result[matches][] = array( 'id' => $i->id, 'template' => $i->template->name, 'name' => $i->name, 'created' => $i->created, 'modified' => $i->modified, 'url' => $i->url, 'producto_thumb' => $product_thumb, 'producto_imagen' => $product_images, 'producto_packaging'=> $product_pack, 'producto_ficha' => $product_sheet, 'title' => $i->title, 'producto_bajada' => $i->producto_bajada, 'body' => $i->body, 'categorias' => $product_categories, 'soluciones' => $product_solutions, 'calc' => $i->calc, 'rendimiento_min' => $i->rendimiento_min, 'rendimiento_max' => $i->rendimiento_max ); } // JSON header('Content-Type: application/json'); echo(json_encode($result)); 3. Finally, this seems to be working ok, but I was wondering: a. How can I check for products modified since date X? b. How can I notify the web service that a product has been deleted since date X? PW moves files to the trash and I would like to keep it that way but I can't imagine how to notify the webservice!
  2. Just some strange thing i've tested with PW. I've some experience with PW now, but one thing i found i don't have a clue where i've to search why....and i always wanna know WHY something happens... You all know online responsive website test services....like: http://ami.responsivedesign.is http://mattkersley.com/ http://responsivedesignchecker.com/ and so on.... but if i'm checking one of my websites build with PW there is gives me a blank screen...no screenshot there...so i have a closer look. first i switched browser...check - same result in ervery browser second i looked at other PW sites like http://processwire.com itself.....check no working too! third i picked some websites from the repository that build with pw.....check no working too! some examplelinks: http://responsivedesignchecker.com/processwire.com http://quirktools.com/screenfly/#u=http%3A//processwire.com&w=1024&h=600 http://responsivetest.net/#u=http://processwire.com|1024|768|1 http://responsivetest.net/#u=http://gs-altfraunhofen.de|1024|768|1 ....and so on So why is a PW website not working in any of such online testing tools? .htaccess? strange regards mr-fan
×
×
  • Create New...