You are here: Re: Sent data truncated? « PHP Programming Language « IT news, forums, messages
Re: Sent data truncated?

Posted by Geoff Muldoon on 03/07/06 08:23

no.mail@st.peters says...

> I can't send data over to another page, if the data has spaces in-between,
> eg.
>
> $row[0] = "Garden Party by the Sea" and i use the following code:
>
> <a href=deleterecord.php?id=$row[0]&tablename=$tablename>$row[0]</a>";
>
> then what is sent over is
> $row[0]="Garden
> and $tablename is not sent over at all.
>
> How can i send over the complete $row[0] plus another variable to the next
> page?

This is not a PHP thing, it's a HTML thing. HTML property references (like
href and value) which are not enclosed in double quotes will break at the
first whitespace.

Try using escaped quotes (/"):
$link="<a href=/"deleterecord.php?id=$row[0]&tablename=$tablename/">$row
[0]</a>";

or I prefer to use single-quotes and concatenators for PHP and double-
quotes only for the HTML bits:

$link='<a href="deleterecord.php?id='.$row[0].'&tablename='.
$tablename.'">'.$row[0].'</a>';

Although the fact that you have such text in an "id" field indicates poor
design.

Geoff M

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация