Page 1 of 1

PHP ini_set(path) problem.

Posted: Fri May 29, 2009 10:52 pm
by pavanpuligandla
Hii,
I'm using XAJAX Grid which is an editable grid, my source code is entirely correct and on index page, i cannot see any data bounded to the grid, IE is showing a syntax error, anyone who knows abt AJAX, please help me out..

here is my index.php code

Code: Select all

<?PHP
    session_start();
    // If you have  the PEAR PHP package, you can comment the next line.
    ini_set('include_path',dirname($_SERVER["SCRIPT_FILENAME"])."/include");
    //echo dirname($_SERVER["SCRIPT_FILENAME"])."/include";
    //exit();
    require_once ('common.php');
 
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/2000/REC-xhtml1-20000126/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>GRID VIEW</title>
    <link rel="stylesheet" href="css/style.css" type="text/css" />
 <?php $xajax->printJavascript("include/")?>
    </head>
<body>
    <br>
    <center>
    <table width="90%" border="0" style="background: #F9F9F9; padding: 0px;">
        <tr>
            <td style="padding: 0px;">
                <fieldset>
                <div id="formDiv" class="formDiv"></div>
                <div id="grid" align="center"> </div>
               <script type="text/javascript">
                  xajax_showGrid(0,<?=ROWSXPAGE?>,'','','lastname');
                </script>
                </fieldset>
            </td>
        </tr>
    </table>
    </center>
</body>
</html>
 
IE showing error at these lines of the code..
<script type="text/javascript">
xajax_showGrid(0,<?=ROWSXPAGE?>,'','','lastname');
</script>
Many Thanks.

Re: PHP ini_set(path) problem

Posted: Sat May 30, 2009 1:13 am
by pavanpuligandla
Hello all,
There is a problem with my PATH settings it seems,
my original path to PEAR is : D:\wamp\www\grid_component\include\

how to set the path using ini_set?
ini_set('include_path',dirname($_SERVER["SCRIPT_FILENAME"])."/include");

Re: PHP ini_set(path) problem.

Posted: Sat May 30, 2009 1:22 am
by mikemike
Your using forward slashes, it should be backward slashes on Windows.

Try this:

Code: Select all

ini_set('include_path', dirname($_SERVER["SCRIPT_FILENAME"])."\\include");

Re: PHP ini_set(path) problem.

Posted: Sat May 30, 2009 1:25 am
by mikemike
And if that doesn't work, echo it out and try hardcoding it in:

Code: Select all

ini_set('include_path', 'D:\\wamp\\www\\grid_component\\include\\');

Re: PHP ini_set(path) problem.

Posted: Sat May 30, 2009 1:30 am
by pavanpuligandla
Hello,
Both didnt worked.. :banghead:
Any Solutions?
wheni echoed the directory it is showing me the actaul path only,
but i cannot see any thing on my index.php page.. :cry:

Re: PHP ini_set(path) problem.

Posted: Sat May 30, 2009 1:33 am
by mikemike
Have you got error reporting on?

Re: PHP ini_set(path) problem.

Posted: Sat May 30, 2009 1:41 am
by pavanpuligandla
Have you got error reporting on?
Yes.

Re: PHP ini_set(path) problem.

Posted: Sat May 30, 2009 1:43 am
by mikemike
And the source is empty? Very strange...

Re: PHP ini_set(path) problem.

Posted: Sat May 30, 2009 1:48 am
by pavanpuligandla
And the source is empty? Very strange...
Actually it is XAjax Grid script.

I think the only problem is with PEAR package PATH only..
Script is fine i guess..

Re: PHP ini_set(path) problem.

Posted: Sat May 30, 2009 1:54 am
by mikemike
Oh so the page itself generates output?

So long as the path you gave me is definitely your PEAR path I don't see a problem. Maybe do some deeper debugging? I don't really know what to suggest without having the ability to play about myself.

Re: PHP ini_set(path) problem.

Posted: Sat May 30, 2009 2:02 am
by pavanpuligandla
So long as the path you gave me is definitely your PEAR path I don't see a problem. Maybe do some deeper debugging? I don't really know what to suggest without having the ability to play about myself.
Hey thanks alot, after debugging the code, i've gone a bit closer and identified the problem
My IE is showing a syntax error near this line,

Code: Select all

<script type="text/javascript">
                  xajax_showGrid(0,<?=ROWSXPAGE?>,'','','lastname');
                </script>
then i thought of using PHP short open tags.. <? ?> means <?PHP echo ?>
so i just modified my php.ini, by setting short_open_tags=on;
Hurray..

Re: PHP ini_set(path) problem.

Posted: Sat May 30, 2009 2:38 am
by mikemike
I actually wrote something about that in my original post then deleted it!! Haha, oh well, glad it's all sorted :D