Forum Moderators: coopster

Message Too Old, No Replies

Php: Can a web site customer edit HTML content?

         

joe commerce

5:46 pm on Sep 4, 2005 (gmt 0)

10+ Year Member



Hello,
I'm happy with the results of a dynamic PHP site for my business. My question is how can I access and edit the HTML inside PHP Shells? I am not about to mess with the PHP or dbase, but I can't afford to call a programmer when I need to change text in a paragraph.

Thanks

mcavic

7:25 pm on Sep 4, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It depends on how the PHP code is written. If the HTML/text is hardcoded in the PHP scripts, you can edit the scripts, but that's tricky because you'll have to keep all of the PHP statements intact.

Or, it could have been written with the text stored in a database or a separate text file.

joe commerce

10:42 pm on Sep 5, 2005 (gmt 0)

10+ Year Member



Yes everything is in a Shell, that's the problem. How do I access the (HTML) code in the shell?

Example:
<?
$shell = "_shellCommon.php";
$shellBody = "home/faqBody.php";
include_once("_main.php");
?>

Thanks

stuartc1

12:59 pm on Sep 6, 2005 (gmt 0)

10+ Year Member



Looks like you need to edit the HTML within the file home/faqBody.php - just be careful when you come accross special bloks like [[something in here]] or %something in here% etc.. different templating systems use word wrappers which will be converted in the scripts.

MatthewHSE

1:30 pm on Sep 6, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If you have to edit text within a PHP script, and don't know PHP, then stick to editing ONLY the text that will be visible on the "front end," through the browser. Also, check to see if you have to escape special characters. If you don't escape them when you should, your script will throw an error. If you do escape them when you shouldn't, you'll get '\' symbols appearing on the front end.

Oh, and don't forget to make backups before you edit anything! That way, if you do end up with a mess, you can at least restore the original version.

Backups can't be over-emphasized. It's been said that there are two kinds of people in the world; those who don't make backups, and those who have learned to make backups. Most people who use computers will eventually fit into the second category, but the transition is often painful and expensive.

joe commerce

1:39 pm on Sep 6, 2005 (gmt 0)

10+ Year Member



Thanks for the tips. Not that I would try this myself, but what about the Echo command that turns the script code into plain HTML?

Thanks

MatthewHSE

1:52 pm on Sep 6, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Echo doesn't really turn anything into HTML; it's just that anything you echo will be returned to the browser as text. You may or may not have to escape special characters in an echoed block of text, depending on the context.

I suggest you grab a book on PHP (Kevin Yank's PHP/MySQL book is good for starters) and spend just enough time on it to learn the basic syntax. I got that far in less than one afternoon. That will help you understand a little of what's going on in the script, what you can and can't touch, where escaping is necessary, etc. Besides being safer, you'll also have the confidence you need to make the edits fast and comfortably.

joe commerce

4:40 pm on Sep 15, 2005 (gmt 0)

10+ Year Member



I just wanted to take a moment to publicly thank Matt "mcavic" for helping the customer of a poorly coded PHP web site - me! I now have access to some of the HTML can you believe it? Poorly coded in a sense that the developer did not allow me to edit anything without being a programmer. But anyway, thanks to Matt big time. Others that offered advise were Granpa, Matthew HSE and a few other select professionals.

joe commerce

mcavic

5:53 pm on Sep 15, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



And poorly coded in that they neglected to include the <html><head><title> on most all of the pages.

Glad to help out!

Matt