• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Alternate URI syntax

#31
[eluser]RS71[/eluser]
Also,

What do should I do in regards to security (sql injections, etc)?

#32
[eluser]TheFuzzy0ne[/eluser]
This solution wasn't designed with arrays in mind, although there's nothing to stop you implementing it yourself. Commas aren't allowed in the URI by default, but you are free to add it to the list of allowed characters, and then you can just use explode() to turn it into an array. I'm quite sure that if you used periods instead of commas, and then exploded the data, you'd have your solution.

If you need to pass an array to the server, you might find that POST is more suitable.

As for SQL injection attacks - the default characters allowed in the URI are fairly secure, but it's up to you to ensure that data is escaped before putting it into the database.

All the best!

#33
[eluser]uptime[/eluser]
[quote author="m4rw3r" date="1235262278"]btw, use preg instead of ereg, preg is faster.[/quote]

I believe ereg is going to be gone soon (from PHP) too so that's another reason.

#34
[eluser]Unknown[/eluser]
Hello,

I am attempting to get this library working.

I have the class autoloaded and my url has the proper format
/search/query:asdf/type:poetry/media:book


however when i try to $test = $this->my_uri->asegment('query');
i get false returned.

when i try $this->uri->asegment('query'); it doesn't work at all, i get
Call to undefined method CI_URI::assoc_to_alt_uri()

As far as I can tell the asegments var isn't being populated with any values.
The _reindex_segments() doesn't even seem to run.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.