Jump to content
Guest

What's the trick with .php sites?

Recommended Posts

Guest

Hi everyone,

 

I need to do a little mainteance/updating on a client site, but the site was created in .php which is fairly unfamiliar territory for me. I have another client who uses .php on her site as well, so I would really like to understand the fundamentals a little better. Here's my main question:

 

What other files, besides the actual .php page do I need in order to make the page display correctly inside of my HTML editor? Do I always need to download the whole site? It became immediately apparent to me after downloading a few .php pages that the page is obviously pulling critical information from a database somewhere in order to display its content correctly.

 

Any help very much appreciated by this .php newbie!

 

TIA,

Karri

Share this post


Link to post
Share on other sites

Guest

Karri, because php is executed by the server, the only way to get php to reproduce locally is to download Apache and php directly to your computer, so that yourself up as a local server. If your own site hosting has php enabled, it may be easier to set up a development site on your server, and test changes via ftp.

Share this post


Link to post
Share on other sites
Guest

Thanks Leanne.

 

Hmmm, this one might be over my head! Darn. All I need to do is make content updates. I can't even find the content or the nav menu I need to add stuff to ... Here is all I see in the page I want to edit (inside of Dreamweaver ... the page I want to edit is called "corporate_training"):

 

<?php

set_include_path("../includes");

$page="corporate_training";

$pagetitle="Corporate Training";

$corporatemenu=true;

include("top.inc.php");

 

print_database_page("corporate_training", "images");

 

include("bottom.inc.php");

?>

 

I don't see a file anywhere that contains the page content -- not even sure what to look for?

 

Karri

Share this post


Link to post
Share on other sites
Guest

I don't pretend to be a php expert, although I'm trying to learn more about it, because it's a pretty powerful scripting lanugage that doesn't depend on individual browser settings to function across platforms and browsers. Your script is making use of includes to pull the content in. Includes are a wonderful way to bring in content, especially to large websites, because you can change just one file, and the change will populate through to all pages that are set to include that file.

 

The stuff that starts with the $ signs are variables. These are set on each individual page of the site, as they will change from page to page (i.e. you wouldn't want the title of your "contact" page to say "corporate training"). The $page variable likely sets which file in the includes folder will be called for this particular page.

 

You need to look for the folder called "includes" which will be one directory level above your current page. In there, you should find a file called corporate_training, and the files top.inc.php and bottom.inc.php, which are probably some sort of global page layout files where the header and footer reside.

 

Share this post


Link to post
Share on other sites
Guest

Thanks so much Leanne. This is a huge help and saves me a ton of time hunting around.

 

I'm going to try that this afternoon and see what I find. I'll let you know what happens!

 

Karri

Share this post


Link to post
Share on other sites

One of my favorite free programs is XAMPP for Windows, a very easy to install Apache distribution that contains MySQL, PHP (versions 4 and 5 :thumbup: ) + PEAR, Perl, phpMyAdmin…etc. It is a small download, about 30MB, and XAMPP takes up under 300 MB of disk space. It is a great tool for testing/learning PHP!

 

HTH,

Carol

 

 

 

 

Share this post


Link to post
Share on other sites
Guest

Carol, you never fail to be full of useful tips and information! Thanks so much for this!

Share this post


Link to post
Share on other sites
Guest

Ok, so I couldn't find the include file that is feeding into the page I want to edit. UGH. So does this mean I need to download the Apache stuff you are talking about first then Carol?

 

Yikes. Their tech guy said he might be able to make the changes for me but that could be a while. This one's not at the top of his list and I really want and need to be able to render .php sites properly so I can edit them and do SEO on them.

 

Thanks,

Karri

Share this post


Link to post
Share on other sites

You are welcome Leanne!

 

Karri,

The Apache distribution will allow you to preview your changes before they are uploaded to the server, but it will not help you locate included files. Includes are sometimes called via the .htaccess file, so you may want to open it and look for auto_prepend and auto_append file commands (php_value auto_prepend_file dir/filename.php).

 

Have you tried loading the site locally and using Dreamweaver’s search entire local site function to locate a snippet of code from the navigation menu? If the menu is text, try searching for one of the menu options.

 

HTH,

Carol

Share this post


Link to post
Share on other sites
Guest

Well, here's my problem: I just want to add some "side" information to the nav menu only on this one page. It's like how some sites have testimonials and other extraneous bits of interest down the left side bar under the navigation. In this case, we want to insert a partial list of previous clients and then a clickable piece of text that says "see full list" or whatever.

 

But perhaps given that this menu is set up as an include (I think!), my idea is not possible?

 

Karri

Share this post


Link to post
Share on other sites
Guest Lisa Boyd

Well, here's my problem: I just want to add some "side" information to the nav menu only on this one page. It's like how some sites have testimonials and other extraneous bits of interest down the left side bar under the navigation. In this case, we want to insert a partial list of previous clients and then a clickable piece of text that says "see full list" or whatever.

 

But perhaps given that this menu is set up as an include (I think!), my idea is not possible?

 

Hey Karri,

 

PHP is great for building dynamic websites. Depending on how the site is setup, the nav menu is probable in it's own php file that is called on every page. Your idea is possible, you just need to figure out where to edit the information. Email me and I can look at the files and tell you which ones to edit. You have to be careful how you edit PHP files because HTML tags that go together (for example <div> and </div>) may be in totally separate files. When it's parsed by the web server though and brought together, it all lines up correctly.

 

Lisa B.

 

________________________________________________

Lisa Boyd, The Technical Virtuoso

Zeteo Solutions

Relieving Coaches' Technical Headaches

Share this post


Link to post
Share on other sites
Guest

Okay, I got lucky and didn't have to search a ton of files (the designer created a nice neat folder called "includes!").

 

I think I found the snippet of code that I need to take a closer look at. It's in a file called functions.inc.php. Here's what it looks like (with identifying information changed):

 

$sometext= "<div style=\"font-size:85%; float:right; margin-left:10px; width:200px; border:1px solid gray; padding:4px\">";

$sometext.= "<span style=\"font-style:italic\"><span style=\"color:red; font-weight:bold\">A Heading</span><br><br>";

$sometext.= "ABC Company<br>";

$sometext.= "DEF Company<br>";

$sometext.= "GHI Company<br>";

$sometext.= "JKL Company<br>";

$sometext.= "MNO Company<br>";

$sometext.= "PQR Company<br>";

$sometext.= "STU Company<br><br>";

$sometext.= "<a href=\"http://www.MyClientsWebsite.com/PageIWantToEdit.php\">Click here to See Another Page of MyClientsWebsite</a>";

$sometext.= "</span>";

 

So, my "goal" is to reposition this information but ALSO to apply a different set of CSS styles to it. Namely the same CSS styles that were used in the nav bar itself. Then it will all sort of coordinate and not look strange.

 

PS: How straightforward is it to download and setup XAMPP? I'm not a programmer ;)

 

Karri

Share this post


Link to post
Share on other sites
PS: How straightforward is it to download and setup XAMPP? I'm not a programmer ;)

Hey Karri,

 

Sounds like you are making good progress. Straightforward installation instructions can be found here: XAMPP Windows Install.

 

Be sure and review the XAMPP for Windows FAQ.

 

HTH,

Carol

 

 

Share this post


Link to post
Share on other sites
Guest

OK, I'm taking a DEEP breath as I say this but I've just been advised that we now don't need to make the aforementioned change. ARGH!

 

However, this thread has been SUPER useful to me. Truly! And I still need to try and understand the fundamentals of .php. (I've already learned enough to do some damage. LOL.)

 

So, my "PS" question above still stands because I have a .php site I want to optimize for a friend I barter with.

 

As for repositioning something within an include (like the one I pasted in above), I still find positioning confusing!

 

TIA,

Karri

 

PS: Oooh, that was weird, Carol. You posted like one minute before I did! Off to read all about XAMPP!

PPS: Ok, so if I'm understanding this other forum post correctly, XAMPP simply allows you to preview changes you make to .php files inside your usual HTML editor (e.g. DW)?

Edited by Karri

Share this post


Link to post
Share on other sites
Guest

Karri, I installed the XAMPP with a minimum of stress by downloading the version with the installer. It's extremely straightforward, and you should have no trouble with it.

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Want to Become a VA?
    Invest in The VAC!
    How Do YOU Startup A

    Virtual Assistant Organization Association
    Upgrade Your FREE Account & Receive Today...
    * Access to Our Bus JOB Board *
    * Group Coaching & Training*
    *Training Tracks*
    * Private Mastermind Area *
    * Business Templates *
    * Contracts & Forms*
    * Plus VAinsider Perks! *
    UPGRADE HERE


    Virtual Assistant Organization Association

    Virtual Assistant Organization Association







    HootSuite - Social Media Dashboard




×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.