nghi Posted February 25, 2016 Share Posted February 25, 2016 I'm getting this error below. I'm not sure what I'm doing wrong? (not sure if its overkill to include pw to the htaccess) Error Error: Call to undefined function wire() (line 5 of C:\wamp2\www\nghitest\parse.php) .htaccess RewriteRule ^([\w\d]{6})$ parse.php?parse=$1 [L] parse.php <?php require("./index.php"); $short_url = wire('sanitizer')->url($_GET["parse"]); $url = wire('database')->query("SELECT url FROM shorturl WHERE short_url='{$short_url}'")->fetch(); if ($url) header("location:" . $url); ?> Link to comment Share on other sites More sharing options...
flydev Posted February 25, 2016 Share Posted February 25, 2016 Hi, which version of ProcessWire are you using ? If you are under version 3.x.x, put this line at the begining of the file : <?php namespace ProcessWire; Link to comment Share on other sites More sharing options...
nghi Posted February 25, 2016 Author Share Posted February 25, 2016 Hi, which version of ProcessWire are you using ? If you are under version 3.x.x, put this line at the begining of the file : <?php namespace ProcessWire; I'm currently using the 3.0.8 dev ver. I'll add the namespace when I get home and see how that goes. *Update - Adding the namespace solve my problem thanks for the help. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now