PHP ini_set(path) problem.

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
pavanpuligandla
Forum Contributor
Posts: 130
Joined: Thu Feb 07, 2008 8:25 am
Location: Hyderabad, India

PHP ini_set(path) problem.

Post 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.
Last edited by pavanpuligandla on Sat May 30, 2009 1:14 am, edited 1 time in total.
User avatar
pavanpuligandla
Forum Contributor
Posts: 130
Joined: Thu Feb 07, 2008 8:25 am
Location: Hyderabad, India

Re: PHP ini_set(path) problem

Post 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");
User avatar
mikemike
Forum Contributor
Posts: 355
Joined: Sun May 24, 2009 5:37 pm
Location: Chester, UK

Re: PHP ini_set(path) problem.

Post 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");
User avatar
mikemike
Forum Contributor
Posts: 355
Joined: Sun May 24, 2009 5:37 pm
Location: Chester, UK

Re: PHP ini_set(path) problem.

Post 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\\');
User avatar
pavanpuligandla
Forum Contributor
Posts: 130
Joined: Thu Feb 07, 2008 8:25 am
Location: Hyderabad, India

Re: PHP ini_set(path) problem.

Post 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:
User avatar
mikemike
Forum Contributor
Posts: 355
Joined: Sun May 24, 2009 5:37 pm
Location: Chester, UK

Re: PHP ini_set(path) problem.

Post by mikemike »

Have you got error reporting on?
User avatar
pavanpuligandla
Forum Contributor
Posts: 130
Joined: Thu Feb 07, 2008 8:25 am
Location: Hyderabad, India

Re: PHP ini_set(path) problem.

Post by pavanpuligandla »

Have you got error reporting on?
Yes.
User avatar
mikemike
Forum Contributor
Posts: 355
Joined: Sun May 24, 2009 5:37 pm
Location: Chester, UK

Re: PHP ini_set(path) problem.

Post by mikemike »

And the source is empty? Very strange...
User avatar
pavanpuligandla
Forum Contributor
Posts: 130
Joined: Thu Feb 07, 2008 8:25 am
Location: Hyderabad, India

Re: PHP ini_set(path) problem.

Post 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..
User avatar
mikemike
Forum Contributor
Posts: 355
Joined: Sun May 24, 2009 5:37 pm
Location: Chester, UK

Re: PHP ini_set(path) problem.

Post 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.
User avatar
pavanpuligandla
Forum Contributor
Posts: 130
Joined: Thu Feb 07, 2008 8:25 am
Location: Hyderabad, India

Re: PHP ini_set(path) problem.

Post 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..
User avatar
mikemike
Forum Contributor
Posts: 355
Joined: Sun May 24, 2009 5:37 pm
Location: Chester, UK

Re: PHP ini_set(path) problem.

Post by mikemike »

I actually wrote something about that in my original post then deleted it!! Haha, oh well, glad it's all sorted :D
Post Reply