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

Registration
ok so i have a site where people can register and login which works now thanks to someone on here th

Why is my row count 0?
Here's the MySQL query i'm running. It basically pulls data from 2 tables based on some data passed.

Php WordPress help
I am writing the following code for making a plugin

<?php
header("Content-Type

Applet JTextField Size Problem
Hello,

I recently started making an applet to calculate certain values for airplanes. However

extract data
Code: <div class="post hentry uncustomized-post-template">

Comparing Values
Hi
I'm reading data from a database and this seems to work OK.

Each system has an associat

Shuffle Array
Hi,

I am writing a script for a game that needs players to randomly be assigned a target (ano

Firewall / visited websites logger
Hi. I have a firewall implementation and I want to log all the websites visited on the machine. S

Working with Dates, help.
Sooo to make a long story short, here's what im trying to accomplish.

I need to create a drop

PHP Code reffering to database, doing something wrong.. pls help
Well i am quite new with PHP
and for school we have to make a PHP script which reffers to a Data

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