LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 11-25-2003, 01:33 AM   #1
Xiangbuilder
Member
 
Registered: Apr 2003
Location: Shandong province China
Distribution: fedora core 1.0
Posts: 206

Rep: Reputation: 30
php save file as ... ...


This is my first time of running php, I am not sure the way is correct.
I find some codes in php's homepage.
Code:
[root@localhost bin]# ./php
<html>
 <head>
  <title>PHP Test</title>
 </head>
 <body>
 <?php echo "<p>Hello World</p>"; ?>
 </body>
</html>
How to save this file as a *.php or *.html file in my harddisk?

Thank you.
 
Old 11-25-2003, 10:35 AM   #2
fr0zen
Member
 
Registered: Nov 2003
Location: 127.0.0.1
Distribution: xubuntu
Posts: 217

Rep: Reputation: 30
PHP is nothing more than code interlaced within HTML. If you've ever worked with HTML, the code is merely just inserted into an ordinary text document. The extension, at this point, is neglible as its just text. However, on a server, if you wish for the code to be parsed it would have to have the extension .php, or whatever the extension is set to for PHP.

Basically, take the code...
Code:
<html>
 <head>
  <title>PHP Test</title>
 </head>
 <body>
 <?php echo "<p>Hello World</p>"; ?>
 </body>
</html>
then, open your preferred raw-text editor, such as Notepad (windows) or Kedit (linux), paste the information into the edit-pane, file->save as, then simply save as "name.php" or whatever you'd like.

You'll probably have to select "All files" in the drop down menu so as to prevent either application from tacking on an extra extension.

HTH
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Mozilla 1.7 - No File Save / File Open dialogs on Slackware 10.0 jayseye Slackware 8 08-10-2004 05:52 AM
PHP-script save on Linux? projecthc Linux - Security 1 07-04-2004 08:22 AM
PHP: save output to a file mikeshn Programming 2 10-25-2003 06:57 AM
save and run php page !!! hitesh_linux Linux - General 2 04-16-2003 03:32 PM
save " in file with php raven Programming 1 03-01-2002 10:32 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:27 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration