Need help with css in PHP

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
raul_8
Forum Newbie
Posts: 8
Joined: Mon Jun 15, 2009 11:05 am

Need help with css in PHP

Post by raul_8 »

pickle | Please use [ code=php ], [ code=text ], etc tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: :arrow: Posting Code in the Forums to learn how to do it too.


i have no idea how to use css in php
and i have to implement a css in a php page.
following is the php section :

Code: Select all

<?php
 
       //some text
 
    print "<span class=\"input_label\">$label_convert&nbsp;</span>";
    print "<input name=\"a\" class=\"inputbox\" maxlength=\"12\" size=\"5\" autocomplete=\"off\" value=\"$str_a\"><br>";
    select_currency_pulldownmenu($currencies, 'from', $str_from);
    print '<br>';
    print "<span class=\"input_label\">$label_into </span><br>";
 
    select_currency_pulldownmenu($currencies, 'to', $str_to);
    print "<br>";
    if ($data!='') {
        print "<div id=\"currency_converter_result\" align=left style=\"padding-top:4px;padding-bottom:4px\" class=\"result\">$app->v {$_GET['from']} = <b><span $highlight>$data</span> {$_GET['to']}</b></div>";
    }
 
    print "<input type=\"submit\" value=\"$submit_button_label\" class=\"button\">&nbsp;&nbsp;";
    print "<span id=\"loading\"></span>";
?>



------------------------------------------------------------------------

and here is the css code:

Code: Select all

/*  Currency  */
#currency {width:273px; float:left; margin-top:10px; border:1px solid #DFE0E0; background:#fff;}
.currencyHead {width:263px; height:28px; float:left; padding-left:10px; margin:0; background:#fd770c; color:#fff; font-size:16px; font-weight:bold; line-height:28px; vertical-align:middle;}
 
.currencyWrap {float:left; width:263px; padding-left:10px; margin-bottom:5px; background:#fff;}
.currencyWrap label {float:left; display:block; width:45px;  margin-right:5px; padding-top:3px; color:#000; font-size:12px; font-weight:bold}
.fld_currency {float:left; padding:2px 0px; margin-right:5px; background:#fff; color:#000;}
.fld_currency input {width:45px; padding:2px 0 0 3px; float:left; color:#000; font-size:11px;}
.curr_hindden {float:left; width:260px; margin:5px 5px; text-align:center; font-size:14px; font-weight:bold}
.btnCurrency {float:right; padding-right:10px;}

Code: Select all

<!-- curency -->
<div id="currency">
<div class="currencyHead">Currency Converter</div>
        
        <div class="spacer"></div>
<div class="currencyWrap ">
            <label>Convert</label>
  <div class="fld_currency">
                <input type="text" value="001" />
  </div>
            <div class="fld_currency">
                <select>
                    <option>United States Dollar (USD)</option>
              </select>
  </div>                                        
        </div>
        
        <div class="currencyWrap">
            <label>Into </label>
          <div class="fld_currency">
                <select>
                    <option>United States Dollar (USD)</option>
            </select>
          </div>
        </div>
        
        <div class="curr_hindden">
            20 USD = 9555.2000 <span class="blue">INR</span>
    </div>                                    
        
        
        <div class="currencyWrap">
          <div class="btnCurrency">
                <input name="Submit" type="submit" class="submit_blue"  value="Convert"/>
          </div>                                      
         </div>
         
         </div>
<!--  curency -->

pickle | Please use [ code=php ], [ code=text ], etc tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: :arrow: Posting Code in the Forums to learn how to do it too.
Last edited by raul_8 on Wed Jun 17, 2009 9:45 am, edited 2 times in total.
raul_8
Forum Newbie
Posts: 8
Joined: Mon Jun 15, 2009 11:05 am

Re: Need help with css in PHP

Post by raul_8 »

please i really need help in this
mattpointblank
Forum Contributor
Posts: 304
Joined: Tue Dec 23, 2008 6:29 am

Re: Need help with css in PHP

Post by mattpointblank »

You haven't told us what the problem is. Nobody is going to debug your code without knowing what it does/doesn't do properly.
raul_8
Forum Newbie
Posts: 8
Joined: Mon Jun 15, 2009 11:05 am

Re: Need help with css in PHP

Post by raul_8 »

the problem is, i have to apply the styles in php code(given above)
the styles are given in a separate style sheet is give below the PHP code
I'm good in php but don't know anything about css please help :(
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Re: Need help with css in PHP

Post by pickle »

CSS is never, ever applied to PHP code. Your PHP code generates HTML that the browser then renders and applies CSS to.

At first glance, it appears like this is a very simple question. Do a Google for "How to use CSS" - you should get some results telling you how to link a CSS file to an HTML file.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
Post Reply