Board index   FAQ   Search  
Register  Login
Board index php forum :: HTML CSS

Using CSS When Outputting HTML Through PHP

Questions and tutorials related to Cascading Style Sheets *all versions*

Moderators: macek, egami, gesf

Using CSS When Outputting HTML Through PHP

Postby ehauser » Wed Oct 12, 2011 7:26 am

I have an array in PHP that displays an HTML table with populated data using AJAX. I would like the table that the code displays to be able to pull from my CSS file so it displays correctly on the other page that it loads on. The PHP code that builds the table and displays it on the other page in below...

Code: Select all
// CSS
<?php include 'http://url/web/style.css'; ?>
<?php

// VARIABLE NAMES
$republicordernumber = $_GET['order_nb'];

$dbhost = "";
$dbuser = "";
$dbpass = "";
$dbname = "";
// CONNECT TO MYSQL SERVER
mysql_connect($dbhost, $dbuser, $dbpass);

// SELECT DATABASE
mysql_select_db($dbname) or die(mysql_error());

// BUILD QUERY
$query = "SELECT quantity1, partnumber1, legs1, color1, expstend1, colorcode1, hardware1, specialupright1, esc1, options1, df1, ";
$query .= "top1, back1, bottom1, shelf1, compartment1, upright1, partition1 FROM orderstest WHERE republicordernumber = '$republicordernumber'";

// EXECUTE QUERY
$qry_result = mysql_query($query) or die(mysql_error());

// BUILD RESULT STRING

// HEADER ROW
$display_string = "<table name='partsordered' id='partsordered' width='1000px' class='style3 c5' title='Parts Table'>";
$display_string .= "<tr>";
$display_string .= "<td class='style2'><strong>Qty.</strong></td>";
$display_string .= "<td class='style3 c21'><strong>Part #</strong></td>";
$display_string .= "<td class='style3'><strong>Legs</strong></td>";
$display_string .= "<td class='style3'><strong>Color</strong></td>";
$display_string .= "<td class='style3 c22'><strong>Exp. S.T. END</strong></td>";
$display_string .= "<td class='style3'><strong>C/C</strong></td>";
$display_string .= "<td class='style3'><strong>HDW</strong></td>";
$display_string .= "<td class='style3'><strong>SPL UP</strong></td>";
$display_string .= "<td class='style3'><strong>Esc Y/N</strong></td>";
$display_string .= "<td class='style3'><strong>Opt</strong></td>";
$display_string .= "<td class='style3'><strong>D/F</strong></td>";
$display_string .= "<td class='style3'><strong>Top</strong></td>";
$display_string .= "<td class='style3'><strong>Bak</strong></td>";
$display_string .= "<td class='style3'><strong>Btm</strong></td>";
$display_string .= "<td class='style3'><strong>Shlf</strong></td>";
$display_string .= "<td class='style3'><strong>CD</strong></td>";
$display_string .= "<td class='style3'><strong>Upt</strong></td>";
$display_string .= "<td class='style3'><strong>Ptn</strong></td>";
$display_string .= "</tr>";

// Populate table for each record
while($row = mysql_fetch_array($qry_result)){
   $display_string .= "<tr>";
   $display_string .= "<td class='style3'><input name='quantity1' id='quantity1' type='text' class='c23' size='4' maxlength='4' value='$row[quantity1]' /></td>";
   $display_string .= "<td class='style3'><input name='partnumber1' id='partnumber1' type='text' class='c24' size='7' maxlength='7' value='$row[partnumber1]' /></td>";
   // example of a dropdown instead of text box
   $display_string .= "<td class='style3'><select name='legs1' id='legs1' class='c25' title='Legs Needed?'>";
   $display_string .= "<option value='Y'";
   if ($row[legs1] == "y") $display_string .= " SELECTED";
   $display_string .= ">Yes</option>";
   $display_string .= "<option value='N'";
   if ($row[legs1] == "N") $display_string .= " SELECTED";
   $display_string .= ">No</option>";

   $display_string .= "</select></td>";
   
   
   //$display_string .= "<td class='style3'><input name='legs1' id='legs1' type='text' value='$row[legs1]' /></td>";
   $display_string .= "<td class='style3'><input name='color1' id='color1' class='c25' type='text' value='$row[color1]' /></td>";
   $display_string .= "<td class='style3'><input name='expstend1' id='expstend1' class='c25' type='text' value='$row[expstend1]' /></td>";
   $display_string .= "<td class='style3'><input name='colorcode1' id='colorcode1' class='c26' type='text' value='$row[colorcode1]' /></td>";
   $display_string .= "<td class='style3'><input name='hardware1' id='hardware1' class='c27' type='text' value='$row[hardware1]' /></td>'";
   $display_string .= "<td class='style3'><input name='specialupright1' id='specialupright1' class='c73' type='text' value='$row[specialupright1]' /></td>";
   $display_string .= "<td class='style3'><input name='esc1' id='esc1' class='c25' type='text' value='$row[esc1]' /></td>";
   $display_string .= "<td class='style3'><input name='options1' id='options1' class='c25' type='text' value='$row[options1]' /></td>";
   $display_string .= "<td class='style3'><input name='df1' id='df1' class='c25' type='text' value='$row[df1]' /></td>";
   $display_string .= "<td class='style3'><input name='top1' id='top1' class='c25' type='text' value='$row[top1]' /></td>";
   $display_string .= "<td class='style3'><input name='back1' id='back1' class='c25' type='text' value='$row[back1]' /></td>";
   $display_string .= "<td class='style3'><input name='bottom1' id='bottom1' class='c25' type='text' value='$row[bottom1]' /></td>";
   $display_string .= "<td class='style3'><input name='shelf1' id='shelf1' class='c25' type='text' value='$row[shelf1]' /></td>'";
   $display_string .= "<td class='style3'><input name='compartment1' id='compartment1' class='c25' type='text' value='$row[compartment1]' /></td>";
   $display_string .= "<td class='style3'><input name='upright1' id='upright1' class='c25' type='text' value='$row[upright1]' /></td>";
   $display_string .= "<td class='style3'><input name='partition1' id='partition1' class='c25' type='text' value='$row[partition1]' /></td>";
   $display_string .= "</tr>";
}
$display_string .= "</table>";

// SHOW RESULTS
echo $display_string;

?>
ehauser
New php-forum User
New php-forum User
 
Posts: 39
Joined: Fri Sep 23, 2011 5:02 am
Location: U.S.A.

Re: Using CSS When Outputting HTML Through PHP

Postby Snaek » Tue Jan 01, 2013 9:13 pm

It works for me!

See the thing is, I don't know if you're showing your whole PHP file, but it doesn't matter because I am assuming that all you have is pure PHP code in the file. what you need to do is put the php tags into html tags. like so...

index.php

Code: Select all
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>
<?php
echo "<div id='some_div'></div>";
?>
</body>
</html>


style.css

Code: Select all
#some_div {
   width: 200px;
   height: 50px;
   border: 1px solid #000;
}


And when you run this, the correct output is seen (a box 200px wide and 50px high with a solid black border around it).

Hope this helps! let me know if the problem persists.
Snaek
New php-forum User
New php-forum User
 
Posts: 11
Joined: Sat Dec 29, 2012 6:02 pm

herve leger dress on sale cheapest Herve Leger on

Postby galloway8 » Sun May 12, 2013 6:39 am

I believe that you have heard about how easy for so many guys to herve leger type dresses make money on the internet, particularly eBay. How then the really successful ones quit their jobs, live a life of their dreams, travel all over the world and stay in the finest hotels.
But the fact is, how many of you are doing business on eBay but are struggling? Whether you are struggling with the fact that you are spending too much time in finding products to sell or even struggling with the fact that you are not able make high enough profits. Some of you have been doing business on eBay for so many years; however, you seem to be having a hard time to even reach that herve leger buy powerseller status, let alone making enough money to support yourself.
This article will reveal and tell you the secrets to everything [url=/]herve leger dress cheap[/url] but that.
Why get it from China?
? Cheap labor costs and leniency in environmental aspects have become the ultimate driving force for many manufacturing companies to relocate their operations or manufacturing facilities to China to reduce their production costs.
? We could find countless of wholesalers here in the US. However, they also normally get their merchandise from China. If we got the merchandises from them, that would also mean higher cost. Think about it, these wholesalers would have to bring in the merchandises that they are trying to sell by a container, which means freight costs need to be added as overhead. Once the merchandises arrive in the US, they would have to store it somewhere. That means, storage herve leger kleider costs need to be added as overhead. This list could go on and on and on.
As we all are aware, eBay is a very competitive market. Whoever can sell they products with the lowest price, will have the highest possibility to succeed. The only time where we can sell an item without having to worry about competitions is when scarcity is involved; meaning we sell a product that is high demand, but no one else sells it. To tell you the truth, this scenario is almost impossible to happen.
I have spent hundreds of hours trying to find a wholesaler that can be profitable when I sell their products on eBay. I got to tell you that that was not the easiest thing to do. It?s not even easy to find one wholesaler that can provide me with such product, let alone 2-3 wholesalers or more. I knock off herve leger dress am sure many of you can identify with me. It was not because of I could not find a desired products that I could sell on eBay. Believe me there are thousands in not millions of items that we can sell on eBay that we can find on US wholesalers. The only reason is COST.
Ebay is constantly increasing its fees. In addition, Paypal also takes a big role in cutting a big chunk of your profits. The sad part is, it is almost impossible to be successful on eBay without accepting Paypal payments. This would leave us no choice [url=/]herve leger style dresses cheap[/url] but to find the cheapest products out there so that we can still make big enough profits.
If you have been doing business on eBay and you seem to be stuck with so much time researching valuable products to sell on eBay, then China seems to be the only solution for you to reach that powerseller status. If you are serious about building an eBay empire, then this will probably be the easiest vehicle that you can find out there.

Related articles:


herve leger cheapest Herve Leger on sale (11)

herve leger cheapest Herve Leger on sale (35)

herve leger knock off cheapest Herve Leger on sale
galloway8
New php-forum User
New php-forum User
 
Posts: 200
Joined: Mon Jan 07, 2013 3:36 am

herve leger cheapest Herve Leger on sale (32)

Postby galloway8 » Sun May 12, 2013 7:02 am

If you've ever visited someone whose house smelled of pet odor, you know that the [url=/]herve leger long dresses[/url] first whiff of air you smelled made an impression that you still remember. And if you took off the clothes you wore and found hair all over them, you probably made up your mind not to visit again. If you are a pet lover and your home has pet odor and hair issues, here's a solution that will work.
Even if your house and your pets are meticulous, pet smell, hair, and fur can really make people stand-offish about visiting your home. Even if you clean daily, pet hair and odor are continuous issues, and even when you're not cleaning, these particles and smells are being generated. So the best solution is something that will clean up both these pollutants as fast as they are generated.
The avon herve leger answer is to clean the air with a purifier designed to remove both particulates and odors. Let's deal with the particles first. Not only are fur and hair an issues if you have a warm-blooded pet such as a dog, cat, bunny, bird or ferret, but dander is as well.
The hair and fur are visible, but the dander is not. However, the protein in these small flakes of dead skin is a highly potent allergen and can make your home intolerable for those who are allergic to it. And prolonged exposure to all of these particles can create sensitivity herve leger gossip girl where none previously existed.
The best type of air cleaner for particles is a HEPA (abbreviated as high efficiency particle arresting). To receive this designation, it must be able to remove 99,997 out of every 10,000 airborne particles that are.3 microns or greater. This type of filter easily traps pet hair, dander, and fur as well [url=/]herve leger metallic dress[/url] as other household particles such as dust, dust mites, mold and mildew spores, pollen, bacteria and viruses.
Now let's talk about the odor. Pet odor, particularly urine, can be tenacious and seemingly impossible to control. If you are used to fake herve leger cleaning up after accidents happen, this puts you behind the eight-ball in terms of how your home smells.
And even if you are able to completely clean the area, it will still take a while for the smell to dissipate, and meanwhile the way your home smells is not good.
Again, using an air cleaner that can continuously filter out the pet smells, especially urine, keeps your air smelling fresh all the time, even when mistakes have happened.
Carbon filters are well known for their ability to eliminate gaseous pollutants. A carbon-based filter with an additive especially designed to eliminate pet urine smell is the only solution that you can count on to work.
Since particles and gases are two different types of matter, your air purifier should be able to eliminate both odors and particles. This [url=/]herve leger online shop[/url] means selecting a purifier that contains filters that can remove both.
Using an air purifier that can work 24 hours every day to clean the air means less hair, fur, and dander to clean from surfaces and vacuum from the floor. And it means that each time you open the door to your home you can be confident that your air smells fresh and clean.

Related articles:


herve leger cheapest Herve Leger on sale (10)

herve leger skirt cheapest Herve Leger on sale (40

herve leger cheapest Herve Leger on sale (43)
galloway8
New php-forum User
New php-forum User
 
Posts: 200
Joined: Mon Jan 07, 2013 3:36 am


Return to CSS

Who is online

Users browsing this forum: No registered users and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.