Including non CodeIgniter scripts |
[eluser]PHP Creative[/eluser]
I am using a php/ajax star rating script. When I try to include it into a view using a php include it creates php conflicts with CodeIgniter. The script works perfectly outside CodeIgniter My question is there anyway to include other scripts without creating conflicts with CodeIgniter.
[eluser]jedd[/eluser]
Quote:My question is there anyway to include other scripts without creating conflicts with CodeIgniter. If I answered : yes ... would you find that irritating, or would the comfort of having an answer as vague as 'conflicts with CodeIgniter' offset that?
[eluser]Tom Schlick[/eluser]
we need alot more information. please post the script along with your code that you used to try to integrate it. you can't just say it doesn't work help me.
[eluser]PHP Creative[/eluser]
This is the code in question - http://msteigerwalt.com/widgets/ratings/v1.2/ Quote:A PHP Error was encountered Code: if ($_POST['vote'] && $_POST['id']) { The error comes from this section ratings.php (above). I am simply including demo.php into a view.
[eluser]Tom Schlick[/eluser]
try Code: $this->input->post('vote'); and where are you including the rabid ratings? if its a php class then make it a library and use the load library function
[eluser]PHP Creative[/eluser]
Thanks very much. Code: <?php require_once("ratings.php"); $rr = new RabidRatings(); ?> I dont think it can be a library because it is called in the javascript... Code: window.addEvent('domready', function(e) {
[eluser]garymardell[/eluser]
It may take abit of shuffling code around to make it work the ci way. Have whatever class there is as a library and anything being called by javascript as a controller.
[eluser]KieranA[/eluser]
Take into account that "if ($_POST['var'])" will return an Notice error, to fix that you can use the CodeIgniter post - However on the included script you could just change that statement to "if (isset($_POST['var']))" and no errors would occur, and it would allow you to post the value of 0 too.
[eluser]TheIgniter[/eluser]
Excuse me! I'm stuck, i create the rabid librarie but i dont know how call the rating librarie from the js : Code: window.addEvent('domready', function(e) { Please, could you guys help me. Fixed : I create a controller to load the librarie and editing the url in the js file to : Code: var rating = new RabidRatings({url:'http://localhost/project/index.php/yourcontroller/loadlib'}); |
Welcome Guest, Not a member yet? Register Sign In |