Welcome Guest ( Log In | Register )



2 Pages V   1 2 >  
Reply to this topicStart new topic
> How To Edit Php Files?
lorenza pieterse...
post Sep 25 2006, 12:29 PM
Post #1


Newbie [ Level 2 ]
Group Icon

Group: Members
Posts: 13
Joined: 15-September 06
Member No.: 15,955



Hi,

You can use frontpage to preview HTML files, but how can I edit and preview PHP files offline. I'm not well-known with PHP and I see more and more using this script to manage their site.
Go to the top of the page
 
+Quote Post
Mark420
post Sep 25 2006, 12:51 PM
Post #2


The Modernator
Group Icon

Group: Members
Posts: 486
Joined: 6-August 06
From: The Interweb!
Member No.: 15,021



Hi Welcome to Asta wink.gif

Ok first of all I would suggest this as the best program for editing any kind of text file like a php file

Notepad ++

Its pretty amazing at what it can do...
It understand languages like Php Html Sql etc so when you make a new file or open a file it wil understand the syntax and the arguments and change the colour of them to make it al much easier to see..

example of how it does this...this is a bit of php code im looking at right now wth notepad ++

/* Load and run the appropriate controller */
$results = array();

see what its done? the /* comments are in green statements are coming out in blue..

It makes it much easier in spotting mistakes in your code also..

It puts line numbers down the side so if you get errors from php like "error returned at line 9" you can jump right to it and change the code..

Also it splits you code into blocks using pagebreaks so u can collapse and expand sections..this is handy if you set a whole load of arguments at the start of the code and forget them wink.gif and have to keep scrolling up again to see what name u called the argument,,something i tend to do a lot!

Check out the Language menu item at the top and you can change to lots of different programming languages and then it will detect parts of the code it understands and colour them out for you making it easier to see as i showed earlier.

Its also available in a huge list of real world languages..even Basque! and Farsi

Its Open license too!!

So you got nothing to loose!!

Good Luck with it wink.gif

Go to the top of the page
 
+Quote Post
Quatrux
post Sep 25 2006, 12:52 PM
Post #3


the Q
Group Icon

Group: [HOSTED]
Posts: 1,022
Joined: 13-July 05
From: Lithuania, Vilnius
Member No.: 7,059



You just need to have php installed on your system and use the php.exe, but that won't satisfy you. As most users, you can install a server of your own, you just need to get apache+php and maybe also you can install mysql, so on windows it would be called a WAMP (Windows Apache MySQL PHP) Server on Linux LAMP, the same just Linux.. For windows there are different software which installs everything for you. I also suggest to install Zend optimizer the latest stable version. Google is full of tutorials how to do it, step by step tutorials are available.. Even this forum has something, because I remember reading about it here, so you can use the forum search.

Some PHP Editors (IDE) has debuggers and you just need to show the path to php.exe and it will output everything in an ie or some other browser engine.. but you won't have full features of php. wink.gif

Oh! Mark420 you were faster, but as I read your post you just suggested a php editor, I think he wanted to preview his php files without uploading them to an online php server through ftp or some other protocol.

This post has been edited by Quatrux: Sep 25 2006, 12:56 PM
Go to the top of the page
 
+Quote Post
Mark420
post Sep 25 2006, 12:59 PM
Post #4


The Modernator
Group Icon

Group: Members
Posts: 486
Joined: 6-August 06
From: The Interweb!
Member No.: 15,021



Lol @ Quatrox..yes Ive got fast fingers wink.gif

Mad thing is..I made a post today explaining a user about Xampp this morning!

Go to the top of the page
 
+Quote Post
HellFire121
post Sep 25 2006, 01:16 PM
Post #5


Premium Member
Group Icon

Group: [HOSTED]
Posts: 438
Joined: 28-January 06
Member No.: 10,925



You can do this in frontpage but other programs can do it better. If you right click on the file you can open it in the actual editor that frontpage has. Since i no longer use frontpage i don't know exactly how to do it.

I recommend you use a different editor. Ones that i have tried are textpad, crimson editor and dreamweaver. Textpad and crimson editor are both free and do a good job. Crimson editor also has special features that will help you with editing.

You can get textpad from: www.textpad.com
And crimson editor from: www.crimsoneditor.com

You need to pay for dreamweaver but it is a fantastic program and you should get it.

-HellFire
Go to the top of the page
 
+Quote Post
vujsa
post Sep 25 2006, 01:16 PM
Post #6


Absolute Newbie
Group Icon

Group: Admin
Posts: 887
Joined: 20-February 05
From: Indianapolis, Indiana, USA (Midwest)
Member No.: 2,714



Even funnier is that the topic was originally in the database forum!@#%!$#@! huh.gif

I move dit here and think that the user wanted to both to edit the files offline and preview the ouput generated.
So I would recommend installing apache, MySQL, and PHP on your local system and use any text editor like Notepad, Notepad++, PHP Designer, CuteHTML.

Keep in mind that PHP is a server side scripting language and will require you to learn basic programming skills whereas HTML is only a markup language which only modifies the text and images on a webpage. If you are using FrontPage, then you may not even fully understand the way HTML works which is a requirement if you want to design a website using PHP.

The reason you need to know both HTML and PHP is because the PHP you write will simply generate HTML on the fly for you and that HTML is what the user's browser will see. Only you and your server wil see the PHP coding.

vujsa
Go to the top of the page
 
+Quote Post
bakr_2k5
post Sep 25 2006, 04:01 PM
Post #7


Member - Active Contributor
Group Icon

Group: Members
Posts: 83
Joined: 25-September 06
From: The Netherlands
Member No.: 16,153



I did a quick google search and came with this!

Dev-PHP:
http://devphp.sourceforge.net/
It has it's builtin webserver for previewing php en stuff like that..

Don't use it myself since it's software for windows,
but a friend of mine used to use this.

So check it out wink.gif

bakr_2k5

This post has been edited by bakr_2k5: Sep 25 2006, 04:02 PM
Go to the top of the page
 
+Quote Post
lorenza pieterse...
post Sep 25 2006, 04:25 PM
Post #8


Newbie [ Level 2 ]
Group Icon

Group: Members
Posts: 13
Joined: 15-September 06
Member No.: 15,955



Thank you all.
So I have to learn the php programming skills first, before I can modify any php files? I thought that there must be an editor like frontpage for php (you cannot open php in frontpage, because it open automatically in notepad) where you can just copy/paste images etc.
Go to the top of the page
 
+Quote Post
pyost
post Sep 26 2006, 09:42 AM
Post #9


Nenad Bozidarevic
Group Icon

Group: [MODERATOR]
Posts: 1,002
Joined: 7-November 05
From: Belgrade, Serbia
Member No.: 9,500



QUOTE(lorenza pietersen @ Sep 25 2006, 06:25 PM) *

So I have to learn the php programming skills first, before I can modify any php files?


Exactly. There are numerous differences between (X)HTML and PHP because of which there's isn't anything like FrontPage for PHP. As already stated, PHP is a server side scripting language - that means that it will only run on a server supporting PHP. Why? Because it uses resources provided by the server. It is more dependant that HTML.

Here's a simple example. In HTML, you must define exactly what you want to be shown, and that's why there is a possibility of using WYSIWYG (what you see is what you get) editors. A single PHP file, however, can output different things in different moments. If it contains a part there generates the current date, the output will change every day, but without changing the code. That isn't possible with HTML.

In order to completely understand this, you really would have to learn at least some basic PHP, as it is a standard nowadays.
Go to the top of the page
 
+Quote Post
minnieadkins
post Sep 27 2006, 12:44 AM
Post #10


Premium Member
Group Icon

Group: Members
Posts: 292
Joined: 15-December 04
Member No.: 1,768



I've heard of a utility called PHP design. I honestly don't know what it is. But yes there's no GUI to help generate your code as some sort of WYSIWIG. If you think about it, it makes sense. In php you have to use logic, where as you just "mark-up" your html to show what you want.

I use notepad++ as well but I've had a few problems out of blank space and indentions. Overall however you can't beat the price.

PHP is parsed by the server so you can't just run it locally on your machine without something to parse it with. First a first time user I suggest installing a bundled webserver, php, and mysql package such as the one's mentioned here.
Go to the top of the page
 
+Quote Post

2 Pages V   1 2 >
Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. How Do I Create And Write To Files?(4)
  2. Online HTML/PHP Editor: Edit File In Browser!(8)
  3. Php : Variables Included Dont Work In Functions(4)
  4. How To Delete Files When Session Ends(4)
  5. Help To Transfer Files Within Hosting Space Using Php(4)
  6. Php File Upload(3)
  7. Reading Files And Folders(1)
  8. How To Protect Included Files(10)
  9. How To Create/edit/delete Ftp Accounts With Php(1)
  10. Magic Quotes And $_files(3)


 



- Lo-Fi Version Time is now: 6th September 2008 - 07:49 AM