You are here: Re: rewrite this a little better « All PHP « IT news, forums, messages
Re: rewrite this a little better

Posted by Steve on 12/04/06 19:14

"windandwaves" <nfrancken@gmail.com> wrote in message
news:1165255430.181520.112710@16g2000cwy.googlegroups.com...
|
| Geoff Berrow wrote:
| > Message-ID: <QhYch.24$qf4.0@newsfe02.lga> from Steve contained the
| > following:
| >
| > >that's all you get until you state what it is you're actually wanting
the
| > >function to do. i'm not going to read your function to try and find
out. i
| > >have much better things to do with my time...of which you should be
| > >considerate since you're not paying for an answer.
| >
| > That was my reaction too.
|
|
| Hi Gurus
|
| Sorry about that. Basically, I wrote the function because part of my
| site should be on a secure server and part of it on a normal server.
|
| In order to achieve this, I identified two pages that should instigate
| a switch between the secure and the non-secure sites. Note that both
| sites have exactly the same stuff on them.

no gurus here.

anyway, how's this for reduction?

$site->uri = 'http' . ($securityEnabled ? 's' : '') . '://' .
$_SERVER['HTTP_HOST'];

this is in a configuration file of mine. $securityEnabled when true, changes
the protocol go to https. i use $site->uri in my other pages to include
other resources like javascript, images, documents, etc.. it works nicely to
avoid getting 'some content is secure and some isn't' type warninging in
your browser.

your switch is simply propogated by each page by setting $securityEnabled
and including the suggested code.

 

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

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