PHP - Fill Remaining Space With Div Width
hey guys thanks for the upcoming support how do I set the blue to fill up the remaining width of the while maininfo div? I tried setting the width:auto
<div class="maininfo"> <div class="large">2</div> <div class="smallblock"> <div class="smalltop">3</div> <div class="small">4</div> </div> <div class="smallblock"> <div class="smalltop">5</div> <div class="small">6</div> </div> </div> .maininfo { width: 600px; } .large { float: left; height: 95px; background-color: blue; width:auto; } .smallblock { float: right; height: 90px; margin: 0 0 0 5px; width: 20%; } .small { background-color: red; height: 50%; width: 100%; } .smalltop { background-color: red; height: 50%; width: 100%; margin-bottom:5px; }Edit fiddle - JSFiddle Similar TutorialsI Have field in my table with max length (10). My data is only (5) characters. ex: "apple" I want to output "apple ". with extra (5) space. Max Length: (10) - (5 characters: apple) = 5 extra white space to be added when outputting fruit. I know can echo it as $row['fruit'] . " "; < == manually, but I want it to be automated based on the number of "max_length" from my field in my table/database. I have this form:
I'm trying to make a code so that it will get the last date and timee it submitted into a database, but for this example I replaced the database loading with a default. I am trying to make it so that it will deisplay how long you must wait until you can vote again, which is every 24hours. $diffrence = strtotime('2010-12-11 10:59:59') - time(); return ("". number_format(($diffrence / 60 / 60), 2) ." hours"); So, lets say the time now is "2010-12-11 20:59:59". 10 hours have passed, so now you have 14 more hours. Hello, Im making a little script to keep track on how much people have currently earnt on my site. I have everything work but i can't figure out how to work out the current balance At the moment ive got: Code: [Select] $currentbalance = $row['totalpaid'] - $row['points']; Which works untill the points becomes more then the total paid then it starts going in minus. Im sure there's a simple fix but i just can't think of a way. Any help would be great. Thanks I have to give credit to user "Psycho" here, who came up with the code I'm using for my Membership Directory. I have even completed all of the code that will allow companies to update their own information in the database when they need to. The last problem I'm having is with my "master" list of members. It is all working with the exception of - I can't get the County heading to show up when the actual County location in the database record is different from the last company. I get the heading properly on the first Company, but after that, even though I know the County data is changing, because I'm echoing out the data as it goes (for testing), and I'm just baffled - I have tried every placement of the IF conditional that I can think of. The current code results can be seen he http://www.nmlta.org..._list-test2.php
I'm sure there is a big clue because my flag that says "Checking County Match" is all occurring before the companies even print out, but I can't find the right change to make in my code, which follows:
// Retrieve ALL the "company" specific data (including contacts) $query = "SELECT company.*, co_contact.cont_name, co_contact.cont_title, co_contact.cont_email FROM company LEFT JOIN co_contact ON company.company_id = co_contact.company_id WHERE company.comp_type = 'Agent' ORDER BY company.comp_county, company.comp_name, co_contact.cont_rank"; $result = $mysqli->query($query) or die($mysqli->error.__LINE__); // Build the $company_array $company_array = array(); while($row = $result->fetch_assoc()) { if(!isset($company_array[$row['company_id']])) { //Add the company specific data here $company_array[$row['company_id']] = array( 'name' => $row['comp_name'], 'uw' => $row['comp_uw'], 'street' => $row['comp_street'], 'pobox' => $row['comp_pobox'], 'csz' => $row['comp_csz'], 'phone' => $row['comp_ph'], 'fax' => $row['comp_fx'], 'web' => $row['comp_web'], 'email' => $row['comp_email'], 'county' => $row['comp_county'], 'branches' => array(), 'br_contacts' => array() ); } //Add the company contact info here $company_array[$row['company_id']]['co_contacts'][] = array( 'name' => $row['cont_name'], 'title' => $row['cont_title'], 'email' => $row['cont_email'] ); } //Run query to get branch info - for ALL companies $query = "SELECT branch.*, br_contact.cont_name, br_contact.cont_title, br_contact.cont_email FROM branch JOIN company ON branch.company_id = company.company_id LEFT JOIN br_contact ON branch.branch_id = br_contact.branch_id WHERE company.comp_type = 'Agent' ORDER BY company.comp_county, branch.br_street, br_contact.cont_rank"; $result = $mysqli->query($query) or die($mysqli->error.__LINE__); //Add branch (and branch contacts) results to $company_array while($row = $result->fetch_assoc()) { $compID = $row['company_id']; $branchID = $row['branch_id']; if(!isset($company_array[$compID]['branches'][$row['branch_id']])) { $company_array[$compID]['branches'][$branchID] = array( 'branch_name' => $row['branch_name'], 'street' => $row['br_street'], 'csz' => $row['br_csz'], 'phone' => $row['br_ph'], 'fax' => $row['br_fx'] ); } $company_array[$compID]['branches'][$branchID]['br_contacts'][] = array( 'name' => $row['cont_name'], 'title' => $row['cont_title'], 'email' => $row['cont_email'] ); } echo "<span class='heading'>"; echo "2014-15 Agent Members of the New Mexico Land Title Association<br><br>"; echo "</span>"; $current_county = 'xxx'; // Start building the table for showing results echo "<table border='1' cellpadding='10' cellspacing='0' style='width:750px; margin-left:100px; margin-bottom:20px'>"; // Begin the "foreach" loop to check for County change foreach($company_array as $company) { echo "<font color='red'>Checking County Match</font><br>\n"; // Enter County IF Statement Here if ($company['county'] != $current_county) { echo "<tr><td><b><font class='county'>"; echo $company['county']," County</font><br><hr></b></td></tr>"; } // Begin the "foreach" loop for rows in the $company_array foreach($company_array as $company) { echo "<tr><td>\n"; $current_county = $company['county']; echo "This company is in $current_county County<br>\n"; echo "<b>{$company['name']}</b><br>\n"; if(!empty($company['uw'])) { echo "<b>{$company['uw']}</b><br>\n";} if(!empty($company['street'])) { echo "{$company['street']}<br>\n";} if(!empty($company['pobox'])) { echo "{$company['pobox']}<br>\n";} echo "{$company['csz']}<br>\n"; echo "{$company['phone']} Fax: {$company['fax']}<br>\n"; if(!empty($company['web'])) { echo "<a href='http://{$company['web']}' target='_blank'>{$company['web']}</a><br>\n";} if(!empty($company['email'])) { echo "Email: <a href='mailto:{$company['email']}'>{$company['email']}</a><br>\n";} // if(!empty($company['county'])) { // echo "Serving <font color='green'>{$company['county']} </font>County<br>\n";} echo "<br>"; foreach($company['co_contacts'] as $co_contact) { if(!empty($co_contact['name'])) { echo "    <b>{$co_contact['name']}</b>, {$co_contact['title']}<br>\n";} if(!empty($co_contact['email'])) { echo "    Email: <a href='mailto:{$co_contact['email']}'>{$co_contact['email']}</a><br>\n";} echo "<br>"; } foreach($company['branches'] as $branch) { echo "    <b>{$branch['branch_name']}</b><br>\n"; echo "    {$branch['street']}<br>\n"; echo "    {$branch['csz']}<br>\n"; echo "    {$branch['phone']} Fax: {$branch['fax']}><br>\n"; if(!empty($branch['email'])) { echo "    Email: <a href='mailto:{$branch['email']}'>{$branch['email']}</a><br>\n";} echo "<br>"; foreach($branch['br_contacts'] as $br_contact) { if(!empty($br_contact['name'])) { echo "        <b>{$br_contact['name']}</b>, {$br_contact['title']}<br>\n";} if(!empty($br_contact['email'])) { echo "        Email: <a href='mailto:{$br_contact['email']}'>{$br_contact['email']}</a><br>\n";} echo "<br>"; } } } echo "</td></tr>\n"; } echo "</table>"; ?>I will greatly appreciate someone pointing out my mistake, which I'm sure is obvious to code gurus - I am just baffled. Thanks! im using this code: PHP Code: [Select] Code: [Select] <?php set_time_limit(0); $file = 'test.mp3'; header('Content-Description: File Transfer'); header("Content-Disposition: attachment; filename=\"$file\""); header('Content-Type: audio-x/mp3'); header('Content-Transfer-Encoding: binary'); header('Content-Length: ' . filesize($file)); header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); header('Pragma: public'); header('Expires: 0'); readfile($file); ?> when downloading i cant see the progress bar. thanks. I have a table with postcodes in it. At some point some of the codes will be entered with spaces (LA12 5TH) and some without (LA17HU) what i need is a function to check if there is a space, if not - count back 3 characters from the end of the string and insert a space. I don't know which string function to use - looked at pad but that seems to be for either end of string and not the middle - any ideas? Any suggestions for using to php to take html form data and fill a pdf form? Anything for cakephp? Thanks hi, i looking for a way to use a auto fill for a inputbox text but all that i found is using a mysql bd. there is any solution using a txt file? stored in server. thanks a lot for your help Hi, I've got a pdf catalog which posts an order to a php form. The idea is that that the php page looks like an order form that the client can check before finally hitting 'submit' (i.e. along the lines of go to shopping cart). I'd like the php page to be editable. Meaning clients can not only look at their echoed order, but change it before committing to it. So the catalog order gets put into a php submit form with editable fields. I've read that others have accomplished this with statements like: Code: [Select] value="<?php echo $clientName; ?>" Which should fill the client name input box on the order form with the posted variable. But it doesn't work properly for me, instead, the form field is filled with "<?xml version=" with the expected name on the line benath the input box and " /> on the line beneath that. Placing the input box declaration entirely within php tags doesn't work either (exactly the same output). Code: [Select] <?php echo ("Name: <input class=\"inputbox\" type=\"text\" name=\"clientName\" maxlength=\"40\" value=\"$clientName\"><br>"); ?> Can anyone help? Steve I have a few questions that deal with cURL. Question #1 Lets say I'm using cURL to fill out a form with multiple pages. Is cURL able to navigate through each page of the form retaining all the previous pages information until I reach the last page, then submit it all without losing any data? Question #2 Lets just say theoretically I was trying to fill out a form with a CAPTCHA (which obviously I can't get past). Is there a way to display the web page with all the other information filled out, and just leave the CAPTCHA blank to be manually inputted? I'm really just looking for yes/no answers, but it would be much appreciated if you are able to point me in the right direction as well! Thanks in advance! I have a form that saves the input data as such: Quote bass inshore offshore Array, regional, mid, 70, 40, 2 x yr, all, fellowship knowledge information learnig, one, one, three, four, one, one, two, three, three, four, TPWD round table discussions conservation biology, the guide talking about fishing the venturi, Jack Ellis and TAG fishing in the East Texas creeks., none at present bass inshore offshore Array, regional, mid, 70, 40, 2 x yr, all, fellowship knowledge information learnig, one, one, three, four, one, one, two, three, three, four, TPWD round table discussions conservation biology, the guide talking about fishing the venturi, Jack Ellis and TAG fishing in the East Texas creeks., none at present bass inshore offshore Array, regional, mid, 70, 40, 2 x yr, all, fellowship knowledge information learnig, one, one, three, four, one, one, two, three, three, four, TPWD round table discussions conservation biology, the guide talking about fishing the venturi, Jack Ellis and TAG fishing in the East Texas creeks., none at present This php program reads it back to the screen as it is writen and as you see it above. Code: [Select] <?php $YourFile = "meeting.survey"; $handle = fopen($YourFile, 'r'); while (!feof($handle)) { $Data = fgets($handle); print $Data; print "<hr>"; } fclose($handle); ?> The code below fails. I feel it is because I am using 'explode' incorrectly. Code: [Select] <?php $YourFile = "meeting.survey"; $handle = fopen($YourFile, 'r'); while (!feof($handle)) { $Data = fgets($handle); $answers = explode(',', $Data); print $answers[0]; print $answers[1]; print $answers[2]; print $answers[3]; print $answers[4]; print $answers[5]; print $answers[6]; print $answers[7]; print $answers[8]; print $answers[9]; print $answers[10]; print $answers[11]; print $answers[12]; print $answers[13]; print $answers[14]; print $answers[15]; print $answers[16]; print $answers[17]; print $answers[18]; print $answers[19]; print $answers[20]; print $answers[21]; print "<hr>"; } fclose($handle); ?> My PHP coding skills are minimal at best, any help, direction, comments you have will be greatly appreciated. If you wish to view the survey html go here If you wish to view the php code used to produce the data, Code: [Select] wget http://texasflyfishers.org/quiz/php_tutorial/survey.php If you wish to view a readback of the data go here Everything I've been able to find over the web, tells me this is what I need to do if I want to add some text that tells what each responce means. Hi All Not sure if this is possible, but I spend loads of time filling in the same form on a 3rd party website when people send me their details to check. Is there any way I am able to build a php script to read and check their details (can do this bit) and then submit them to a form on another website (can't do this bit)? The form is a hotel booking form and is spread over 4 pages. Code: [Select] <?php $var=$_POST["fname"]; $xmlDoc = new DOMDocument(); $xmlDoc->loadXML($var); $root = $xmlDoc->documentElement; $elms = $root->getElementsByTagName("*"); foreach ($elms as $item) { // gets the name and the value of each $item $tag = $item->nodeName; $value = $item->nodeValue; // outputs the $tag and $value echo $tag. ' = '. $value . ''; I want to use the code above to get all the xml files parent and child names and values and get them into the database. is this going to work? thanks in advance I'm trying to get my video to fill the whole of the viewable screen. All I want to be able to see when my site loads is the video and the h1 tag which sits over the bottom of the video - (welcome to website). How can I achieve this please? <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <style type="text/css"> #logo { position: fixed; top: 10px; left:50px; width:140px; height:50px; background-image: url("paper.gif"); z-index:3; } #opacity { width: 100%; height:460px; color: #fff; opacity: 1.0; filter: alpha(opacity=100); /* For IE8 and earlier */ position: absolute: top:225px; } #content { width: 100%; height:800px; background-color:white; color: #black important!; } .low { border: 0 none; display: inline-block; font-size: 80px; padding: 0 20px; line-height: 100px; margin-bottom: 0; margin-top: 15px; text-transform: uppercase; } h1{font-family: Arial, Helvetica, sans-serif;} #space { width:100%; height:355px; } .red {color:red;} html, body { margin:0; padding:0; } #nav { height:70px; width:100%; display: none; position: fixed; background-color:#fff; z-index: 2; } video { width: 100% !important; height: auto !important; visibility:hidden; } #videoclip { position: fixed; z-index: -1; } </style> <script type='text/javascript' src='https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js'></script> <script type='text/javascript'>//<![CDATA[ $(window).load(function(){ $(window).bind("scroll", function() { if ($(this).scrollTop() > 50) { $("#nav").fadeIn(); } else { $("#nav").stop().fadeOut(); } }); });//]]> </script> <script type='text/javascript'> jQuery(document).ready(function(){ /* stop the black video loading box */ delayShow(); }); function delayShow() { var secs = 400; setTimeout('jQuery("video").css("visibility","visible");', secs); } </script> </head> <body> <div id="logo"><img src="http://www.blackdog.london/sites/default/files/bdlogo.png" width="100%" height="100%" alt="Home"></a></div> <div id="nav"></div> <div id="videoclip"> <video autoplay loop> <source src="walking.mp4" type="video/mp4"> <source src="walking.ogg" type="video/ogg"> <source src="walking.mov" type="video/mov"> <img src="frame1.png"/> Your browser does not support the video tag. </video> </div> <div id="opacity"> <div id="space"></div> <h1 class="low">welcome to website</h1> </div> <div id="content"><h1 class="low">content <span class="red">here<span></h1></div> </body> </html> atm i have this in a function: Code: [Select] $returnInfo = array(); $returnInfo["totalWords"] = $totalWords; $returnInfo["uniqueWords"] = count($uniqueWords); $returnInfo["positiveWords"] = $positiveWords; $returnInfo["negativeWords"] = $negativeWords; $returnInfo["rating"] = $mappedrating; return $returnInfo; If i recursive print it it says Array instand of my expected values. p.s., i have found examples where the array get's created in 1 line with all there values but i prefer not to do that since it will be a very long line. Hello everyone I'm very new here but i hope you could help me with a tricky problem I no longer know how to approach it because it's difficult to visalize the solution. Anyway, I have a script that goes to the root of a site (with cURL) and picks up categories (links on the site) via regex. All the links are placed into the big array I have. The first layer (dimension) I've managed to create but the problem comes to when I need my script to delve into deeper dimensions. I want, for each link it finds, go to that page and find those subcategories and place it in my array in the correct subarray. If the regex returns 0 matches, go up one step and go to the next node's site, until the whole big array has been exhausted. Is this possible? Please help out guys and gals. I'll provide more info and code if requested. Hi, I am using this code, what i want is to random fill up stepa field with either option a or option b every time i refresh the page, any help is highly appreciated!:
<form action="myc.php" method="get"> <label for="element_1"> </label> <div> <select class="element select medium" name="stepa"> <option value="" selected="selected"></option> <option value="option a" >Advanced Human option a</option> <option value="option b">Advanced Human Option b</option> </select> </div> <br> <input type="submit"> </form>
I have database that is a list of categories that I would like to insert into a switch statement. This is the only way that I know how to do it right off hand and of course it doesn't work. I've looked on the internet and found examples but they are slightly over my head as ways to do it. Depending on $group which comes from the url a title an h1 would be assigned. Code: [Select] $q = "SELECT * FROM categories"; $r = @mysqli_query ($dbc, $q); switch ($group) { if ($r) { //If $r ran OK while ($row = mysqli_fetch_array($r, MYSQLI_ASSOC)){ case '$row['id_cat']': $h1 = '.$row['group']'; break; } } } Thanks S |