wee problem with validator

#1
[eluser]Bainzy[/eluser]
hi everyone,

im really stuck at the moment on how to do something.

what i have is a simple forum software, when a user is logged in and they are looking at a post the reply box comes up at the bottom of the forum for the user to quick reply. When you are on the forum view the url looks like this

http://localhost/forums/index.php/forum/comments/3/1

the 3 in the url is the topicID and the 1 in the url is the categoryID now the problem i am having is when the form is subbmited it goes to the following url :

http://localhost/forums/index.php/validator/

I want to be able to send the 3/1 part there aswel but if i adjust the url to look like :

http://localhost/forums/index.php/validator/3/1 the page does nothing it just loads a blank page and sits there. Now if i change it back to the orignal without the 3/1 in the url it works fine. I get redirected to index.php/forum/comments/ however i need the 3/1 in the url for the querys on the page to work otherwise its just showing the comments page with no data in it.

What am i doing wrong, i have included the url library in the validator class and in the forum class but still nothing.

What is the best way to go about doing this ?

any help would be greatly appreciated, i am so close to finishing this project and adding it to the wiki along with a tutorial on how to make a forum as i see this question asked alot around here.

Regards
Chris

#2
[eluser]JHackamack[/eluser]
The problem is the "validator" is your controller so adding "3" to the url assumes you want to call the "3" function inside the validator. If you tack on the actual validator function inside your controller it should work.

#3
[eluser]Bainzy[/eluser]
'm still learning the framework so I am a little unsure as to what you mean by tack it to the validator

#4
[eluser]JHackamack[/eluser]
Sorry,
Code:
index.php/validator/index/3/1
breaks down to
Code:
//Look at index.php
index.php

//Call the Validator Controller
validator

//Call the index function
index

//Pass Parameter Value 3 & 1
3/1

Since in your URL you're trying to call doesn't have a function it's assuming 3 is the function you are trying to call and it can't find it, so its failing.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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