Jump to content

Search the Community

Showing results for tags 'php'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

  1. Hello ! I don't know how explain my problem but i will try On the user profile, i show birthday, sex, age, height.......... I get all data this way: while($row = mysql_fetch_assoc($MonProfil)) { $sex=$row["sexe"]; ... ... } and i display like that sexe:<?php echo $sex;?> height:<?php echo $height;?> Birthday:<?php echo $birthday;?> And when consulting some user profil, some times the height show nothing.. like a empty string.... if i refresh the page, it appears.... Do you know what is happenning. I am on a dedicated server in linux. And PHP and MYSQL if up to date... thanks a lot!
  2. I have a simple user bio section on my web site. As of right now everything works fine except that the bios are not formatted and I want to remove any html that the user adds. I know that strp_tags is used to remove html but wasn't sure if I could used that along side adding my own html. The html that I am looking to add is <P> and <br> to properly format them. this is the form that I have that <form id="update_profile"> <textarea name="BIO" cols="50" rows="6"><?php echo $bio; ?></textarea><br> <span class="rulemain">Your Favorite drink: </span><br> <input type="text" name="FAV_DRINK" value="<?php echo $fav_drink; ?>" > <br> <input type="radio" name="SHARE_EMAIL" value="1" > <span class="rulesub">Share my email.</span><br> <input type="hidden" name="USER_ID" value="<?php echo $name; ?>"> <input type="submit" value="Update Profile"> </form> Here is what the update string looks like <?php include"scripts/connect.php" ; mysql_connect('localhost',$username,$password); @mysql_select_db($database) or die( "Unable to select database"); $bio= mysql_real_escape_string($_POST['BIO']); $user = mysql_real_escape_string($_POST['USER_ID']); $drink= mysql_real_escape_string($_POST['FAV_DRINK']); $share_email= mysql_real_escape_string($_POST['SHARE_EMAIL]); $error = ''; $userquery = mysql_query("SELECT * FROM user WHERE (username='$user')"); $sql = ("UPDATE user SET bio='$bio', drink='$drink', show_email='$share_email' WHERE username='$user'") or die (mysql_error()); $query = mysql_query($sql);
  3. Hi all,,, i have to hide a column(LOCATION) that may not be seen for user level 3 or below i have like this ID Name Location Sex , , , | | | | | | | | how to do it ,,, any one would like to help me please ??? Thank you ,,,
  4. hai I am testing one of my client site for the integrity against attacks. So i have a form from which they can send the feedback to one of their predefined mail ids. This site was completely done in asp( which i dont know how to code by the way) So i am using php for this purpose. now what doubt i have is that can the form auto submit through code is possible for the asp forms. If yes could some one please help me how to do it. I have checked with the Firebug for the post parameters,it is showing some of the content which i could not able to figure out. POST CONTENTS __EVENTARGUMENT __EVENTTARGET __EVENTVALIDATION /wEWwAQCr7jQnwkCsK/0tAoCtL7JqgYCstrOnggCofjD7gIC0MSjhg0CwKuJ6AEC26v16wECyKvB6wECyKup6AEC3qvJ6wEC4OCV5QsCuOrP4Q8C372vjAwC9N2Bxg4CicGDkwsCzoienwwCo9urzA8Cjbqu3gkCt5jYywYCl/3ztA4C/om+yQwC4on6yQwCjbuqBgK3mIjIBgKJ6sS1AwKr75yLAwLK2+qyCQKqvOofAtPiobIEArqK1aEIAvO2i5YMArChyPAEArChpJ0MAoHH/PYGAvPz5coKAoHHtKMMAtLL3UICgce4owwC7bT71woCgcesowwCnPmhmAwCgcewowwCt+K/rQY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Asvo39ICAsvo29ICAsvo59ICAsvo49ICAsvo79ICAsvo69ICAsvo99ICAsvos9ECAvCkuZIDAuOk9ZEDAvyk9ZEDAv2k9ZEDAv6k9ZEDAv+k9ZEDAvik9ZEDAvmk9ZEDAvqk9ZEDAuuk9ZEDAuSk9ZEDAvyktZIDAvykuZIDAvykvZIDAvykgZIDAvykhZIDAvykiZIDAvykjZIDAvykkZIDAvyk1ZEDAo3am/kGAp7a1/oGAoHa1/oGAoDa1/oGAoPa1/oGAoLa1/oGAoXa1/oGAoTa1/oGAofa1/oGApba1/oGApna1/oGAoHal/kGAoHam/kGAoHan/kGAoHao/kGAoHap/kGAoHaq/kGAoHar/kGAoHas/kGAoHa9/oGAtyfsLkEAs+f/LoEAtCf/LoEAtGf/LoEAtKf/LoEAtOf/LoEAtSf/LoEAtWf/LoEAtaf/LoEAsef/LoEAsif/LoEAtCfvLkEAtCfsLkEAtCftLkEAtCfiLkEAtCfjLkEAtCfgLkEAtCfhLkEAtCfmLkEAtCf3LoEArPD1vkLAqDDmvoLAr/DmvoLAr7DmvoLAr3DmvoLArzDmvoLArvDmvoLArrDmvoLArnDmvoLAqjDmvoLAqfDmvoLAr/D2vkLAr/D1vkLAr/D0vkLAr/D7vkLAr/D6vkLAr/D5vkLAr/D4vkLAr/D/vkLAr/DuvoLApas9BIChay4EQKarLgRApusuBECmKy4EQKZrLgRAp6suBECn6y4EQKcrLgRAo2suBECgqy4EQKarPgSApqs9BICmqzwEgKarMwSApqsyBICmqzEEgKarMASApqs3BICmqyYEQK7wYfPDAK5gco+AtHsltIMArGFitkJAv/3gcwMAoXOuvwBHrJV5h+nkqGwomKGigE8y3SB5TI= __LASTFOCUS __SCROLLPOSITIONX 0 __SCROLLPOSITIONY 342 btnSend.x 49 btnSend.y 18 hiddenInputToUpdateATBuff... 1 international -2 txtComments jhf,mdsnfhkldsnfm,lhdslknhf,dsakf txtFeedEmail test@yd.com txtFullName kjgkjkjh txtMobile 09374093809 ucHeader$domestic -1 ucQuickSearch$UCHotelinIn... 1 ucQuickSearch$UCHotelinIn... 1 ucQuickSearch$UCHotelinIn... 1 ucQuickSearch$UCHotelinIn... 1 ucQuickSearch$UCHotelinIn... 0 ucQuickSearch$UCHotelinIn... -1 ucQuickSearch$UCHotelinIn... -1 ucQuickSearch$UCHotelinIn... -1 ucQuickSearch$UCHotelinIn... 0 ucQuickSearch$UCHotelinIn... -1 ucQuickSearch$UCHotelinIn... -1 ucQuickSearch$UCHotelinIn... -1 ucQuickSearch$UCHotelinIn... 0 ucQuickSearch$UCHotelinIn... -1 ucQuickSearch$UCHotelinIn... -1 ucQuickSearch$UCHotelinIn... -1 ucQuickSearch$UCHotelinIn... 0 ucQuickSearch$UCHotelinIn... -1 ucQuickSearch$UCHotelinIn... -1 ucQuickSearch$UCHotelinIn... -1 ucQuickSearch$UCHotelinIn... 0 ucQuickSearch$UCHotelinIn... 1 ucQuickSearch$UCHotelinIn... ucQuickSearch$UCHotelinIn... ucQuickSearch$UcFixedTour... ucQuickSearch$UcFixedTour... Sep ucQuickSearch$UcFixedTour... 0 ucQuickSearch$UcFixedTour... 2012 ucQuickSearch$UcFixedTour... 0 ucQuickSearch$UcFixedTour... 09/01/2012 ucQuickSearch$UcFixedTour... ucQuickSearch$UcFixedTour... 09/02/2012 ucQuickSearch$UcFixedTour... 09/03/2012 ucQuickSearch$UcFixedTour... 09/04/2012 ucQuickSearch$UcFixedTour... 09/05/2012 ucQuickSearch$UcFixedTour... 09/06/2012 ucQuickSearch$UcFixedTour... 09/07/2012 ucQuickSearch$UcFixedTour... 09/08/2012 ucQuickSearch$UcFixedTour... ucQuickSearch$UcFixedTour... ucQuickSearch$UcFixedTour... ucQuickSearch$UcFixedTour... ucQuickSearch$UcFixedTour... ucQuickSearch$UcFixedTour... ucQuickSearch$UcFixedTour... ucQuickSearch$UcFixedTour... 09/09/2012 ucQuickSearch$UcFixedTour... 09/10/2012 ucQuickSearch$UcFixedTour... 09/11/2012 ucQuickSearch$UcFixedTour... 09/12/2012 ucQuickSearch$UcFixedTour... 09/13/2012 ucQuickSearch$UcFixedTour... 09/14/2012 ucQuickSearch$UcFixedTour... 09/15/2012 ucQuickSearch$UcFixedTour... ucQuickSearch$UcFixedTour... ucQuickSearch$UcFixedTour... ucQuickSearch$UcFixedTour... ucQuickSearch$UcFixedTour... ucQuickSearch$UcFixedTour... ucQuickSearch$UcFixedTour... ucQuickSearch$UcFixedTour... 09/16/2012 ucQuickSearch$UcFixedTour... 09/17/2012 ucQuickSearch$UcFixedTour... 09/18/2012 ucQuickSearch$UcFixedTour... 09/19/2012 ucQuickSearch$UcFixedTour... 09/20/2012 ucQuickSearch$UcFixedTour... 09/21/2012 ucQuickSearch$UcFixedTour... 09/22/2012 ucQuickSearch$UcFixedTour... ucQuickSearch$UcFixedTour... ucQuickSearch$UcFixedTour... ucQuickSearch$UcFixedTour... ucQuickSearch$UcFixedTour... ucQuickSearch$UcFixedTour... ucQuickSearch$UcFixedTour... ucQuickSearch$UcFixedTour... 09/23/2012 ucQuickSearch$UcFixedTour... 09/24/2012 ucQuickSearch$UcFixedTour... 09/25/2012 ucQuickSearch$UcFixedTour... 09/26/2012 ucQuickSearch$UcFixedTour... 09/27/2012 ucQuickSearch$UcFixedTour... 09/28/2012 ucQuickSearch$UcFixedTour... 09/29/2012 ucQuickSearch$UcFixedTour... ucQuickSearch$UcFixedTour... ucQuickSearch$UcFixedTour... ucQuickSearch$UcFixedTour... ucQuickSearch$UcFixedTour... ucQuickSearch$UcFixedTour... ucQuickSearch$UcFixedTour... ucQuickSearch$UcFixedTour... 09/30/2012 ucQuickSearch$UcFixedTour... ucQuickSearch$UcFixedTour... 9/24/2012 5:32:49 PM ucQuickSearch$UcFixedTour... 9/25/2012 5:32:49 PM ucQuickSearch$UcFixedTour... 0 ucQuickSearch$UcFixedTour... September 2012 ucQuickSearch$UcFixedTour... ucQuickSearch$UcFixedTour... ucQuickSearch$UcHotelInSo... 1 ucQuickSearch$UcHotelInSo... 0 ucQuickSearch$UcHotelInSo... 1 ucQuickSearch$UcHotelInSo... ucQuickSearch$UcHotelInSo... ucQuickSearch$UcSpecialTo... ucQuickSearch$UcSpecialTo... Sep ucQuickSearch$UcSpecialTo... 0 ucQuickSearch$UcSpecialTo... 2012 ucQuickSearch$UcSpecialTo... 0 ucQuickSearch$UcSpecialTo... 09/01/2012 ucQuickSearch$UcSpecialTo... 09/02/2012 ucQuickSearch$UcSpecialTo... 09/03/2012 ucQuickSearch$UcSpecialTo... 09/04/2012 ucQuickSearch$UcSpecialTo... 09/05/2012 ucQuickSearch$UcSpecialTo... 09/06/2012 ucQuickSearch$UcSpecialTo... 09/07/2012 ucQuickSearch$UcSpecialTo... 09/08/2012 ucQuickSearch$UcSpecialTo... 09/09/2012 ucQuickSearch$UcSpecialTo... 09/10/2012 ucQuickSearch$UcSpecialTo... 09/11/2012 ucQuickSearch$UcSpecialTo... 09/12/2012 ucQuickSearch$UcSpecialTo... 09/13/2012 ucQuickSearch$UcSpecialTo... 09/14/2012 ucQuickSearch$UcSpecialTo... 09/15/2012 ucQuickSearch$UcSpecialTo... 09/16/2012 ucQuickSearch$UcSpecialTo... 09/17/2012 ucQuickSearch$UcSpecialTo... 09/18/2012 ucQuickSearch$UcSpecialTo... 09/19/2012 ucQuickSearch$UcSpecialTo... 09/20/2012 ucQuickSearch$UcSpecialTo... 09/21/2012 ucQuickSearch$UcSpecialTo... 09/22/2012 ucQuickSearch$UcSpecialTo... 09/23/2012 ucQuickSearch$UcSpecialTo... 09/24/2012 ucQuickSearch$UcSpecialTo... 09/25/2012 ucQuickSearch$UcSpecialTo... 09/26/2012 ucQuickSearch$UcSpecialTo... 09/27/2012 ucQuickSearch$UcSpecialTo... 09/28/2012 ucQuickSearch$UcSpecialTo... 09/29/2012 ucQuickSearch$UcSpecialTo... 09/30/2012 ucQuickSearch$UcSpecialTo... 9/24/2012 5:32:49 PM ucQuickSearch$UcSpecialTo... 9/25/2012 5:32:49 PM ucQuickSearch$UcSpecialTo... 0 ucQuickSearch$UcSpecialTo... September 2012 ucQuickSearch$UcSpecialTo... ucQuickSearch$UcSpecialTo... ucQuickSearch$hdMenuSubTa...
  5. What is the best practice for creating a private message system for... say a forum? I was thinking you just create a Message table, insert all messages into there and other info such as user id, when someone goes to view messages they can only view them based on their corresponding id. But maybe this one table approach isn't the way to go, just looking for suggestions or advice. -thanks!
  6. I am new to Drupal and am attempting to build a custom module to connect to ftp, download a zip file and unzip the file on the server. The zip file contains two product csv files to update price lists on an ecommerce site. I have gotten it worked out to connect, and download the file. But no matter what code I try I cannot seem to get the files extracted. I can get the code working within a separate php file for testing but once I put it in the php and run from the cron tab it refuses to unzip. I am at a loss as to what to try next. I would really appreciate any pointers I could get! These are some of the things I have tried... the closest I have gotten is to have the first csv file within to create and start but it never finishes and the second file never starts. After changing the code so many times I couldn't even begin to tell you what I had when it was able to get that far. $server_file = 'ItemExport.zip'; $shell = "unzip $server_file"; $shell = escapeshellcmd($shell); exec($shell); $zip = new ZipArchive(); if ($zip->open('ItemExport.zip') === TRUE) { for($i = 0; $i < ($zip->numFiles); $i++) { $filename = $zip->getNameIndex($i); $zip->extractTo('.', array(trim($filename))); } $zip->close(); } else { echo 'failed'; } $zip = zip_open("ItemExport.zip"); if ($zip) { while ($zip_entry = zip_read($zip)) { $fp = fopen(zip_entry_name($zip_entry), "w"); if (zip_entry_open($zip, $zip_entry, "r")) { $buf = zip_entry_read($zip_entry, zip_entry_filesize($zip_entry)); fwrite($fp,"$buf"); zip_entry_close($zip_entry); fclose($fp); } } zip_close($zip); } $zip_entry = 'ItemExport.zip'; $file_name = array('StandardExport.csv', 'AmazonExport.csv'); //get the file's size $fileSize = zip_entry_filesize($zip_entry); for($x = 0; $x<2;$x++) { //open the target file $outFile = fopen($file_name[$x],"wb"); while ($fileSize>0) { //read/write only up to 10kb per step $readSize = min($fileSize,10240); //decrease the size of the remaining data to read $fileSize -= $readSize; //get the data $content = zip_entry_read($zip_entry, $readSize); //write the data (if any) if ($content !== false) fwrite($outFile,$content); } fclose($outFile); }
  7. I have a problem in connecting the wampp localhost to sql server , There is a lan network that it`s server is windows server 2008 with sql server 2008 , I want to connect to this sql by php in a client with windows 7 , but when I run mssql_connect function It shows that coudlent connect to this IP , It shows Reply when I ping server IP . Do I have to change anything in wampp or php application in localhost ? It is php 5.3 the latestversion of wampp . Other programmers can connect to this sql by C sharp and Delphi , Only me cant access that by php I use VmWare also , and install windows server 2008 and sql server 2008 , and create network between win7 and windows server by NAT , even in this way I cant access to sql by php , but there is reply in pinging servers IP .
  8. Hi.. A problem in a project that im working. There is a table called 'Images' with image_id, center_id, image_name, image_type. A center will have several images with diffent image type. As well as several images will have with the same image type to a particular center. (Eg: several Adz images will have to one center, Several product images will have to one center.. etc.) My question is I need to select all the images and its type and need to display them in specific locations on the webpage. specific location mean, assume I need to display center logo in upper right corner on the page, adz images in sidebar on the page. Further, I would like to know can I select the all images belong to a particular center in one select query? instead of making defferent defferent select queries in specific location on the website.. Any comments are greatly appriciated. Thank you..
  9. Hello, I am quite new to PHP and MYSQL, I created a login/registration area on my home page. All is working well on the home page, but now I want to make sure that users are logged in before they can access the content of all other pages. Here is the code on the home page: <?php define('INCLUDE_CHECK',true); require 'connect.php'; require 'functions.php'; // Those two files can be included only if INCLUDE_CHECK is defined session_name('tzLogin'); // Starting the session session_set_cookie_params(2*7*24*60*60); // Making the cookie live for 2 weeks session_start(); if($_SESSION['id'] && !isset($_COOKIE['tzRemember']) && !$_SESSION['rememberMe']) { // If you are logged in, but you don't have the tzRemember cookie (browser restart) // and you have not checked the rememberMe checkbox: $_SESSION = array(); session_destroy(); // Destroy the session } if(isset($_GET['logoff'])) { $_SESSION = array(); session_destroy(); header("Location: default.php"); exit; } if($_POST['submit']=='Login') { // Checking whether the Login form has been submitted $err = array(); // Will hold our errors if(!$_POST['username'] || !$_POST['password']) $err[] = 'All the fields must be filled in!'; if(!count($err)) { $_POST['username'] = mysql_real_escape_string($_POST['username']); $_POST['password'] = mysql_real_escape_string($_POST['password']); $_POST['rememberMe'] = (int)$_POST['rememberMe']; // Escaping all input data $row = mysql_fetch_assoc(mysql_query("SELECT id,usr FROM tz_members WHERE usr='{$_POST['username']}' AND pass='".md5($_POST['password'])."'")); if($row['usr']) { // If everything is OK login $_SESSION['usr']=$row['usr']; $_SESSION['id'] = $row['id']; $_SESSION['rememberMe'] = $_POST['rememberMe']; // Store some data in the session setcookie('tzRemember',$_POST['rememberMe']); } else $err[]='Wrong username and/or password!'; } if($err) $_SESSION['msg']['login-err'] = implode('<br />',$err); // Save the error messages in the session header("Location: default.php"); exit; } else if($_POST['submit']=='Register') { // If the Register form has been submitted $err = array(); if(strlen($_POST['username'])<4 || strlen($_POST['username'])>32) { $err[]='Your username must be between 3 and 32 characters!'; } if(preg_match('/[^a-z0-9\-\_\.]+/i',$_POST['username'])) { $err[]='Your username contains invalid characters!'; } if(!checkEmail($_POST['email'])) { $err[]='Your email is not valid!'; } if(!count($err)) { // If there are no errors $pass = substr(md5($_SERVER['REMOTE_ADDR'].microtime().rand(1,100000)),0,6); // Generate a random password $_POST['email'] = mysql_real_escape_string($_POST['email']); $_POST['username'] = mysql_real_escape_string($_POST['username']); // Escape the input data mysql_query(" INSERT INTO tz_members(usr,pass,email,regIP,dt) VALUES( '".$_POST['username']."', '".md5($pass)."', '".$_POST['email']."', '".$_SERVER['REMOTE_ADDR']."', NOW() )"); //The message $username = $_POST['username']; $message = "Hello \n Thank you for registering with us. \n Here are your login details: \n Username: $username \n Password: $pass \n Thank You Administrator www.expatcafe.com ______________________________________________________ THIS IS AN AUTOMATED RESPONSE. ***DO NOT RESPOND TO THIS EMAIL***"; if(mysql_affected_rows($link)==1) { send_mail( 'admin@expatcafe.com', $_POST['email'], 'Registration System - Your New Password', $message); $_SESSION['msg']['reg-success']='We sent you an email with your new password!'; } else $err[]='This username is already taken!'; } if(count($err)) { $_SESSION['msg']['reg-err'] = implode('<br />',$err); } header("Location: default.php"); exit; } How to check if user is logged in on other pages before they can access this info? Thanks a lot.
  10. I have a script that allows for anyone to upload a file to my server using this method move_uploaded_file($_FILES["file"]["tmp_name"], "m/" . $newname); it lets the user select a file for upload and then uploads the file in a directory named "m" once the file upload it provides a link so they can share and anyone can download the file. can I make this safe using .htaccess premissions? I want them to be able to upload and download EXE files but not execute on my server. Thanks for any tips on how to make this safe? Paul
  11. Hi guys, Ok I have been using php 5.4.0 since it's release I have recently updated to php 5.4.7 (I'm using Mountain Lion) I do have everything installed using the default apache web server that came with my mac nice little AMP stack. The default file in my Sites directory is index.php with phpinfo() (http://localhost) will show this file weirdly I see this PHP Version 5.3.15 Last time i checked i was developing on 5.4.7 so the applications i'm now coding doesnt work (due to outdated php) When i check the php version in my terminal i see php version 5.4.7. I'm an idiot when it comes to figuring this out has anyone had the same problem? If so please help Do i have to recompile php as it takes SO long. Thanks guys!
  12. Hi I'm trying to find some code that would tell the bit of code that I created what the device width is so I can make this navigation menu dynamic. Meaning: if the device width is 480px and the navigation menu would come to 1024px then using PHP the code would automatically put the <li> items in to a more tab untill the the width is equal or less than 480px. I don't want to use Javascript to do this as I know most of you will recommend using..... Here's my code. Change the variable $deviceWidth to and refresh.... change between 1 and 10. <? $navItems = array("ME", "MUSIC", "VIDEO", "GIGS", "FESTIVALS", "CONTACT"); $deviceWidth = 3; $diffrence = count($navItems) - $deviceWidth; while($diffrence > 0){ $more[] = array_pop($navItems); $diffrence = $diffrence - 1; } foreach($navItems as $nav){ $lower = strtolower($nav); $upper = strtoupper($nav); $lower1 = strtolower($more); $upper1 = strtoupper($more); echo"<li class='Nav'><a href='$lower.php'>$upper</a></li>"; } if(!empty($more)){ echo"<li class='Nav-more'><a href='#'>MORE</a> <ul class='more'>"; foreach($more as $more){ $lower1 = strtolower($more); $upper1 = strtoupper($more); echo "<li class='Nav-more'><a href='$lower1.php'>$upper1</a></li>"; } echo"</ul> </li>"; } ?> And the CSS to give an example. .Navigation { background-image:url(images/H_BG.png); background-repeat:repeat-x; width:100px; height:50px; } .Nav-bar { background-image:url(images/H_BG.png); background-repeat:repeat-x; width:90%; min-width:700px; _width:700px; font-size:20px; line-height:40px; margin-left:5%; margin-right:5%; height:50px; } ul.Nav { list-style:none; margin:0px; padding:0px; } ul.Nav li { font-weight:20; display:inline; } ul.Nav li a { font-weight:bold; text-decoration: none; float: left; color:#7D7D7D; border-left:1px solid #D1D1D1; padding:5px; padding-left:10px; padding-right:10px; } ul.Nav li a:hover { background-image:url(images/H_BG2.png); background-repeat:repeat-x; font-weight:bold; text-decoration: none; float: left; } ul.more { display:none; } ul.Nav li.Nav-more:hover ul.more { display:block; font-weight:bold; text-decoration: none; float: left; color:#111; border-left:1px solid #0f0; padding:5px; padding-left:10px; padding-right:10px; }
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.