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

Empty text file when there is over XXXX lines of text.

define("RANDOM_FILE","/public_html/random.txt");
$randomEntry = "

Java API in PHP?
I have an application that we use internally here at the office.

The software company provide

Cant display mysql data
Hey all,

I am learning php and my first goal is to create a simple CMS. At the moment I am st

php title problem
Hi,

I am having a problem managing my page title with PHP.

Currently I have my <

I need desperate help with this php code integrated with flash please
Can someone please help me with this php code which I have been stuck on for weeks . I am trying to

Need help with an email blocker for a guessbook
I am new with php and here is a simple guessbook page but I am being hit with spam from a group of t

how to make database item unique
Hey guys,

is it possible to do this:

I have the database item $title being pulled for

first id from db not showing
I have a php script which displays the content of a mysql table as a html table with sorting, delete

Update Database
Hi All,


I have a problem with this:

Code: [Select]<?php
session_start();

Output Full URL of Current Page
Let's say I am currently viewing a dynamic page:

http://www.mydomain.com/directory/index.php

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