Jump to content

Assign large data to Varialble


mrbad

Recommended Posts

Hello,

 

Here is the data file (30% data only) - hope it helps ::)

 

<?
$products1="<div style='width:890px; float:left;'><div class='procoltitle1'>Products</div><div class='procoltitle2'>Standard</div><div class='procoltitle1'>Package</div><div class='procoltitle2'>CAS No.</div><div class='procolodd1'>Acyclovir</div><div class='procolodd2'>E.P/B.P/USP</div><div class='procolodd1'>25/50 HDPE Drums</div><div class='procolodd2'>59277-89-3</div><div class='procoleven1'>Artesunate</div><div class='procoleven2'>I.H.S.</div><div class='procoleven1'>1/5/25/50/100 KG.</div><div class='procoleven2'>88495-63-0</div><div class='procolodd1'>Artemether</div><div class='procolodd2'>I.H.S.</div><div class='procolodd1'>1/5/25/50/100 KG.</div><div class='procolodd2'>72963-77-4</div><div class='procoleven1'>Sodium Stearyl Fumarate</div><div class='procoleven2'>U.S.P.</div><div class='procoleven1'>5/10/25/50 KG HDPE Drums</div><div class='procoleven2'>4070-80-8</div><div class='procolodd1'>Alpha-Beta Arteether</div><div class='procolodd2'>I.H.S.</div><div class='procolodd1'>1/5/25/50/100 KG.</div><div class='procolodd2'>75887-54-6</div><div class='procoleven1'>Amoxicillin Tri Hydrate</div><div class='procoleven2'>B.P./I.P.</div><div class='procoleven1'>25/50 KG HDPE Drums</div><div class='procoleven2'>26787-78-0</div></div>";
?>

 

Thanks,

Vikram

Hello,

 

Here is the data file (30% data only) - hope it helps ::)

 

<?
$products1="<div style='width:890px; float:left;'><div class='procoltitle1'>Products</div><div class='procoltitle2'>Standard</div><div class='procoltitle1'>Package</div><div class='procoltitle2'>CAS No.</div><div class='procolodd1'>Acyclovir</div><div class='procolodd2'>E.P/B.P/USP</div><div class='procolodd1'>25/50 HDPE Drums</div><div class='procolodd2'>59277-89-3</div><div class='procoleven1'>Artesunate</div><div class='procoleven2'>I.H.S.</div><div class='procoleven1'>1/5/25/50/100 KG.</div><div class='procoleven2'>88495-63-0</div><div class='procolodd1'>Artemether</div><div class='procolodd2'>I.H.S.</div><div class='procolodd1'>1/5/25/50/100 KG.</div><div class='procolodd2'>72963-77-4</div><div class='procoleven1'>Sodium Stearyl Fumarate</div><div class='procoleven2'>U.S.P.</div><div class='procoleven1'>5/10/25/50 KG HDPE Drums</div><div class='procoleven2'>4070-80-8</div><div class='procolodd1'>Alpha-Beta Arteether</div><div class='procolodd2'>I.H.S.</div><div class='procolodd1'>1/5/25/50/100 KG.</div><div class='procolodd2'>75887-54-6</div><div class='procoleven1'>Amoxicillin Tri Hydrate</div><div class='procoleven2'>B.P./I.P.</div><div class='procoleven1'>25/50 KG HDPE Drums</div><div class='procoleven2'>26787-78-0</div></div>";
?>

 

Thanks,

Vikram

 

dude

try this

<?php
echo $products1= "    <div style=\'width:890px; float:left;\'><div class=\'procoltitle1\'>Products</div><div class=\'procoltitle2\'>Standard</div><div class=\'procoltitle1\'>Package</div><div class=\'procoltitle2\'>CAS No.</div><div class=\'procolodd1\'>Acyclovir</div><div class=\'procolodd2\'>E.P/B.P/USP</div><div class=\'procolodd1\'>25/50 HDPE Drums</div><div class=\'procolodd2\'>59277-89-3</div><div class=\'procoleven1\'>Artesunate</div><div class=\'procoleven2\'>I.H.S.</div><div class=\'procoleven1\'>1/5/25/50/100 KG.</div><div class=\'procoleven2\'>88495-63-0</div><div class=\'procolodd1\'>Artemether</div><div class=\'procolodd2\'>I.H.S.</div><div class=\'procolodd1\'>1/5/25/50/100 KG.</div><div class=\'procolodd2\'>72963-77-4</div><div class=\'procoleven1\'>Sodium Stearyl Fumarate</div><div class=\'procoleven2\'>U.S.P.</div><div class=\'procoleven1\'>5/10/25/50 KG HDPE Drums</div><div class=\'procoleven2\'>4070-80-8</div><div class=\'procolodd1\'>Alpha-Beta Arteether</div><div class=\'procolodd2\'>I.H.S.</div><div class=\'procolodd1\'>1/5/25/50/100 KG.</div><div class=\'procolodd2\'>75887-54-6</div><div class=\'procoleven1\'>Amoxicillin Tri Hydrate</div><div class=\'procoleven2\'>B.P./I.P.</div><div class=\'procoleven1\'>25/50 KG HDPE Drums</div><div class=\'procoleven2\'>26787-78-0</div></div>";
?>

[...] since variable has limitation of 157 characters only

 

well that would be the kind of limitation one could eventually encounter on Windows...

but never heard about something like that for PHP... sounds like nonsense

 

I am guessing there is something wrong with your code...

but you should post it so that we could have a look at it...

 

Hello,

 

Friends, thank you so much for your kind support. Here are the codes for php and have also attached text file - to have an idea of how large data is to be assigned to variable.

 

index.php

<?
$page="pharma";
require 'content/'.$page.'.php';
require "inc/functions.php";
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Parth : Translation</title>
<script type="text/javascript" src="js/jsapi"></script>
<link href="css/style.css" rel="stylesheet" type="text/css" />
</head>

<body>

<!-- LANGUAGE FLAG STARTS -->
<? echo languagemenu(); ?>
<!-- LANGUAGE FLAG ENDS-->

<br />
<h1>Parth</h1>

<!-- CONTENT AND TRANSLATION STARTS-->
<? 
		$txtid="1";
		$txt="$products1";
		echo content1($txtid, $txt);
?>
<!-- CONTENT AND TRANSLATION ENDS -->

</body>
</html>

 

function.php

//MAIN TRANSLATION 
function translate($txt, $txtid)
{
global $self;
$self=$_SERVER['PHP_SELF'];
global $lang;
global $txt;
global $page;

echo'
<!-- MESSAGE TRANSLATION STARTS-->
<script type="text/javascript">

    google.load("language", "1");

function toptext() {
      google.language.translate("'.$txt.'", "en", "'.$lang.'", 
  
  
  function(welcomemsg) {
        if (!welcomemsg.error) {
          var container = document.getElementById("'.$txtid.'");
          container.innerHTML = welcomemsg.translation;
        }
      });
    }
    google.setOnLoadCallback(toptext);

    </script>
<!--  MESSAGE TRANSLATION ENDS-->	 ';
}

//TRANSLATION 1
function content1($txtid, $txt)
{
		global $txtid;
		global $txt;
		echo' <div class="contentbox" id="'.$txtid.'">';
		echo translate($txt, $txtid); 
		echo '</div>';
}

 

Thanks,

Vikram

 

[attachment deleted by admin]

the length of the text should not be an issue...

try like this:

function content1($txtid, $txt)
{
global $txtid;
global $txt;

return '<div class="contentbox" id="'.$txtid.'">' . 
	translate($txt, $txtid) . 
	'</div>';
}

 

and

 

function translate($txt, $txtid)
{
// [...]

return '
<!-- MESSAGE TRANSLATION STARTS-->
<script type="text/javascript">
    google.load("language", "1");
function toptext() {
      google.language.translate("'.$txt.'", "en", "'.$lang.'", 

  function(welcomemsg) {
        if (!welcomemsg.error) {
          var container = document.getElementById("'.$txtid.'");
          container.innerHTML = welcomemsg.translation;
        }
      });
    }
    google.setOnLoadCallback(toptext);

    </script>
<!--  MESSAGE TRANSLATION ENDS--> ';
}

Hello,

 

I thing Google translation has no limitations. Have a look at :

http://yoursview.com/parth2/index3.php

 

This is done directly by jquery. But it is fine for 1 page website. When we have multiple pages, user will have to click every time on desired translation language.

 

Thanks,

Vikram

maybe a PHP timout then or something like that...

I can't see anything in your code that would cause this...

 

try to alter your PHP limits with

ini_set();

http://uk.php.net/manual/en/function.ini-set.php

 

or directly in your php.ini file (if you have access to it)

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.