NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page Newbie PHP Question

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.

Advanced Search
5 members in live chat ~  


Closed Thread
 
LinkBack Thread Tools
Old 12-30-2005, 08:39 AM THREAD STARTER               #1 (permalink)
Senior Member
 
thetzfreak's Avatar
Join Date: Nov 2004
Posts: 1,129
thetzfreak is just really nicethetzfreak is just really nicethetzfreak is just really nicethetzfreak is just really nice
 



Newbie PHP Question


If I just create a .php text file, but don't put in the <? in the beginning, does anything I put in there count as regular html? So basically it's an html file before I put in the <? ? If so, then I can just get a regular html site and just insert some php code where needed?

Thanks - I'm learning
thetzfreak is offline  
Old 12-30-2005, 10:27 AM   #2 (permalink)
Eating Pie
 
iNod's Avatar
Join Date: Nov 2004
Location: Canada
Posts: 2,267
iNod has much to be proud ofiNod has much to be proud ofiNod has much to be proud ofiNod has much to be proud ofiNod has much to be proud ofiNod has much to be proud ofiNod has much to be proud ofiNod has much to be proud ofiNod has much to be proud ofiNod has much to be proud of
 


Special Olympics AIDS/HIV Cystic Fibrosis Save The Children Baby Health Cystic Fibrosis
Yes to the if there is no <? it is regular HTML.

If you put <? ?> in there and the filename ends with .php it auto parsels it as PHP.

iNod.
__________________
I feel old.
iNod is offline  
Old 12-30-2005, 10:29 AM   #3 (permalink)
NamePros Expert
 
Peter's Avatar
Join Date: Nov 2003
Location: Scotland
Posts: 5,074
Peter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond repute
 


Child Abuse Save The Children Save The Children Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009
iNod is correct. If you have no need to have it as a .php file however it is best not to as before it outputs to you it has to go through the php parser because it has php as an extension therefore takes up server resources (not noticeable on a small site but a large 1 will soon have excess activity).
Peter is offline  
Old 12-30-2005, 10:55 AM   #4 (permalink)
NamePros Regular
 
Palyriot's Avatar
Join Date: Jul 2004
Location: Seattle, Wa
Posts: 596
Palyriot is a jewel in the roughPalyriot is a jewel in the roughPalyriot is a jewel in the rough
 



I'll give you a little example.

INDEX.PHP
----------

<html>
<head>
<title>Test</title>
</head>
<body>
<?php echo "Test"; ?>
</body>
</html>

That will work because the file is called index.php.
Now, if you didn't feel like putting any php in there, you can still name it index.php, it just has nothing to parse, so it acts the same as .html. (except in filth's situation).
Palyriot is offline  
Old 12-30-2005, 11:18 AM THREAD STARTER               #5 (permalink)
Senior Member
 
thetzfreak's Avatar
Join Date: Nov 2004
Posts: 1,129
thetzfreak is just really nicethetzfreak is just really nicethetzfreak is just really nicethetzfreak is just really nice
 



Wow, that's cool. Thanks a lot guys! Basically, I can just use a template I made and just insert the small php parts as needed

Thanks!
thetzfreak is offline  
Old 12-30-2005, 12:50 PM   #6 (permalink)
NamePros Regular
 
Palyriot's Avatar
Join Date: Jul 2004
Location: Seattle, Wa
Posts: 596
Palyriot is a jewel in the roughPalyriot is a jewel in the roughPalyriot is a jewel in the rough
 



yep, not a problem.
Palyriot is offline  
Old 12-30-2005, 02:25 PM   #7 (permalink)
NamePros Regular
Join Date: Jul 2005
Location: U.S.A.
Posts: 655
Coolprogram has a spectacular aura aboutCoolprogram has a spectacular aura about
 



<? before yes of course like this?

PHP Code:
<html>
<body bgcolor="black">
<?php
if (code/action)
}
else (
what happens^^)
}
?>
</body>
</html>
I am to lazy to do a code lol
????: NamePros.com http://www.namepros.com/programming/152585-newbie-php-question.html
-coolprogram
Last edited by Coolprogram; 02-12-2006 at 11:12 AM.
Coolprogram is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Tutorial: Getting started with PHP (The Basics) deadserious Webmaster Tutorials 60 11-17-2007 11:35 AM
Great Scripts for Sale With Resale Rights! Zeeble Scripts For Sale 20 01-04-2006 01:39 AM
Googlism - What does google think of you? deadserious The Break Room 55 12-15-2005 09:09 AM

 
All times are GMT -7. The time now is 02:05 PM.

Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger