HTML codes in PHP

Reply

Join Date: Oct 2007
Posts: 178
Reputation: lordx78 is an unknown quantity at this point 
Solved Threads: 2
lordx78's Avatar
lordx78 lordx78 is offline Offline
Junior Poster

HTML codes in PHP

 
0
  #1
Mar 2nd, 2008
Just wanted to ask you guys how to properly call HTML tags into php. e.g.
  1. echo "You are not authenticated. Please login.<br><br>
  2.  
  3. <form method=POST action=admin.php bgcolor=\"C0C0C0\">
  4. username: <input type=text name=\"username\">
  5. password: <input type=password name=\"password\">
  6. <input type=submit>
  7. </form>";

As you can see above, the developer has design a form inside a the PHP inself. Where can I find useful resources on more examples on how to embed HTML into PHP.

*How to to do everything using echo statement

1. Any useful books?
2. Any useful links?
Last edited by lordx78; Mar 2nd, 2008 at 4:23 am.
"I might not be the BEST but I'm not like the REST!"
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 121
Reputation: Auzzie is an unknown quantity at this point 
Solved Threads: 16
Auzzie Auzzie is offline Offline
Junior Poster

Re: HTML codes in PHP

 
0
  #2
Mar 2nd, 2008
that example there is right but if you have alot of HTML it is faster to Not embed HTML in PHP but if you hsve to it is nothing special so you just need to do it the way you have in that example
Reply With Quote Quick reply to this message  
Join Date: Oct 2007
Posts: 178
Reputation: lordx78 is an unknown quantity at this point 
Solved Threads: 2
lordx78's Avatar
lordx78 lordx78 is offline Offline
Junior Poster

Re: HTML codes in PHP

 
0
  #3
Mar 2nd, 2008
This is just an example for the form. Where can I find more similar examples.
"I might not be the BEST but I'm not like the REST!"
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 121
Reputation: Auzzie is an unknown quantity at this point 
Solved Threads: 16
Auzzie Auzzie is offline Offline
Junior Poster

Re: HTML codes in PHP

 
0
  #4
Mar 2nd, 2008
just do it in the same way, write out the HTML tags within an echo and if you need to use a double quote(") or a single quote(if that is how you opened the echo)(') then put a (\) in front of it, you dont need an example
Reply With Quote Quick reply to this message  
Join Date: Apr 2006
Posts: 66
Reputation: silviuks is an unknown quantity at this point 
Solved Threads: 11
silviuks silviuks is offline Offline
Junior Poster in Training

Re: HTML codes in PHP

 
0
  #5
Mar 2nd, 2008
if it helps you:

echo "<p>Here is some text displayed in a paragraph tag </p>";

$str = "<table width='90%' align='center' border='1'>";
$str .= "<tr>";
$str .= "<td>some text here</td>";
$str .= "</tr>";
$str .= "</table>";

echo $str;

PM me if you need more help.
Reply With Quote Quick reply to this message  
Join Date: Apr 2006
Posts: 164
Reputation: orko is an unknown quantity at this point 
Solved Threads: 10
orko orko is offline Offline
Junior Poster

Re: HTML codes in PHP

 
0
  #6
Mar 2nd, 2008
umm.. are you looking for some resource on how to write such authentication script for php? how much is your php programming experience? Depending on that there are different examples online. You may google it with PHP authentication or something similar.
A Perfect World
Reply With Quote Quick reply to this message  
Join Date: Jun 2007
Posts: 1,227
Reputation: kkeith29 has a spectacular aura about kkeith29 has a spectacular aura about kkeith29 has a spectacular aura about 
Solved Threads: 167
kkeith29's Avatar
kkeith29 kkeith29 is offline Offline
Nearly a Posting Virtuoso

Re: HTML codes in PHP

 
0
  #7
Mar 2nd, 2008
i use this code for most of my html in the sites i have developed:

  1. $html =<<<HTML
  2. any html content contained here
  3. HTML;
Reply With Quote Quick reply to this message  
Join Date: Oct 2007
Posts: 178
Reputation: lordx78 is an unknown quantity at this point 
Solved Threads: 2
lordx78's Avatar
lordx78 lordx78 is offline Offline
Junior Poster

Re: HTML codes in PHP

 
0
  #8
Mar 3rd, 2008
Thanks all. I will try to utilize all all above.
"I might not be the BEST but I'm not like the REST!"
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC