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)).'/';

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

Bluetooth RSSI & VIsta
Okie I got 4 Bluetooth adapters, a DBT-120 by Dlink, A Zonet Microsoft Bluetooth which is what I use

How to convert this array to string
I am having problems converting this array to a string
using print_r($val[1]); I get:
Code: [

Multi language - seo links
Im trying to figure out the best method to have a multi language website that will function with seo

Rss feed question
Hi

My blog and my website are different. Am i able to take my rss feed
from my blog and p

Pulling out some result data from MYSQL
Hey Guys,

I've built a PHP page that has a for just imagine something like registration form

Warning: Cannot modify header information - headers already sent by (output sta
Warning: Cannot modify header information - headers already sent by (output started at /home/praylif

socket communication between c++/java and sending image
hi,

i have a class in c++ called win32_sockserver which creates socket to java. i am trying

Problem writing URL into database
How would I write this into the database?

<?php echo "http://".$_SERVER['SER

mysql UNION | warning mysql_fetch_array !!
Code: <?php
$i = 0;
$query1="SELECT * FROM `products` WHERE `div

ctype() validation - allowing illegal characters
Hello,
I use ctype() to filter and validate a user form. However, I am trying to allow certain c

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