Forums / Templates, Stylesheets, Page Layout / Blank Page :O Please HELP

Blank Page :O Please HELP

Locked

Started by beautyhealth_com_cy on 1 Nov 2010, 4:23 PM · Views: 1,174

Results 1 to 16 of 16
This thread is locked. New replies are disabled.
1 Nov 2010, 4:23 PM
#1
beautyhealth_com_cy avatar

beautyhealth_com_cy

New Zenner

Join Date:
Nov 2009
Posts:
34
Plugin Contributions:
0

Blank Page :O Please HELP

I have created the following PHP file in order to get some information, after i extract this info i will make some more modifications in order to have the following data in a marquee on my homepage .

When i call the PHP file i get only a blank page....

Can you please help?????:shocking:

<?php

 require('includes/application_top.php');

 
    global $db;
      $gal_sql = "SELECT T0.products_id, T1.products_name, T0.products_model, T0.products_image, T0.products_price
FROM zc_products T0 inner join zc_products_description T1 on T0.products_id = T1.products_id
WHERE T0.products_model NOT LIKE  '#%' ";

   
      
    
	 $gal_sql_result = @mysql_query ($gal_sql) or die (mysql_error()); 
	
	  
	 
while ($row = mysql_fetch__array($gal_sql_result)) {
	  $gal_prod_id = $row['T0.products_id'];
      $gal_prod_name = $row['T1.products_name'];
      $gal_prod_model = $row['T0.products_model'];
      $gal_prod_img = $row['T0.products_image'];
      $gal_prod_prc = $row['T0.products_price'];
	  
	  echo "<TR><TD>$gal_prod_id</TD><TD>$gal_prod_name</TD><TD>$gal_prod_model</tr><tr><td>$gal_prod_img</td></tr><tr><td> $gal_prod_prc</td></tr>";
}   
 
?>
3 Nov 2010, 8:08 AM
#2
beautyhealth_com_cy avatar

beautyhealth_com_cy

New Zenner

Join Date:
Nov 2009
Posts:
34
Plugin Contributions:
0

Re: Blank Page :O Please HELP

I have created the following PHP file in order to get some information, after i extract this info i will make some more modifications in order to have the following data in a marquee on my homepage .

When i call the PHP file i get only a blank page....

Can you please help?????:shocking:

<?php

 require('includes/application_top.php');

 

 global $db;
	
      $gal_sql = mysql_query("SELECT T0.products_id, T1.products_name, T0.products_model, T0.products_image, T0.products_price
FROM zc_products T0 inner join zc_products_description T1 on T0.products_id = T1.products_id
WHERE T0.products_model NOT LIKE  '#%' ") or sqlerr(__FILE__, __LINE__);

 $gal_sql_result = mysql_fetch_assoc($gal_sql) or die("No Products");
     while ($gal_sql_result = mysql_fetch_array($gal_sql)) {
	  $gal_prod_id = $gal_sql_result[T0.products_id];
      $gal_prod_name = $gal_sql_result[T1.products_name];
      $gal_prod_model = $gal_sql_result[T0.products_model];
      $gal_prod_img = $gal_sql_result[T0.products_image];
      $gal_prod_prc = $gal_sql_result[T0.products_price];
	  
	  echo "<TR><TD>$gal_prod_id</TD><TD>$gal_prod_name</TD><TD>$gal_prod_model</tr><tr><td>$gal_prod_img</td></tr><tr><td> $gal_prod_prc</td></tr>";

	  }

?>
<tr>
<td align='center'><?=$gal_prod_id;?><?=$gal_prod_name;?></td>
</tr>
3 Nov 2010, 8:08 AM
#3
beautyhealth_com_cy avatar

beautyhealth_com_cy

New Zenner

Join Date:
Nov 2009
Posts:
34
Plugin Contributions:
0

Re: Blank Page :O Please HELP

i have changed it to this but still nothing....

<?php 

 require('includes/application_top.php'); 

  

 global $db; 
     
      $gal_sql = mysql_query("SELECT T0.products_id, T1.products_name, T0.products_model, T0.products_image, T0.products_price 
FROM zc_products T0 inner join zc_products_description T1 on T0.products_id = T1.products_id 
WHERE T0.products_model NOT LIKE  '#%' ") or sqlerr(__FILE__, __LINE__); 

 $gal_sql_result = mysql_fetch_assoc($gal_sql) or die("No Products"); 
     while ($gal_sql_result = mysql_fetch_array($gal_sql)) { 
      $gal_prod_id = $gal_sql_result[T0.products_id]; 
      $gal_prod_name = $gal_sql_result[T1.products_name]; 
      $gal_prod_model = $gal_sql_result[T0.products_model]; 
      $gal_prod_img = $gal_sql_result[T0.products_image]; 
      $gal_prod_prc = $gal_sql_result[T0.products_price]; 
       
      echo "<TR><TD>$gal_prod_id</TD><TD>$gal_prod_name</TD><TD>$gal_prod_model</tr><tr><td>$gal_prod_img</td></tr><tr><td> $gal_prod_prc</td></tr>"; 

      } 

?> 
<tr> 
<td align='center'><?=$gal_prod_id;?><?=$gal_prod_name;?></td> 
</tr>
3 Nov 2010, 8:14 AM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: Blank Page :O Please HELP

There's a Tutorial/FAQ on finding the causes of blank pages, which can be found by searching the Tutorials section for "blank page" ... pretty neat, huh? https://www.zen-cart.com/tutorials/index.php?article=82

Your use of short-open-tags is probably a contributor to the problem.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

3 Nov 2010, 8:17 AM
#5
beautyhealth_com_cy avatar

beautyhealth_com_cy

New Zenner

Join Date:
Nov 2009
Posts:
34
Plugin Contributions:
0

Re: Blank Page :O Please HELP

DrByte:

Your use of short-open-tags is probably a contributor to the problem.

What is short-open-tags ???

3 Nov 2010, 8:22 AM
#6
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: Blank Page :O Please HELP

Googling "short open tags php" brings up this link as the first result, which answers that question: http://php.net/manual/en/ini.core.php#ini.short-open-tag

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

3 Nov 2010, 8:27 AM
#7
beautyhealth_com_cy avatar

beautyhealth_com_cy

New Zenner

Join Date:
Nov 2009
Posts:
34
Plugin Contributions:
0

Re: Blank Page :O Please HELP

i do not understand why using <?php and ?> might cause any problems.... is there any other way that i should do it ?

3 Nov 2010, 8:37 AM
#8
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: Blank Page :O Please HELP

If your server is configured to NOT allow short_open_tags then if you DO use them, as your code above does, then you'll be causing PHP errors, which could be the cause of the blank pages you're complaining about.

What are the myDebug-xxxx.log files telling you?

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

3 Nov 2010, 8:41 AM
#9
beautyhealth_com_cy avatar

beautyhealth_com_cy

New Zenner

Join Date:
Nov 2009
Posts:
34
Plugin Contributions:
0

Re: Blank Page :O Please HELP

as i see almost all zencart files begin with <?php

i did try that but no file such as myDebug-xxxx.log was created.... there is only .htaccess and index.php there....

3 Nov 2010, 8:45 AM
#10
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: Blank Page :O Please HELP

Perhaps you'll need to enable your own error logging within your custom code to find out what's causing the failure.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

3 Nov 2010, 8:46 AM
#11
beautyhealth_com_cy avatar

beautyhealth_com_cy

New Zenner

Join Date:
Nov 2009
Posts:
34
Plugin Contributions:
0

Re: Blank Page :O Please HELP

how do i do that ? please help me some more :)

3 Nov 2010, 8:54 AM
#12
beautyhealth_com_cy avatar

beautyhealth_com_cy

New Zenner

Join Date:
Nov 2009
Posts:
34
Plugin Contributions:
0

Re: Blank Page :O Please HELP

please see my query and tell me if something is wrong with it...

or if i did not include some require(xxxx.php) file in order to connect with my database.

btw the php file i created is in my root folder

3 Nov 2010, 8:59 AM
#13
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: Blank Page :O Please HELP

What is "or sqlerr(FILE, LINE)" intended to do?
Is sqlerr() a valid function in PHP?

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

3 Nov 2010, 9:11 AM
#14
beautyhealth_com_cy avatar

beautyhealth_com_cy

New Zenner

Join Date:
Nov 2009
Posts:
34
Plugin Contributions:
0

Re: Blank Page :O Please HELP

yes it is... it tracks any errors and return it to me...

3 Nov 2010, 9:20 AM
#15
beautyhealth_com_cy avatar

beautyhealth_com_cy

New Zenner

Join Date:
Nov 2009
Posts:
34
Plugin Contributions:
0

Re: Blank Page :O Please HELP

i have removed that piece of code but still nothing... still blank...

3 Nov 2010, 10:26 AM
#16
beautyhealth_com_cy avatar

beautyhealth_com_cy

New Zenner

Join Date:
Nov 2009
Posts:
34
Plugin Contributions:
0

Re: Blank Page :O Please HELP

i have made some debugging.... the problem is in this part i think :

 while ($gal_sql_result = mysql_fetch_array($gal_sql)) { 
      $gal_prod_id = $gal_sql_result[T0.products_id]; 
      $gal_prod_name = $gal_sql_result[T1.products_name]; 
      $gal_prod_model = $gal_sql_result[T0.products_model]; 
      $gal_prod_img = $gal_sql_result[T0.products_image]; 
      $gal_prod_prc = $gal_sql_result[T0.products_price]; 
       
      echo "<TR><TD>$gal_prod_id</TD><TD>$gal_prod_name</TD><TD>$gal_prod_model</tr><tr><td>$gal_prod_img</td></tr><tr><td> $gal_prod_prc</td></tr>"; 

      } 

This does not return anything so i guess that my vars may not populate correct.

i have defined another var and populate it manually and it shows ok.

$hi='hello';

<td align='center'><?=$hi?></td>

and i get the hello only....

So any ideas why my other vars may not get populated ????