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 > CODE
Reload this Page Just felt like sharing this.

CODE This forum is for posting code snippets and example scripts that aren't quite tutorials, but could be useful for others. You may post code snippets and/or completed scripts that you've written and want to share here.

Advanced Search
6 members in live chat ~  


Closed Thread
 
LinkBack Thread Tools
Old 10-09-2005, 08:23 PM THREAD STARTER               #1 (permalink)
NamePros Regular
Join Date: Jul 2005
Location: U.S.A.
Posts: 655
Coolprogram has a spectacular aura aboutCoolprogram has a spectacular aura about
 



Just felt like sharing this.


PhP is also used in html. You put the HTML codes in but keep it as .php. To make a PHP form or anything else u use html in it. almost no matter what.
-Coolprogram
Coolprogram is offline  
Old 10-10-2005, 02:45 PM   #2 (permalink)
Senior Member
 
Shorty's Avatar
Join Date: Sep 2005
Location: England
Posts: 1,034
Shorty is just really niceShorty is just really niceShorty is just really niceShorty is just really nice
 



Just to clarify what he said:

You need:

Code:
<?php

echo "
<html> 
<!-- any html wanted in here, be careful when using double quotation marks -->
</html>
";

?>
Basically you have to echo the HTML and the browser wont notice the difference. I hope this makes it a little clearer for beginners...
Shorty is offline  
Old 10-10-2005, 03:29 PM   #3 (permalink)
SQLdumpster.com
 
Encenta.com's Avatar
Join Date: Jun 2005
Location: West Sussex, UK
Posts: 579
Encenta.com has a spectacular aura aboutEncenta.com has a spectacular aura about
 




You don't have to echo the HTML. Just as long as the HTML isn't within the PHP code
Encenta.com is offline  
Old 10-11-2005, 06:49 AM   #4 (permalink)
.PJ
NamePros Regular
 
.PJ's Avatar
Join Date: Aug 2004
Posts: 363
.PJ is on a distinguished road
 



Lol he made no sense at all, Thanks for explaining this Shorty, it might be useful to n00bs who are starting PHP /HTML coding.

I knew this back from a while ago anyway (the hard way)

Also, isnt it possible if you use double quotes on the echo that you can use a single quote in the html tags? i.e

echo" <html> <body bgcolor='#000000'>";

something like that.

Also if you want or need to put in a double quote, but dont want to put it outside a php tag, then you can always put a back slash "\" infront of it i.e

echo" <html> <body bgcolor=\"#000000\">";
????: NamePros.com http://www.namepros.com/code/130384-just-felt-like-sharing-this.html

I dont know, but yeah, anyway

PJ
__________________
L33TSig.net
.PJ is offline  
Old 10-11-2005, 07:34 AM   #5 (permalink)
Senior Member
Join Date: Mar 2004
Posts: 1,402
primacomputer is a jewel in the roughprimacomputer is a jewel in the roughprimacomputer is a jewel in the rough
 



You can also write some C code that generates the HTML you want, place that code in a variable in your PHP script, write a C interpretor in PHP that precesses that C code and emails the output to another server where it is served to the user. Just because something can be done doesn't mean it should

On two occasions I've actually fired programmers for doing what's described above; inserting HTML into CGI scripts when they had been told to insert PHP into HTML.
primacomputer is offline  
Old 10-11-2005, 11:52 AM   #6 (permalink)
Senior Member
 
Shorty's Avatar
Join Date: Sep 2005
Location: England
Posts: 1,034
Shorty is just really niceShorty is just really niceShorty is just really niceShorty is just really nice
 



Originally Posted by miseria
You don't have to echo the HTML. Just as long as the HTML isn't within the PHP code
Sometimes it's necessary.
????: NamePros.com http://www.namepros.com/showthread.php?t=130384

And yeah .PJ, you can use \" or ', just never " on it's own. It's not even needed to use quotes at all in most situations, only when there are gaps in the " and " content and I think when validating. I found this all out the hard way too.

When I first started coding/programming with php I went nuts for ages over a simple script that was returning a php error because I was echoing the code and using quotation marks. I guess in the end,you learn by making mistakes. (I'm amazed this simple topic has drawn so much commenting here )
Shorty 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
Internet Sharing Problem rtonia The Break Room 0 09-12-2005 07:53 AM
File Sharing Application Raf The Break Room 6 06-07-2004 08:59 AM
MusicSharing.net Domainut Domains For Sale - Make Offer 13 01-30-2004 08:15 PM

 
All times are GMT -7. The time now is 02:15 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