Unregistered Avatar

Reply

What's up with THIS (IE7 fluke) ???


 
LinkBack Thread Tools Display Modes

  #1 (permalink)  

Old 06-03-2007, 01:54 PM

Question What's up with THIS (IE7 fluke) ???

Preface: I am learning PHP from a book with a cd-rom included.
Here is the code from Example 4.15.php --
Code:
<?php
    $age = 26;
    $old = &$age; // This is a valid assignment.
    $old = &(26 + 7); // Invalid; references an unnamed expression.
?>
I understand what it is trying to show, but most of the Examples at least *process* on my local Apache 2.2 / PHP 5.2.3 server, and I would expect an Error Message. What I do get is that both IE7 and Firefox display a blank page. Firefox even shows no page source, which I expect since the server processes and (effectively) hides the PHP code, but the fluke is THIS:
IE7 displays this (r-click - View Source) --
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=windows-1252"></HEAD>
<BODY></BODY></HTML>
So WHERE did THAT come from??? Does IE *self-generate* HTML code???
signed, a perplexed and baffled Jim L.

JIM_ELL is offline noobie webdesigner

JIM_ELL's Avatar

Join Date: May 2007

Location: AR, USA

Posts: 21

Send a message via MSN to JIM_ELL

  #2 (permalink)  

Old 06-03-2007, 03:03 PM

Re: What's up with THIS (IE7 fluke) ???

IE probably sees it as a blank page and pre-processes the doctype. You shouldn't be seeing anything in the source because its a PHP page and the code is processed on the server and then sends output to the browser.

As far as references. They more useful when your dealing with classes and objects. For example:

PHP Code:
/**
 *   Simple registry class
 *   By Pat Andrew 2007
 */
class Core {
     private 
$store = array();
     
     
/**
      *  Register function,  assign a name and pass a variable / object
      *  usage:  Core::register('db', $db);
      */
     
public function register($name, & $obj) {
         if(
is_object($obj) || is_array($obj)) {
             
$this->store[$name] =& $obj;
         } else {
             
$this->store[$name] = $obj;
         }
    }
     
/**
      *  Registry function,  get the data for a given name
      *  usage:  $db =& Core::registy('db');
      */
    
public function registry($name) {
         if(isset(
$this->store[$name])) {
               return 
$this->store[$name];
         }
        return 
false;
    }

missionsix is offline loves you.

missionsix's Avatar

Join Date: Feb 2004

Location: under you.

Posts: 4,728

Send a message via AIM to missionsix Send a message via MSN to missionsix

  #3 (permalink)  

Old 06-03-2007, 06:58 PM

Re: What's up with THIS (IE7 fluke) ???

_-¯Wooosh!

That went right over MY head, Pat!

Wow I appreciate the effort, but note my 'title' is noobie...
...and I just opened the PHP book 3 days ago.

JIM_ELL is offline noobie webdesigner

JIM_ELL's Avatar

Join Date: May 2007

Location: AR, USA

Posts: 21

Send a message via MSN to JIM_ELL
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Dropdown Menus in IE7 Mongoose Website Design 4 12-28-2006 03:19 AM
Im using IE7 :) FuLouZero The VOID! 11 07-30-2005 08:46 PM


All times are GMT -7. The time now is 10:49 PM.