Reply to Re: converting variables and IF from ASP

Your name:

Reply:


Posted by brown705 on 12/30/06 17:55

Rik,

Thanks for the info, but that didn't work for me. It gave this error
on the line that starts with $image:

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in
/home/**(edit)**/public_html/includes/links.php on line 11


I Googled for "php if statement" and ended up finding this:
http://www.tizag.com/phpT/ifelse.php

I used this method and it worked fine.

Michael


On Dec 28, 10:11 am, "Rik" <luiheidsgoe...@hotmail.com> wrote:
> 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- Hide quoted text -- Show quoted text -

[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

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