+ Reply to Thread
Results 1 to 2 of 2

Thread: Need help with PHP.

  1. #1
    reyaz01 is offline x10Hosting Member reyaz01 is an unknown quantity at this point
    Join Date
    Mar 2008
    Posts
    1

    Exclamation Need help with PHP.

    I've installed a PHP script called OScommerce. It came with a template and I don't know how to edit it. Everytime open it in dreamweaver or frontpage the scripts come up instead of the actual template. I need to edit the template, how can you do that? Sorry I am a n00b at PHP, Ive never done much web editing other than html. THanks!

  2. #2
    essellar's Avatar
    essellar is offline Community Advocate essellar has a spectacular aura about
    Join Date
    Feb 2010
    Location
    Toronto, Ontario, CA
    Posts
    1,153

    Re: Need help with PHP.

    First off, I have to say that even if you were an experienced developer I wouldn't envy you that task. I haven't taken a close look at OScommerce in quite a while, but I distinctly remember it being some of the worst code I have ever worked with, both in terms of the HTML it produces and the PHP that generates it.

    Since there's not a whole lot of web page to work with if the code isn't running, your best bet would probably be to set up and run the app somewhere. (You should be able to run it on your local machine using something like WAMP Server or XAMPP.) Open the site in your browser, and save the resulting web pages. That will give you some HTML to work with in Dreamweaver, where you can use the WYSIWYG editor to change the look of the page. Keep in mind that you don't want to make too many structural changes, since the actual HTML that OScommerce produces comes from all over the place (or at least it used to). Everything is in tables, and luckily the tables themselves are on the main PHP pages -- it's the individual rows and cells that are generated in deeply hidden scripts.

    Anything more than minor cosmetic changes are going to require a pretty decent knowledge of PHP and a lot of patience to wade through the various dependencies (scripts calling scripts calling scripts). Working with the higher-level pages isn't all that difficult -- you just have to look for the places where the old HTML came from and edit the changes in (based on your Dreamweaver-created mock-up). It's going to be tedious, no question about it, and you'll want to do it in small batches to keep your eyes sharp -- but you should be able to do it.

    It would be a whole lot easier, though (and not just for PHP -- for your web development in general) if you could get past the WYSIWYG tools, get your hands dirty, and work with the underlying HTML/PHP. Machine-generated code isn't as bad as it used to be, but it's still almost completely inaccessible. Neither machines (like search engines), nor humans who rely on machines to read web pages (like the blind or those with severe CP) will be able to make heads or tails of your site unless the markup means what it looks like. The OScommerce developers don't come close to understanding that (which is why I tried to rewrite it several years ago for a client -- I eventually wrote their web store from scratch because it was faster and cheaper than modifying OSC).
    “Beware of bugs in the above code; I have only proved it correct, not tried it.” --Donald Knuth
    "It was as if its architects were given a perfectly good hammer and gleefully replied, 'neat! With this hammer, we can build a tool that can pound in nails.'" -- Alex Papadimoulis (on TheDailyWTF.com)

+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers