Page 1 of 1

I have an error but I cant find it

Posted: Thu Jul 22, 2010 1:15 pm
by Dgriff
Hi
I'm new here and I hope I have this in the right forum. I have some php code that's giving me some trouble. THere is an error in it somewhere but I don't know where it is. When I plug it into my oscMax site I get a white screen. I had no problems with it when I plugged it into my standard oscommerce site but I added an opening and closing php tag when I put it into the oscmax site. This is the code. Can someone have a look at it? Is there a tools around that would highlight errors in the code?
Thanks

Code: Select all

<?php
define('PART_1', '<table width="650" cellspacing="1" cellpadding="1" border="0" align="center">
    <caption>
    <p><span style="color: rgb(128, 0, 0);"><span style="font-family: Arial Black;"><strong>Part 1: Test Videos<br />
    </strong></span></span></p>
    </caption>
    <tbody>
        <tr>
            <td valign="middle" align="center"><img height="25" width="11" border="0" align="middle" alt="" src="/store/catalog/userfiles/../images/green_block.jpg" /></td>
            <td> 1. Test Video number 1</td>
            <td> </td>
            <td valign="middle" align="center"> <a href="http://buildawebsite.ie/store/catalog/media/test/test.html" onclick="window.open(this.href,'','resizable=no,location=no,menubar=no,scrollbars=no,status=no,toolbar=no,fullscreen=yes,dependent=no,status'); return false"><img height="18" width="54" border="0" align="middle" src="/store/catalog/userfiles/../images/play_video.jpg" alt="" /></a></td>
            <td valign="middle" align="center"><img height="25" width="11" border="0" align="middle" alt="" src="/store/catalog/userfiles/../images/green_block.jpg" /></td>
        </tr>
        <tr>
            <td valign="middle" align="center"><img height="25" width="11" border="0" align="middle" alt="" src="/store/catalog/userfiles/../images/green_block.jpg" /></td>
            <td> 2. Test Video Number 2</td>
            <td> </td>
            <td valign="middle" align="center"> <a href="http://buildawebsite.ie/store/catalog/media/test1/test1.html" onclick="window.open(this.href,'','resizable=no,location=no,menubar=no,scrollbars=no,status=no,toolbar=no,fullscreen=no,dependent=no,status'); return false"><img height="18" width="54" border="0" align="middle" src="/store/catalog/userfiles/../images/play_video.jpg" alt="" /></a></td>
            <td valign="middle" align="center"><img height="25" width="11" border="0" align="middle" alt="" src="/store/catalog/userfiles/../images/green_block.jpg" /></td>
        </tr>');

define('PART_2', '        <tr>
            <td valign="middle" align="center"><img height="25" width="11" border="0" align="middle" src="/store/catalog/userfiles/../images/red_block.gif" alt="" /></td>
            <td> 3. Test Video Number 3</td>
            <td> </td>
            <td valign="middle" align="center"> <a href="http://buildawebsite.ie/store/catalog/media/test2/test2.html" onclick="window.open(this.href,'','resizable=yes,location=no,menubar=no,scrollbars=no,status=no,toolbar=no,fullscreen=yes,dependent=no,status'); return false"><img height="18" width="54" border="0" align="middle" src="/store/catalog/userfiles/../images/play_video_grey.gif" alt="" /></a></td>
            <td valign="middle" align="center"><img height="25" width="11" border="0" align="middle" src="/store/catalog/userfiles/../images/red_block.gif" alt="" /></td>
        </tr>
        <tr>
            <td valign="middle" align="center"><img height="25" width="11" border="0" align="middle" src="/store/catalog/userfiles/../images/red_block.gif" alt="" /></td>
            <td> 4. Test Video Number 4</td>
            <td> </td>
            <td valign="middle" align="center"> <a href="http://buildawebsite.ie/store/catalog/media/test4/test4.html" onclick="window.open(this.href,'','resizable=no,location=no,menubar=no,scrollbars=no,status=no,toolbar=no,fullscreen=no,dependent=no,status'); return false"><img height="18" width="54" border="0" align="middle" src="/store/catalog/userfiles/../images/play_video_grey.gif" alt="" /></a></td>
            <td valign="middle" align="center"><img height="25" width="11" border="0" align="middle" src="/store/catalog/userfiles/../images/red_block.gif" alt="" /></td>
        </tr>');

define('PART_3','    </tbody>
</table>');

if ( tep_session_is_registered('customer_id') ) 
  define('TEXT_MAIN', PART_1 . PART_2 . PART_3 );
else 
  define('TEXT_MAIN', PART_1 . PART_3 );
?> 

Re: I have an error but I cant find it

Posted: Thu Jul 22, 2010 1:22 pm
by Jade
You have to give us more information than that... like what error message are you getting?

Re: I have an error but I cant find it

Posted: Thu Jul 22, 2010 1:35 pm
by AbraCadaver
Jade wrote:You have to give us more information than that... like what error message are you getting?
Lot's of parse errors I would imagine :-) http://us3.php.net/manual/en/language.types.string.php

Then use an editor that does some syntax highlighting like kate on linux or maybe notepad++ or editplus on windows, or SciTE.

Re: I have an error but I cant find it

Posted: Thu Jul 22, 2010 3:26 pm
by Dgriff
Jade wrote:You have to give us more information than that... like what error message are you getting?
All I'm getting is a blank white page. No errors are showing up in cPanel>>Logs>>Error Log. I'm not sure how to create an error log to tell me where the error in the code is. Is there anything else I can do?

Re: I have an error but I cant find it

Posted: Thu Jul 22, 2010 3:47 pm
by AbraCadaver
Dgriff wrote:
Jade wrote:You have to give us more information than that... like what error message are you getting?
All I'm getting is a blank white page. No errors are showing up in cPanel>>Logs>>Error Log. I'm not sure how to create an error log to tell me where the error in the code is. Is there anything else I can do?
You can read the link I gave you, and you can put this at the top of the page:

Code: Select all

error_reporting(E_ALL);
ini_set('display_errors', '1');