| | |||||
| ||||||||
| 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. |
![]() |
| | LinkBack | Thread Tools |
| | THREAD STARTER #1 (permalink) |
| NamePros Regular Join Date: Jul 2005 Location: U.S.A.
Posts: 655
![]() ![]() | 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 |
| |
| | #2 (permalink) |
| Senior Member Join Date: Sep 2005 Location: England
Posts: 1,034
![]() ![]() ![]() ![]() | 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> "; ?> |
| |
| | #3 (permalink) |
| SQLdumpster.com Join Date: Jun 2005 Location: West Sussex, UK
Posts: 579
![]() ![]() | You don't have to echo the HTML. Just as long as the HTML isn't within the PHP code
__________________ SQL Dumpster - SQL Database Dumps and Resources |
| |
| | #4 (permalink) |
| NamePros Regular Join Date: Aug 2004
Posts: 363
![]() | 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 |
| |
| | #5 (permalink) |
| Senior Member Join Date: Mar 2004
Posts: 1,402
![]() ![]() ![]() | 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. |
| |
| | #6 (permalink) | ||||
| Senior Member Join Date: Sep 2005 Location: England
Posts: 1,034
![]() ![]() ![]() ![]() |
????: 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 ) | ||||
| |
![]() |
| 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 |