How do you embed HTML tags inside PHP codes?
-
we are divided to tasks, a person handles the back-end using PHP and i handle the interface using HTML and CSS. i have a problem on creating tables inside PHP codes since it is dynamically placing records unorganized, i need to construct tables to organize all data generated from PHP. i'm trying to design PHP-generated records inside a HTML table but i dont know how. NEED HELP PLEASE?
-
Answer:
There are a few options that come to mind... 1. Create an HTML file, then have the php script insert the text from that file as part of the output. 2. You can use print or echo to display HTML. 3. Or, you can print the HTML outside of the PHP tags themselves. Examples: test.html World<BR> page.php <?PHP print "hello "; include ("test.html"); ?> This is a test<BR> <?php echo "The end."; ?> Output: Hello World This is a test The end. In your case, assume your database has the fields: firstname, lastname, phone and that you have defined $firstname, $lastname and $phone to represent them. You can display this as a table with the following: <table> <TR><TD>First Name</TD><TD>Last Name</TD><TD>Phone</TD></TR> <TR><TD><?php print $firstname; ?></TD><TD><?php print $lastname; ?></TD><TD><?php print $phone; ?></TD></TR> </TABLE> In this example, you are using php to insert values within the table itself.
billyBel... at Yahoo! Answers Visit the source
Other answers
<?php echo "put HTML code here and turn double quotes into single quotes or use \" "; ?>
Long
Related Q & A:
- How to convert special tags into html tags?Best solution by Stack Overflow
- How do you embed a picture in an e-mail?Best solution by Yahoo! Answers
- How can I embed a pic inside an email?Best solution by answers.yahoo.com
- How do I embed .srt subtitles on a video if I have a Mac?Best solution by answers.yahoo.com
- How do I embed an image into an email?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.