[PHP] Links with parameters in DB
Hi!! I have links saved in the DB and some of them may have parameters. Those parameters may come from a php variable. The problem is that when I recover the link form the DB I get the link plus the name of the variable instead of its value. Here is an example: I have this in the DB: | Link | | orders.php?idorder=$idorder | And the code: (Suposed idorder=5) .. Connect to the DB .. $link=eval(mysql_result($result,$i,link)); . . and then i put this: a href=?=$link?Link to order/a But what i see the link i see this: orders.php?idorder=$idorder Instead of: orders.php?idorder=5 What am I doing wrong? I´m despearte, Help please Thanks in advance ;)
Re: [PHP] Links with parameters in DB
It doesn´t work, I have other fields in the DB apart from the field 'Link', so if I use $link = eval($result); I get a parse error. Apart from that, I have to write the name of the field (link), if not the server won´t know the field I´m refering to. Thanks - Original Message - From: Jay Blanchard [EMAIL PROTECTED] To: WebMaster. Radio ECCA [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, August 19, 2004 1:28 PM Subject: RE: [PHP] Links with parameters in DB [snip] $i=0; $q=select * from links'; while ($imysql_num_rows($result)) { $link=eval(mysql_result($result,$i,link)); . . and then i put this: [/snip] What happens if you do this? while($i mysql_num_rows($result)){ $link = eval($result); echo $link; }
Re: [PHP] Links with parameters in DB
I tried what you said but i get an eval error: Parse error: parse error, unexpected '=' in /index.php(135) : eval()'d code on line 1 ;( - Original Message - From: Jay Blanchard [EMAIL PROTECTED] To: WebMaster. Radio ECCA [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, August 19, 2004 1:38 PM Subject: RE: [PHP] Links with parameters in DB [snip] It doesn´t work, I have other fields in the DB apart from the field 'Link', so if I use $link = eval($result); I get a parse error. Apart from that, I have to write the name of the field (link), if not the server won´t know the field I´m refering to. [/snip] Then did you eval that? I meant for you to use a proper rendering of the eval statement by itself, i.e. $sql = SELECT * FROM table ; $result = mysql_query($sql, $connection); while($row = mysql_fetch_array($result)){ $link = eval($row['Link']); echo $link; } -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] CMS for a Intranet
Hi! I´m developing a new intranet for my company and I wonder if there is any CMS package that fulfil my needs. I´ve used PHP Nuke but I think it isn´t very safe. I would need a package where creating new modules wew easy. Which one would you recommend it? Which one do you use? Thanks in advance.
[PHP] Using Paradox and Delphi with PHP
Is there any way to use a Paradox database with PHP? I have an aplication made in Delphi using Paradox and I need to attack the Paradox database using PHP. Do you know if there is anyway? Thanks in advance!! ;)