An odd assignment statement. Can someone explain this assignment to me?


Posted on 16th Feb 2014 07:03 pm by admin

What purpose is served by the bit of code between the two equal signs in the $installurl set? Is this some sneaky way of setting $baseurl? I remember the code seemed to blow up when I took it out.

Code: [Select] $protocol = $_SERVER['HTTPS']==='on' ? 'https://' : 'http://';
$installurl = $protocol.$_SERVER['SERVER_NAME'].$baseurl=implode('/PETE/',array_slice(explode('/PETE/',$_SERVER['SCRIPT_NAME']),0,-1)).'/';
Did you know?Explore Trending and Topic pages for more stories like this.

As always, any help greatly appreciated.
No comments posted yet

Your Answer:

Login to answer
282 Like 52 Dislike
Previous forums Next forums
Other forums

Problem with HTTP Caching...?
Hi there, im trying to implement caching. But it doesn't always work.
I post it here because ther

Error Messaging not working
I changed the way my form tells the user of an error. But I can't seem to get it to work properly.

Solution to the FindControl problem
I have seen may posts about having problems with the FindControl method. Most seem to come about bec

ereg_replace issue
hi there people

i have this code happening with regards to my wamp server. is this something

button.click += new eventhandler() not works in if(!ispostback)
i want to use button.clcik event in function VIewScrap() which is called in if(!ispostback) but itdo

How to get the previous months last date....
Here's my wittle problem. I suck at working with dates.

So today is 10/20/2009, i need to fig

Bandwidth monitoring?
Hi guys,

I need a little information I have written a php app and I occurred to that I need

php wont update my db
hello,

sorry for posting in mysql forum but i dont know where exactly is the problem but here

check how many commas the variable containing the query has between [i]select[/i
Hi...

iv made an sql table that contains id number - name of sql query and an sql query.
T

quick question
Hi ..

i have a question
how do i set a var so it displays via an echo
Code: $logo = '&a

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash