Jump to content

Destramic

Members
  • Posts

    969
  • Joined

  • Last visited

Everything posted by Destramic

  1. you've been a great help...thanks guys just one more thing though when people describe thier url as /module/controller/action isn't it actually controller/action...i dont understand what the module is...if you could help to explain please thanks again
  2. Thanks alot for your help...also is the controller and action loaded in the dispatch class?...thanks again
  3. hey guys im making my own framework after messing about with a few and just wanted to ask what the dispatchers duties are altogther? 1. break down ulr to generate module/controller/action/parameters 2. load module? and 3. send module/controller/action/parameters to request class if someone could help me out with this question it would be great....thanks
  4. thats great thanks a lot
  5. i just want t find out what classes have been declared on a page
  6. is there a way of calling this function but just returning the classes you've loaded and not already built in classes with php please? Array ( [0] => stdClass [1] => Exception [2] => ErrorException [3] => COMPersistHelper [4] => com_exception [5] => com_safearray_proxy [6] => variant [7] => com [8] => dotnet [9] => DateTime [10] => DateTimeZone [11] => ReflectionException [12] => Reflection [13] => ReflectionFunctionAbstract [14] => ReflectionFunction [15] => ReflectionParameter [16] => ReflectionMethod [17] => ReflectionClass [18] => ReflectionObject [19] => ReflectionProperty [20] => ReflectionExtension [21] => LibXMLError [22] => __PHP_Incomplete_Class [23] => php_user_filter [24] => Directory [25] => SimpleXMLElement [26] => DOMException [27] => DOMStringList [28] => DOMNameList [29] => DOMImplementationList [30] => DOMImplementationSource [31] => DOMImplementation [32] => DOMNode [33] => DOMNameSpaceNode [34] => DOMDocumentFragment [35] => DOMDocument [36] => DOMNodeList [37] => DOMNamedNodeMap [38] => DOMCharacterData [39] => DOMAttr [40] => DOMElement [41] => DOMText [42] => DOMComment [43] => DOMTypeinfo [44] => DOMUserDataHandler [45] => DOMDomError [46] => DOMErrorHandler [47] => DOMLocator [48] => DOMConfiguration [49] => DOMCdataSection [50] => DOMDocumentType [51] => DOMNotation [52] => DOMEntity [53] => DOMEntityReference [54] => DOMProcessingInstruction [55] => DOMStringExtend [56] => DOMXPath [57] => RecursiveIteratorIterator [58] => IteratorIterator [59] => FilterIterator [60] => RecursiveFilterIterator [61] => ParentIterator [62] => LimitIterator [63] => CachingIterator [64] => RecursiveCachingIterator [65] => NoRewindIterator [66] => AppendIterator [67] => InfiniteIterator [68] => RegexIterator [69] => RecursiveRegexIterator [70] => EmptyIterator [71] => ArrayObject [72] => ArrayIterator [73] => RecursiveArrayIterator [74] => SplFileInfo [75] => DirectoryIterator [76] => RecursiveDirectoryIterator [77] => SplFileObject [78] => SplTempFileObject [79] => SimpleXMLIterator [80] => LogicException [81] => BadFunctionCallException [82] => BadMethodCallException [83] => DomainException [84] => InvalidArgumentException [85] => LengthException [86] => OutOfRangeException [87] => RuntimeException [88] => OutOfBoundsException [89] => OverflowException [90] => RangeException [91] => UnderflowException [92] => UnexpectedValueException [93] => SplObjectStorage [94] => XMLReader [95] => XMLWriter [96] => Autoloader )[code]
  7. thats where my Autoloader_Exception class is gonna come in...but if that doesn't load (if file doesn't exsits) then i want the handler to be Exception... is there a way of getting this to work? catch (self::$_exception_handler $e) { } thank you
  8. hey guys i have a static attribute $_exception_handler which is set to Exception and....now this value could change to a customer exception_handler but what i want to do is <?php catch (self::$_exception_handler $e) { } but im getting an error...is there a way of doing this...any help would be greatful thanks class below <?php class Autoloader { protected static $_exception_handler = Exception; protected static $_classes = array(); public static function load_library($class_name) { $file = ROOT . DS. LIBRARY_DIRECTORY . DS . $class_name . CLASS_EXTENSION; try { self::load_class($class_name, $file); } catch (self::$_exception_handler $e) { echo $e->getMessage(); } } public static function load_exception($class_name) { } public static function load_class($class_name, $file) { if (!class_exists($class_name, FALSE)) { if (file_exists($file)) { require_once $file; } else { throw new Exception(sprintf('Class %s not found.', $class_name)); } } } }
  9. hey guys im trying to rewrite a url...for instance when a user enters http://localhost/news/search?var=val i want to redirect to http://localhost/news/search/var/val here's the code i have below but its not working RewriteCond %{QUERY_STRING} ([^=]+)=([^&]*) RewriteRule ^news/search news/search/$1/%2 [R=301] .htaccess file <Files .htaccess> order allow,deny deny from all </Files> RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php?url=$1 [PT,L] RewriteCond %{QUERY_STRING} ([^=]+)=([^&]*) RewriteRule ^news/search news/search/$1/$2 [R=301] if anyone could help me i'd be greatful...thanks
  10. can anyone help me please?
  11. im getting an error... Fatal error: Class 'Autoloader' not found in C:\www\public\index.php on line 8 do i need to include the class aswell?
  12. Im trying to load my classes though my autoloader load method but im having a problem with registering the class (spl_autoload_register) if anyone could tell me why? error: index.php spl_autoload_extensions('.class.php'); spl_autoload_register(array('Autoloader', 'load')); autoloader.class.php <?php class Autoloader_Exception extends Exception {} class Autoloader { public function load() { } } thanks
  13. could get it to work sorry url news/search?field=value to news/search/field/value here is my .htaccess which might help... <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php?url=$1 [PT,L] RewriteCond %{QUERY_STRING} ([^=]+)=([^&]*) RewriteRule ^news/search news/search/$1/%2 [R=301] </IfModule> <Files .htaccess> order allow,deny deny from all </Files> sorry to be a pain
  14. as ive read on here is my attemp but its not working RewriteRule ^news/search/$/$ news/search/?$1=$2 [R] news/search/?fieldname=value to news/search/fieldname/value hope you can help
  15. Thank you for your reply...i tried it with mod rewrite but could get it to redirect to the url I want...could you help on how I could do this?...thanks again for your help
  16. well mod_rewrite wont work for what i want...basically when a user submits a form the url will action to news/search/?seach=whatever then i want to re route it by regex then redirect the page to change the url...i dont think i can do that with mod_rewrite making it show the new url and thank you the regex works great thank you...although i changed it slightly and can't get the first $1 to work if you could kindly help again please...than you <?php $pattern = "~news/search/?(.*)+=(.*)~"; $result = "news/search/$1/$2"; $url = "/news/search/?query=test123"; if (preg_match($pattern, $url, $matches)) { print_r($matches); echo preg_replace($pattern, $result, $url); } else { echo "no"; } ?>
  17. After a read mod_rewrite isn't what I need...can anyone help with the regular expression as i'm still having trouble getting it to work...thanks you
  18. Well I thought this would be the right way around things...its for my framework i'm making...but how would I do I mod_rewrite?...and would it be the right way to do things?
  19. im having a bit of trouble with an expression to reroute my url for instance i want to change my url: news/search/?seach=value and changed to news/search/value here is what i have but its not the correct expression if anyone can help please $routing = array('/news\/search\?(.*?)=(.*?)/' => 'news/search/\2'); thank you [/code]
  20. Thanks for your posts And dan I think full text search is what I need but how do I reach the columns that are not full text?
  21. ok somehing like this to reroute the url? $routing = array('/news\search\/?search=\/(.*?)/' => 'news/search/\1');
  22. erm ok so what would my news table query look like if i wanted to search the `news` columns for a word?
  23. hey guys basically i have a form which searches my news <form action="" method="GET"> <label for="search">Search: </label><input name="search" id="search" type="text" /> <input value="Search" type="submit" /> </form> and im not sure the best way around this or if im going around this the right way but when i access http://localhost/news/seach (search form) and press submit after entering a query i want the action to be http://localhost/news/seach/search query value here i hope ive explained well enough and someone could help me with this...thank you
  24. hey im trying to seach a table and all columns rows to match a query string...what is the best way to do this please? thanks
  25. im getting an error: Warning: mysql_fetch_array() [function.mysql-fetch-array]: The result type should be either MYSQL_NUM, MYSQL_ASSOC or MYSQL_BOTH. in C:\www\library\mysql.class.php on line 353 $result_type = "MYSQL_ASSOC"; $row = mysql_fetch_array($result, $result_type) but if i use (below) it works fine...is the constant() function the right way to what im doing? $result_type = "MYSQL_ASSOC"; $row = mysql_fetch_array($result, constant($result_type)) thank you
×
×
  • 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.