Link to home
Start Free TrialLog in
Avatar of digisel
digiselFlag for United Kingdom of Great Britain and Northern Ireland

asked on

php programing

I need to be able to edit php files.
I have complete access to all the files on my site, through ftp.
I am well used to editing html files but have never accessed any php file.
I do NOT need to make programing changes to the php files.  
I need to be able to add and change  text on the page and edit the Title and Description in the head section.
Could someone please explain to me how I can do this without having to keep sending requests back and forth to my developer.
Thanks
Avatar of Slimshaneey
Slimshaneey
Flag of United Kingdom of Great Britain and Northern Ireland image

There is the (slightly dangerous) option of editing the file sort-of directly. Using an FTP program like Filezilla (Its fantastic) you can right click any file and click edit. It downloads a copy of the file. The file will open in the editor of your choice (I recommend Notepad++ or Sublime Text) and Filezilla will monitor the file for changes. Save any changes in the editor, and go back to Filezilla, it will ask you do you want to upload the changes. Done!

Its not ideal, and goes against the proper development lifecycle you should be using, but will solve your problem immediately.
You can load php files into the same editor you load html files into.  Just don't touch anything inside <? ?>
Also, only edit the HTML. Avoid anything between <?php and ?> and <% and %> tags. Those contain PHP. The html should be recognisable for you.

Oh, ALWAYS ALWAYS back up before editing.
PHP does not use <% %> tags.  That is ASP.
It does, they are called short tags. Search for them in php.ini. They are usually disabled by default but some devs enable to speed up coding...
Oops, my bad Barry, you are right. I meant <?. <% is indeed ASP and .Net
Avatar of digisel

ASKER

Thanks for your input
I have been using Ipswitch WP 12 for years.
Is there any reason I should not use this for the process you describe above??
Avatar of digisel

ASKER

could you please expand on your statement There is the (slightly dangerous) option....
why is it slightly dangerous if I keep a back-up copy of the original.
What are the pitfalls that I must avoid other than those you specify?

Please also explain your statement:

"Its not ideal, and goes against the proper development lifecycle you should be using, but will solve your problem immediately. "
I am not a programer but I do have a working knowledge of using Notepad++ and html coding.
~Thanks
Only that Filezilla provides this functionality, is free and opensource and is the best FTP program Ive used (IMO).

You could just as easily download the file via your own FTP program and upload it yourself as you see fit. Filezilla simply provides a simpler, more integarted, approach.  Ultimately, you should work with what you feel comfortable.
Slightly dangerous in that you are editing files and uploading them directly to the server without proper testing. This ties in with the development lifecycle I was referring. In an ideal world, you would have a development environment, with some form of Code repositoy to track changes to the code. A deployment process to send the code to a staging environment for testing, and then onto live server should that testing pass.

Its a lot of effort, but ultimately, editing files direclty on live like this with FTP isnt ideal. However, full setups like that arent for everybody. And on simpler sites this can work just fine.
Avatar of digisel

ASKER

I have copied over index.php through Ipwitch.
I opened the file in Notepad++
I could see the programing instrcutions but none of the text i.e. in the head and the Body which I need to edit.
Not sure where to go from here
Avatar of digisel

ASKER

hi slimshaneey
thanks for your clear, concise and complete answer to my queries.   that was very good if i may say so.   often experts provide very cryptic  answers working on the assumption that one knows more than one does.  thanks
Avatar of digisel

ASKER

did my post regarding the fact that there is no html code in the file get through??
Is it possible that the index.php file is making a call on the text (i.e. html) located elswewhere in either another file or another sub directory on the site??
Yeah, depending on how the site is built, you could find it is all content managed, meaning the code fetches all the display content from the database or other source, and outputs it that way. Or it could be built as an MVC (Model-View-Controller) site with a framework such as Cake, Zend or Symfony. In this case there will be view templates, and layout pages that contain the html. The framework would then generate all the html by combining those. Exlplaining how they work is probably beyond the scope of a Q/A system like this, its pretty indepth too. Best option is probably to ask your developer where the layout code for various pages you want to edit is.
Without really seeing your code in index.php, its hard to say how exactly your site works. I would be very careful about posting that code here though, just in case there are identifying details like IP address, database names and passwords etc.  If you arent sure, dont post anything!

Again, your best bet is to get the developer to spend 5-10 minutes talking you through the structure, and any code framworks (like Zend, CakePHP, Symfony,Codeigniter etc), that the website uses. As I say, its likely tha, if a framework is involved, that the html is located in template files (or partials) and layout files (the main core of the page like headers and footers that dont change often, templates are for the inner parts thats change every page)

S
Avatar of digisel

ASKER

thanks.   i shall take it up with the developer as you suggest.  one last query please.
the site does work off a series of templates.  there are probably 20 sub categories on the site.  can you sugest what sort of directories i might investigate to find the html code.  what should i be looking for?
thanks
ASKER CERTIFIED SOLUTION
Avatar of Slimshaneey
Slimshaneey
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of digisel

ASKER

thank you for very much for help and support.  I very much appreciate it.
best regards.   cheers