Page 1 of 1

include class problem

Posted: Tue Aug 17, 2010 11:33 am
by Ajvan
Hi everybody,
here is the problem:
i have php project with following directory structure:

projectRoot
|- js (dir) -> scripts.js
|- index.php
|- myClass.php
| - serverscript.php

I`m calling javascript function located in scripts.js from Index.php page.
This javascript function have Ajax call, calling serverscript.php:
$.ajax({
type: "POST",
url: "serverscript.php",
data: "variable=" + $someData,
success: function(resp){
if (resp == 'success')
{
alert('success');
}
else alert('error');
},
error: function(e){
alert('Error: ' + e);
}
});

now, serverscript.php instantiate object of the myClass.php. Before calling constructor, i have require_once("myClass.php"); at the beggining of the somescript.php.
When I`m using SRV, local webserver from PhpEd IDE, everything working fine. But, when i move project to Apache - wamp\www directory....Apache error log tells that myClass.php could not be found?!?! Same thing using xammp (Apache, so, same story). I didn`t change php.ini file so it`s not that. Anybody have any idea what`s going on?
thanks in advance

Re: include class problem

Posted: Tue Aug 17, 2010 11:59 am
by jimboidaho
Looks like jquery syntax. Does Scipts.js include jquery?

Re: include class problem

Posted: Tue Aug 17, 2010 12:08 pm
by Ajvan
Yep, scripts.js uses Ajax function from jquery-1.2.6.pack