Are view "page source" code and index.php the same?

8 replies
  • WEB DESIGN
  • |
Example of View Page Source Code

Code:
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
	<style type="text/css">
		@import "tickertape.css";
	</style>
	<SCRIPT TYPE="text/javascript">
<!--
function popup(mylink, windowname)
{
if (! window.focus)return true;
var href;
if (typeof(mylink) == 'string')
   href=mylink;
else
   href=mylink.href;
window.open(href, windowname, 'width=560,height=400,scrollbars=yes');
return false;
}
//-->
</SCRIPT>
</head>

<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">

<!-- ImageReady Slices (Untitled-1) -->

Would the index.php file for above site look identical?


Finally -if I made modifications to a php file and it's messed up - is there some freeware software or website that can 'check the code to see where the errors are?

I'm sure I just deleted a > or something....

Here's my not so eMazng at the moment site - if the view source code is enough info.

emazng

MostlyHarmless
#code #indexphp #page source #view
  • Profile picture of the author Lloyd Buchinski
    If it makes you feel any better, I just went to a php tutorials site and the only thing on the whole page was "XML error: mismatched tag at line 32"

    Sorry I can't help you. That page looks desperate I almost started a thread once 'What's the worst thing you've done to screw up a live site?' I have some significant accomplishments in that area. But at least it sounds like you don't have traffic coming yet.

    Anyway, thanks for a bit of relief. I'm not the only one who does stuff like this.

    Best wishes, hope you get it sorted out.
    Signature

    Do something spectacular; be fulfilled. Then you can be your own hero. Prem Rawat

    The KimW WSO

    {{ DiscussionBoard.errors[2122743].message }}
  • Profile picture of the author NetMan
    Originally Posted by MostlyHarmless View Post

    Example of View Page Source Code

    Code:
    <html>
    <head>
    <title></title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
        <style type="text/css">
            @import "tickertape.css";
        </style>
        <SCRIPT TYPE="text/javascript">
    <!--
    function popup(mylink, windowname)
    {
    if (! window.focus)return true;
    var href;
    if (typeof(mylink) == 'string')
       href=mylink;
    else
       href=mylink.href;
    window.open(href, windowname, 'width=560,height=400,scrollbars=yes');
    return false;
    }
    //-->
    </SCRIPT>
    </head>
    
    <body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
    
    <!-- ImageReady Slices (Untitled-1) -->
    Would the index.php file for above site look identical?


    Finally -if I made modifications to a php file and it's messed up - is there some freeware software or website that can 'check the code to see where the errors are?

    I'm sure I just deleted a > or something....

    Here's my not so eMazng at the moment site - if the view source code is enough info.

    emazng

    MostlyHarmless

    If I understand your question correctly, there's no PHP code in the above source, so yes it would look the same.

    The only thing that will not appeain view source is the PHP code.

    Best regards,

    Andre Foisy
    {{ DiscussionBoard.errors[2122968].message }}
    • Profile picture of the author krikkod
      If you are trying to find the php code you need to have the original index.php file and open it in any code editing software like dreamweaver or even more basic then that, you can just open it in notepad.

      The original file will be on the server.

      You can't actually view php code if you attempt to 'view source' within your browser. It's impossible to do this because php is server side code. Meaning, the server renders php into html before you see it in your browser.

      php file on server > goes to web browser from server > php file now looks like html.

      Even if the web page you view says 'index.php' all that means is in it's original format, eg. before it got to the web browser - index.php was in php format. But now that you are viewing it in the browser it is in html format.

      To give you a real world example, go to any wordpress blog and do a view source. All the source code will be in html - with the obvious exception of javascript but you get my point.

      As for checking for errors with php - php has a pretty good built in error checker of it's own. You don't need any programs to use it. Basically, if your php code is stuffed then the browser will show error statements. Those error statements will tell you how to fix the error.

      For example - error is on line 34, ';' is an unknown character.

      So you would then go to line 34 of the php file and remove ';'.

      That is definitely a basic example and the error statements aren't normally as clear as the one i just provided, but you get the idea.

      Hope this helps.
      Signature
      {{ DiscussionBoard.errors[2123279].message }}
  • Profile picture of the author Heidi White
    Thanks for explaining this to me! Right away I saw that my auto install from Kompozer of HTML code at the top of the 'edited' php file created the original really ugly design. I'm happy to say that by removing it (top and bottom) and adding some formerly missing php code at the bottom I now have 1 error showing up in the browser.

    Here's what it says:
    Parse error: syntax error, unexpected '=', expecting ')' in /home/eadmin/public_html/index.php on line 47

    Here's what lines 46- 48 look like in my edited index.php:

    46 xml_parser_free($xml_parser);
    47 array("Id" =&gt; 0));
    48 /*$jsonHandle['0']['Id'] = 0;

    Here's what line 46-48 looks like in the original index.php;

    46 xml_parser_free($xml_parser);
    47
    48 /*$jsonHandle['0']['Id'] = 0;


    i'm going to take out that array line and see what happens....

    duct tape anyone?
    {{ DiscussionBoard.errors[2123457].message }}
    • Profile picture of the author Heidi White
      ok - now the parse error has moved down - will this every end?

      ....

      yes it does end - now i have a table filled with empty slice place holders and no graphics.

      ....

      ...

      I think it's getting solved. I had the names of the image files listed but I didn't specify where to find them.

      I had this for every image:

      <!-- ImageReady Slices (emazngSLICE.psd) -->

      [B]<img src="emazngSLICE_01.gif" alt="" height="11" width="1024"></td>


      when I should have had this:

      [B]<img src=images /emazngSLICE_01.gif" alt="" height="11" width="1024"></td>


      <!-- End ImageReady Slices -->

      P.S. - where's the add code button in the reply box?
      {{ DiscussionBoard.errors[2123563].message }}
    • Profile picture of the author Heidi White
      OK - it's looking much better, but somehow I have one of the slices out of alignment.

      In photoshop it looks to be slice 08.

      I think there is something wrong with this section:

      <tr>
      <td colspan="2" rowspan="3">
      <img src="http://www.warriorforum.com/images/emazngSLICE_06.gif" alt="" height="398" width="58"></td>
      <td colspan="10">
      <img src="http://www.warriorforum.com/images/emazngSLICE_07.gif" alt="" height="334" width="779"></td>
      <td colspan="3">
      <td colspan="2" rowspan="3">
      <img src="http://www.warriorforum.com/images/emazngSLICE_08.gif" alt="" height="398" width="58"></td>
      </tr>


      Please look at file (www.emazng.com) to see how it looks right now (for future readers, suffice a 398x58 section of graphic was moved just outside and to the right of the primary layout rectangle 1028x769)



      How can I tell if a slice is in the right place inside the code? I'm not sure what changes to make.
      {{ DiscussionBoard.errors[2123779].message }}
  • Profile picture of the author mattcruzanderson
    Try checking your page with inspect element in google chrome or you can try firebug also for firefox
    Signature

    "The things we fear most in organizations - fluctuations, disturbances, imbalances - are the primary sources of creativity."
    Margaret J. Wheatley

    {{ DiscussionBoard.errors[2123818].message }}
  • Profile picture of the author Manfred Ekblad
    You can use the Firebug-plugin in Firefox to track down strange things in the layout.

    Firebug

    It's an amazing tool that lets you "browse" and inspect each part of the page using simple point & click... You can even make modifications in the code (temporarily) to preview any changes you need to do.

    I hope that helps you
    {{ DiscussionBoard.errors[2123821].message }}

Trending Topics