Page 1 of 1

Passing some variables with a link...

Posted: Mon Apr 19, 2004 5:33 am
by EvilRadish
I am trying to pass some variable with a link... it works fine but when i add more variables the ouput will stop to show all the results of the database. 8O

Code: Select all

<?php

print ("<tr><td align=center><a href="alter1.php?identif=$id&nome1=$nome1&nome2=$nome2&nome3=$nome3&nome4
=$nome4&nome5=$nome5&nome6=$nome6&nome7=$nome7&nome8
=$nome8&nome9=$nome9&nome10=$nome10&nome11=$nome11&
nome12=$nome12&nome13=$nome13&nome14=$nome14&nome15=
$nome15&nome16=$nome16&nome17=$nome17&nome18=$nome18
&nome19=$nome19&nome20=$nome20&nome21=$nome21&nome22
=$nome22&nome23=$nome23&nome25=$nome25&nome26=$nome
26">$nome4</a></td><td>$nome3</td></tr>");


?>
is there a character limit with the link function?

or another way to do it?
:?:

thanks![/php_man]

Let me post the complete code

Posted: Mon Apr 19, 2004 5:47 am
by EvilRadish
This is the code what will pass all the variable data to a new page to be edited.

Code: Select all

<?php
<?php
$ligação=mysql_connect("localhost", "root", "");
if (!$ligação) {
      print ("MySqL server Connection problems");
}
$sql="select * from InfoTotal";
$resultado = mysql_db_query ("GeneralInfo", $sql);
if ($resultado) {
print ("<table width="90%" align=center border=2>");
print ("<tr><td width="40%" align=center bgcolor="FFFF00
">CLIENT</td><td width="40%" align=center bgcolor="FFFF00
">COMPANY</td></tr>");
while ($registo=mysql_fetch_array($resultado)) {

$id=$registo["id"];
$nome1=$registo["APN"];
	$nome2=$registo["Proc"];
	$nome3=$registo["Company"];
	$nome4=$registo["Client"];
	$nome5=$registo["Marriedto"];
	$nome6=$registo["BirthClient"];
	$nome7=$registo["BirthSpouce"];
	$nome8=$registo["Cont1"];
	$nome9=$registo["Cont2"];
	$nome10=$registo["Plot"];
	$nome11=$registo["Zone"];
	$nome12=$registo["NomeCasa1"];
	$nome13=$registo["Morada1"];
	$nome14=$registo["Cidade1"];
	$nome15=$registo["CodPostal1"];
	$nome16=$registo["Pais1"];
	$nome17=$registo["Tel1"];
	$nome18=$registo["Fax1"];
	$nome19=$registo["Mobile1"];
	$nome20=$registo["email1"];
	$nome21=$registo["NomeCasa2"];
	$nome22=$registo["Morada2"];
	$nome23=$registo["Cidade2"];
	$nome24=$registo["Cidade1"];
	$nome25=$registo["CodPostal2"];
	$nome26=$registo["Pais2"];
	$nome27=$registo["Tel2"];
	$nome28=$registo["Fax2"];
	$nome29=$registo["Mobile2"];
	$nome30=$registo["email2"];
	$nome31=$registo["SoldBought"];
	$nome32=$registo["ManagCo"];
	$nome33=$registo["Morada"];
	$nome34=$registo["Pais"];
	$nome35=$registo["TelOff"];
	$nome36=$registo["FaxOff"];
	$nome37=$registo["ManagementPortugal"];
	$nome38=$registo["MoradaVillaMan"];
	$nome39=$registo["CodPostVillaMan"];
	$nome40=$registo["TelefVillaMan"];
	$nome41=$registo["FaxVillaMan"];
	$nome42=$registo["Sede"];
	$nome43=$registo["PoAvaliduntil"];
	$nome44=$registo["Powers"];
	$nome45=$registo["IRC2002"];
	$nome46=$registo["Contabilista"];
	$nome47=$registo["DescPred"];
	$nome48=$registo["ARTLOTE"];
	$nome49=$registo["VPATRIMLOTE"];
	$nome50=$registo["AREA"];
	$nome51=$registo["LICHAB"];
	$nome52=$registo["ARTCASA"];
	$nome53=$registo["VPATRIMCASA"];
	$nome54=$registo["NIPC"];
	$nome55=$registo["AFPOP"];
	$nome56=$registo["Comments"];
	$nome57=$registo["HouseIns"];
	$nome58=$registo["CarIns"];
	$nome59=$registo["Date"];
	$nome60=$registo["Description"];
	$nome61=$registo["credit"];
	$nome62=$registo["debit"];
	$nome63=$registo["balance"];
print ("<tr><td align=center><a href="alter1.php?identif=$id&nome1=$nome1&nome2=$nome2&nome3=$nome3&nome4=$
nome4&nome5=$nome5&nome6=$nome6&nome7=$nome7&nome8=$no
me8&nome9=$nome9&nome10=$nome10&nome11=$nome11&nome12=$
nome12&nome13=$nome13&nome14=$nome14&nome15=$nome15&nom
e16=$nome16&nome17=$nome17&nome18=$nome18&nome19
=$nome19&nome20=$nome20&nome21=$nome21&nome22
=$nome22&nome23=$nome23&nome25=$nome25&nome26
=$nome26&nome27=$nome27&nome28=$nome28&nome29
=$nome29&nome30=$nome30&nome31=$nome31&nome32
=$nome32&nome33=$nome33&nome34=$nome34&nome35
=$nome35&nome36=$nome36&nome37=$nome37&nome38
=$nome38&nome39=$nome39&nome40=$nome40&nome41
=$nome41&nome42=$nome42&nome43=$nome43&nome44
=$nome44&nome45=$nome45&nome46=$nome46&nome47
=$nome47&nome48=$nome48&nome49=$nome49&nome50
=$nome50&nome51=$nome51&nome52=$nome52&nome53
=$nome53&nome54=$nome54&nome55=$nome55">$nome4</a></td><td>$nome3</td></tr>");

}
echo ("</table>");
}else{
print ("no record found");
}
mysql_free_result ($resultado);
include ('menu2.inc');
?>
?>

Posted: Mon Apr 19, 2004 8:06 am
by feyd
there is a nominal character limit for a url/uri of 255 characters last I saw it. I'd advise setting all those into a cookie or similar..

How can i do it?

Posted: Mon Apr 19, 2004 8:15 am
by EvilRadish
Hi!

how can use a cookie to do it? 8O ?

Thanks.

Posted: Mon Apr 19, 2004 8:21 am
by feyd
$_COOKIE['name'] = blahblahblah;

Browsers aren't required to store more than something around 4k of data in cookies though, and someone could have cookies off.

Posted: Mon Apr 19, 2004 8:23 am
by JayBird
why do you need to pass soooooooo much information using a link?

Why not just pass an id, then use that id to grab the information you want on the next page!?

Seems to me, you need to re-think your code design!

Page

well the answer is...

Posted: Mon Apr 19, 2004 9:14 am
by EvilRadish
well the reason is very simple,

i am just know starting to leran php and it´s obvious that iam lost in the middle of the forest. :?

i am going to try the cookie thing.

btw, how can i use and id to pass the info to the next page?

thanks a lot. :wink:

finaly it´s working

Posted: Mon Apr 19, 2004 9:51 am
by EvilRadish
Well after strugling a while with the code, i have discover that the problem was the browser (explorer). i works just fine with Mozila or Opera.

i have made some changes to the code and it´s ok now.

:D

thanks anyway guys! :wink:

Posted: Mon Apr 19, 2004 2:38 pm
by vigge89
try using sessions instead...
[php_man]session[/php_man]