Topic: script codes in index.php different from browser source

Am trying to customize my index page(index.php), but for some reason the script code in index.php is different then what is found in the actual page in the brower when I source it. I tried cut and pasting the codes in the source into the index.php changing the title of a word just to test for any kind of change so I can experienment with it in a php editor and it doesn't work properly. It does affect it so I know am working on the right index.php file from my FTP folders. I looked everywhere for the index.php that matched the codes from the source codes I got from the browser, but there is known. I would love to put document pictures of what am talking about  with script codes of files, FTP file folder page if I may so I can help explain.

Re: script codes in index.php different from browser source

I'm not sure if I'm understanding you correctly but what you describe is just how PHP works.  Take an example from the galleries index (thumbnails) page. Look at the index.php file in a text editor and you will see:

<p class="adminlink"><a href="<?php print $adminLink; ?>">Admin Sign In</a></p>

The code inside the php tags is telling the web server to print out the contents of the $adminLink variable and show it in the browser. What the browser sees is not the code but the stuff that is printed out from the code. So when you do a 'View source' in the browser you will see something like this:

<p class="adminlink"><a href="svmanager.php">Admin Sign In</a></p>

PHP running on the server has printed out the string of characters 'svmanager.php' in place of the variable $adminLink.

What this means in practice is if you are trying to customize a page with embedded code inside php tags <?php ... ?> then leave the stuff inside the tags to do its work and just mess around with the regular html and css.

Hope I'm understanding you correctly and hope I haven't confused you further.

jack

Jack Hardie
SimpleViewer Support Team.

Re: script codes in index.php different from browser source

I'm not sure if I'm understanding you correctly but what you describe is just how PHP works.  Take an example from the galleries index (thumbnails) page. Look at the index.php file in a text editor and you will see:

<p class="adminlink"><a href="<?php print $adminLink; ?>">Admin Sign In</a></p>

The code inside the php tags is telling the web server to print out the contents of the $adminLink variable and show it in the browser. What the browser sees is not the code but the stuff that is printed out from the code. So when you do a 'View source' in the browser you will see something like this:

<p class="adminlink"><a href="svmanager.php">Admin Sign In</a></p>

PHP running on the server has printed out the string of characters 'svmanager.php' in place of the variable $adminLink.

What this means in practice is if you are trying to customize a page with embedded code inside php tags <?php ... ?> then leave the stuff inside the tags to do its work and just mess around with the regular html and css.

Hope I'm understanding you correctly and hope I haven't confused you further.

jack




Hi Jack, thank you for replying. Am trying to customize the gallery index page, but the index.php in my gallerys folder does not have the script you wrote. The script you wrote is the one am trying to find to edit. I search through all the folders for the index.php script and they all do not script like that how you described it. I am using dreamweaver cs4 and when I try to edit the index.php dreamweaver translates the script to (SimpleViewer requires Macromedia Flash. Get Macromedia Flash. If you have Flash installed, click to view gallery.) 

Here is a list of folders in my ftp.

Art  (is the name of my gallery folder)
      Art’s sub-folders and scripts in bold.
            Images(folder)
            Thumbs(folder)
            Gallery.xml
            index.php
            preferences.txt
            readme.txt
            swfobjects.js
            Viewer.swf

Aspnet_client
Classes
Colorjack
Css
Customthumbs
Data
Images
Img
Includes
PHP
Php_uploads
Samplegallery
Scripts
Svmaster
thumbcache
uploader


Please if you can help me find the index.php that handles my gallery index. Thank you very much for you help.

Re: script codes in index.php different from browser source

The file that displays your gallery is the index.php file inside your Art folder. You will need to look at it using the Code view in Dreamweaver. If you look at it in the Design view then you'll get the SimpleViewer requires Macromedia Flash... message that you describe.

A few days ago, I wrote a a short tutorial on this topic. I don't know if you've already seen it but if not then maybe you could take a look and see if it helps.

jack

Jack Hardie
SimpleViewer Support Team.