Reply to Re: converting variables and IF from ASP

Your name:

Reply:


Posted by Rik on 12/28/06 16:11

brown705 wrote:
> Hi,
>
> I'm converting a client's web site from ASP to PHP, and besides the
> SSIs, there is some variable use and some IF statements that I do not
> know how to recreate in PHP (I'm quite amateur in PHP).
>
> It seems the ASP code sets a variable called "page" at the top of each
> page on the site, setting a unique number for the page. Then in the
> links sidebar, it uses IF statements to identify the page and give a
> different link image to the current page. Each link has a
> bullet-style image in front of it, and the current page would have a
> different color bullet when identified by the "page" variable.
>
> Here's the code:
>
> Each page had "<%page = X%>" at the top, where X was a unique digit.

<?php $page = X; ?>


> Then each link looked like this:
>
> <td>
> <% image = "images/bullet_off.gif"%>
> <%if page = 2 then image = "images/bullet_on.gif"%>
> <img src="<%=image%>">
> <% image = "images/bullet_off.gif"%>

<?php
$image = ($page == 2) 'images/bullet_on.gif' : 'images/bullet_off.gif';
echo "<img src=\"$image\">";
?>

Judging from this little tiny bit of code, the ASP version wasn't very well
coded, or at least not very efficiλnt. Line-for-line translation to PHP
will probably not result in a very good system. Consider rewriting the
thing.
--
Rik Wasmus

[Back to original 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

Π‘Π°ΠΉΡ‚ ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ Π² Π‘Ρ‚ΡƒΠ΄ΠΈΠΈ Π’Π°Π»Π΅Π½Ρ‚ΠΈΠ½Π° ΠŸΠ΅Ρ‚Ρ€ΡƒΡ‡Π΅ΠΊΠ°
ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ΠΈΠ΅ ΠΈ ΠΏΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΊΠ° Π²Π΅Π±-сайтов, Ρ€Π°Π·Ρ€Π°Π±ΠΎΡ‚ΠΊΠ° ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΠ½ΠΎΠ³ΠΎ обСспСчСния, поисковая оптимизация