You are here: Re: Link parameter problem « PHP Programming Language « IT news, forums, messages
Re: Link parameter problem

Posted by Lennart Anderson on 03/21/07 19:13

"Rami Elomaa" <rami.elomaa@gmail.com> skrev i meddelandet
news:etrvf5$fjk$1@nyytiset.pp.htv.fi...
> Lennart Anderson kirjoitti:
>> I want to present a table with main data. Each revord will have a field
>> acting like a link to a new page with detailed data on the selected
>> record. My problem is that I can't get the record-ID parsed into the link
>> parameter. Whatever I do will just let my $_GET['id'] give me what is
>> after the equal-sign in the link prameter.
>> The code is:
>> while($row = mysql_fetch_object($result))
>> {
>> $mid = ($row->catid);
>> $name = ($row->catname);
>> echo '<tr>';
>> echo '<td >' . $mid . '</td>';
>> echo '<td>' . '<a href="advertinfo.php?id=$mid">' . $name . '</a></td>';
>> echo '</tr>';
>> }
>> echo '</table>';
>>
>> In this case the $_GET on advertinfor.php will only give me $mid.
>> I think the problem might be in the quotes but I also think I have tested
>> every possible combinaion without success.
>> Any solution or hint is very much appreciated.
>
> The difference between ' and " is that php variables inside "" are parsed
> but inside '' they are not. So "$foo" will be parsed as $foo the variable,
> but '$foo' is seen as a literal string, a dollar sign followed by the
> string foo.
>
> --
> Rami.Elomaa@gmail.com
> "Olemme apinoiden planeetalla."

Rami
Thank you
I thought I knew that but obviously I did a mistake. In such a link there
are a lot of " and ' together with .-dots. I thought I have tried all
combinations but ....
OK, you learn by mistakes, don't you. I am still a newbie.
Well, now I have got the solution to that problem but I am very convinced
that I will meet new problems and then it is very good to have found this
group.

 

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

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