PHP - Moved: Div Borders Equals Height
This topic has been moved to CSS Help.
http://www.phpfreaks.com/forums/index.php?topic=349596.0 Similar TutorialsThis topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=310935.0 Hello all, Just a quick one here, I'm not sure what to put in the quotations of an if statement if I want to say if value equals ANYTHING. Thanks $test = substr_count($_POST['signature'], '>'); $test1 = substr_count($_POST['signature'], '<'); if ($_SESSION['logged_in'] != '1') { static $the_echo = 'You need to be logged in!'; } elseif ($_POST['change_box2'] != 'CHANGE') { static $the_echo = 'You must fill in the "CHANGE" box!'; } elseif ($test != '0') { static $the_echo = 'Contains illegal characters!'; } elseif ($test1 != '0') { static $the_echo = 'Contains illegal characters!'; } } echo $_POST['signature']; echo $test; ?> Those two echos a few lines above (echo $_POST['signature']; and echo $test;) come out to The Little Android and 0 yet it still echos illegal characters...what? i have this code <?php $rulepages = array(); $rulepages[] = array("name" => "1111213", "page" => "fasdd21.php", "id" => "1"); $rulepages[] = array("name" => "41231245152", "page" => "fasd.php", "id" => "2"); ?> <table width="100%"> <tr> <td width="15%"> <?php sort($rulepages); foreach($rulepages AS $rulepage){ echo "<a href=\"?id=".$rulepage["id"]."\">".$rulepage["name"]."</a>"; echo "<br />"; } ?> </td> <td width="80%"> <?php $id = $_GET["id"]; // ?? ?> </td> </tr> </table> what do i do to search the array where the id equals the get ? thanks Hi,
I'm using an example below regarding a whole URL. I'm looking for some conditional PHP that will display certain content depending on if the URL contains the word 'liz' if not, display else.
$host = $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI']; if($host == 'liz-4.website.com') Hi, I have a page on my Intranet which lists a bunch of install files (for example, Microsoft Office), which are stored in the same directory structure as the site itself. I also have a duplicate installs folder structure in another office, on their local server. I want to make it so that the link changes, depending on which office the user is in. To simplify: If (user is in London) display London link else display Blackpool link I've been trying to make it work via IP Address. The IP range in London is 10.44.6.* However, I can't make the script work with a wildcard (it works fine if I put a specific address in). The code I have so far is: Code: [Select] <?php $ip=$_SERVER['REMOTE_ADDR']; if ($ip == '10.44.6.*') { ?><a href="link1.php">Click Here</a><?php } else { ?><a href="link2.php">Click Here</a><?php }; ?> I think it may be an obvious solution, but if some kind person could perhaps point out my mistakes? Thanks, Dave This topic has been moved to HTML Help. http://www.phpfreaks.com/forums/index.php?topic=323045.0 I've been working on my email screen, adding a video to it, and some Css. Which seems to work quite fine. However when the page returns to the original screen (represented by the code 1.) It collapses the video image. Makes it really long horizontally and thin vertically.
If I remove this first piece, showing that the email was sent successfully. if(isset($_GET['Message'])){ echo $_GET['Message']; } It returns to the screen fine and the video looks as it should. Code1:- <?php if(isset($_GET['Message'])){ echo $_GET['Message']; } $uri = $_SERVER['REQUEST_URI']; $uri_dir = getcwd(); ?> <!DOCTYPE html> <html> <head> <link href="/LifeSaverHTML/Details/Database/stylevid2.css" rel="stylesheet" type="text/css"> <h1 class = "titler"> LifeTube </h1> <p></p> </head> <body> <video class = "tube" controls src="examplevid.mp4"> Your browser does not support the video tag. </video> <p></p> <div style="margin: 0 auto; text-align: center"> <a href='/PHPMailer/index.php?id=<?=$uri?>&dire=<?=$uri_dir?>' class="linker">Email Security</a> </div> </body> </html>
I'm using this piece of CSS = Code2. I've set all the defaults padding etc to default for testing. * { margin: 0; padding: 0; } As I say it looks great. Apart from when it returns with the email successful message. The whole thing just deflates.
Code2:- * { margin: 0; padding: 0; } body { background: url('/LifeSaverHTML/Details/Database/backround.jpg') no-repeat center center fixed; height: 100%; background-position: center; background-repeat: no-repeat; background-size: cover; } .tube { display: block; margin: auto; width: 50%; height: 20%; border: 10px solid green; } .button { margin: 0 auto; display:block; text-align: center; } .linker { background-color: #23b83c; border: 2px solid #020353; color: whitesmoke; padding: 1em 1.5em; text-align: center; text-decoration: none; font-size: 1em; display: inline-block; width: 12%; border-radius: 5px; box-shadow: 3px 3px 8px 0 #000; /* h-offset v-offset blur spread color */ } .linker:hover { color: red; } .titler { width: 20%; text-align: center; margin: 0 auto; color: #FFFFFF; border: 5px ridge rgba(124,252,0); border-radius: 36px; background: #232323; text-shadow: 0 0 5px #FFF, 0 0 10px #FFF, 0 0 15px #FFF, 0 0 20px #49ff18, 0 0 30px #49FF18, 0 0 40px #49FF18, 0 0 55px #49FF18, 0 0 75px #49ff18; } nav { width: 80%; margin: 0 auto; } nav ul { list-style: none; overflow: hidden; } nav ul li { float: left; width: 20%; } nav ul li a { text-align: center; padding: 8px 0; display: block; width: 100%; background: #cdeb8e; /* Old browsers */ background: -moz-linear-gradient(top, #cdeb8e 0%, #b0ca34 100%); /* FF3.6+ */ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#cdeb8e), color-stop(100%,#b0ca34)); /* Chrome,Safari4+ */ background: -webkit-linear-gradient(top, #cdeb8e 0%,#b0ca34 100%); /* Chrome10+,Safari5.1+ */ background: -o-linear-gradient(top, #cdeb8e 0%,#b0ca34 100%); /* Opera 11.10+ */ background: linear-gradient(to bottom, #cdeb8e 0%,#b0ca34 100%); /* W3C, IE10+ */ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr=’#cdeb8e’, endColorstr=’#b0ca34′,GradientType=0 ); /* IE6-9 */ } nav ul li a, nav ul li a:focus, nav ul li a:visited, nav ul li a:hover, nav ul li a:active { color: #000; text-decoration: none; } nav ul li a:hover, nav ul li a:active { background: #b0ca34; /* Old browsers */ background: -moz-linear-gradient(top, #b0ca34 0%, #96c40d 100%); /* FF3.6+ */ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#b0ca34), color-stop(100%,#96c40d)); /* Chrome,Safari4+ */ background: -webkit-linear-gradient(top, #b0ca34 0%,#96c40d 100%); /* Chrome10+,Safari5.1+ */ background: -o-linear-gradient(top, #b0ca34 0%,#96c40d 100%); /* Opera 11.10+ */ background: linear-gradient(to bottom, #b0ca34 0%,#96c40d 100%); /* W3C, IE10+ */ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr=’#b0ca34′, endColorstr=’#96c40d’,GradientType=0 ); /* IE6-9 */ } nav ul li:first-child a { border-top-left-radius: 8px; border-bottom-left-radius: 8px; } nav ul li:last-child a { border-top-right-radius: 8px; border-bottom-right-radius: 8px; } Edited February 17, 2020 by JonnyDriller Hi there. How can i set up a maximum width and height of a picture? For example: the limit is 400x400. So if the photo is 200x200 then it stays that way, however if a photo is 550x550 then it gets resized to 400x400. I have a code that will get the value of amount from $_GET, and it adds it to an image I have stored. My problem is the that image I use is 32x32, but I need to add more height to it to make it look correct. The image is transparent so I'd need to keep that also. The code I have now works, but the value of amount is on top of the image where I don't want it to be. Here's my code. <?php header("Content-type: image/png"); $image = $_GET['image'] .'.png'; $img_handler = imageCreateFromPNG("./item images/" . $image); imagesavealpha($img_handler, true); $color = ImageColorAllocate($img_handler, 204, 156, 12); ImageString($img_handler, 2, 0, 0, $_GET['amount'], $color); ImagePng($img_handler); ImageDestroy($img_handler); ?> Hello, im new to css and i need a little help creating a navigation bar which is horizontal, i want it to fill its containing divs height.
here is the simple html
<div id="nav-bar"> <ul> <li>item 1</li> <li>item 2</li> <li>item 3</li> <li>item 4</li> </ul> </div>here is the css being used #nav-bar { background-color: #494c51; width: auto; position: relative; height: 44px; border-style: solid; <!-- background-color: #242528; This is the color of the hover --> border-color: #000; border-width: thin; } #nav-bar ul, li { padding: 0; list-style-type: none; display: inline; line-height: 44px; <!-- this aligns the ul/li into the middle virtically --> height: 44px; border-bottom-color: red; border-style: solid; }so #nav bar has a height of 44px which is working, so i assumed i could set height of #nav-bar ul, li to 100% and it would work, but it doesnt, i have also tried putting these values in a new div but that didnt work either. can anyone help me with this? thanks I have put together a new website and I am having a problem that is frustrating me to no end so I am here looking for expert help.
In my "content" column, I am trying to have the article I have written. This content is going to change from page to page depending on the amount of content. At the bottom of the "content" I am trying to add a comments section.
To the right of the "content" column I have a "sidebar" and the problem I am having is as the "content" column grows or shrinks, it is effecting the positioning of the "sidebar" and moves the content of the "sidebar" up or down.
I have tried to investigate how to correct this and what I have read makes absolutely no sense to me so the only way I can figure out to fix this (keeping in mind that I am in the process of teaching myself CSS and I use the trial and error method of learning) is to set the height of the "content" column to a fixed number and then force the "sidebar" to move up or down by using something like 'margin-top: -1200px". The problem with this is when comments are added, the content of the "sidebar" moves down.
My question is, does anyone know of a way to get both columns to adjust to equal heights that won't cause me to pull what little hair I have left out? Would that anyone be willing to explain to me why your method should work?
I know that I should include the code for the page I am having the problem with, but it is (in my opinion) pretty extensive and if someone is willing to try to tackle this it might be easier to just bring up the source code.
Just FYI . . . the page in question can be seen at http://pickmysmoker....ne_smokers.php/
Thanks in advance . . .
For a college assignment I was required to make a website. It is after getting graded but I would like to continue to at least try to improve my site. One of the problems I had was the height of the sidebars. I solved the problem by using a javascript script, but I am wondering if it can be done with php? i am uploading image to s3 server and by php i am making a copy of that image on server , if i upload an image of 2.3 mb than the width of image is not coming but if i upload less size image like 26kb than it is showing the width of image so it is able to create the copy . here is my code of php : $s3 = new S3(awsAccessKey, awsSecretKey); $thumbId = uniqid(); $thumbId .= ".jpg"; $img = ''; if($imgType == "image/jpeg"){ $img = imagecreatefromjpeg($sourceUrl); }else if($imgType == "image/png"){ $img = imagecreatefrompng($sourceUrl); }else if($imgType == "image/gif"){ $img = imagecreatefromgif($sourceUrl); }else{ $img = imagejpeg($sourceUrl); } echo $width = imagesx( $img ); echo $height = imagesy( $img ); please tell me what is the problem with size of image.. regards rahul What I am working on is a background to a user input comment -- essentially a framed box around the comment. For some reason I cannot fathom but which is probably simple, I can't get the image height variable, (set by the length of the comment) to be seen by the code outputting the framed box. So here's what I got: To set the image position and height variables I put this code inside of a while loop, since there are multiple comments in the DB: Code: [Select] //Looks at the comment in the DB //Calculates the number of lines based on 75 characters per line $line_count = ceil(strlen($row3['comment'] /75)); //This sets the position of the username who posted the comment $username_pos = ($text_pos + ($line_count * 33)) . ".00pt"; //Sets the initial starting position of the framed box on the page $box_pos = $text_pos - 42.00 . ".00pt"; //Sets the height of the framed box $box_ht = $username_pos + 50 . ".00pt"; //Outputs the framed box echo "<img src='images/blue table.gif' style='position:absolute; left:140.00pt; top:$box_pos'; height:$box_ht'; width = 570.00pt; z-index:-1 class='cc01'>"; There is also code outputting the comment and username which seems to work just fine. The result is a pretty box framing the comment, but the outputted image always ends up with the same height, which obviously doesn't work because each comment in the DB can have a different number of lines and would need a different size box. Just to be clear, the source image is much larger than what can be produced by this code. If anyone has any suggestions, I'd really appreciate it. Thanks! Hello everybody, I have a problem with my site I am making.
http://gmann.gflclan.com/index.php (this is a test site, I am not even near close to being done with it).
The problem I am having is, when I make my browser smaller, the navbar body doesn't move down (expand).
#navbar { width:auto; height: 5%; position:relative; background:url(images/transbg4.png); border-radius:15px 15px 0px 0px; box-shadow: 5px 5px 10px #121212; margin-left: 30%; margin-right: 30%; color: white; text-align: left; }There's the code. I think it has to do with "height: 5%;". Do you guys have any idea on how to fix this. I am learning coding, and sorry if this is a "noob" question. Also, if you want, feel free to give suggestions for the site, I already know it looks horrible but I plan on making it better in the future. Here is the navbar in the PHP file I made: <div id="navbar"> <ul id="nav_links"> <?php $query = "SELECT * FROM `navlist` ORDER BY `lorder` ASC"; $result = mysqli_query($db, $query) or die ('Error with the nav list query! Error: ' . mysqli_error($db)); while ($nav = mysqli_fetch_assoc($result)) { echo '<div class="navlink">'; $target = ''; if($nav['newpage'] == 1) { $target = 'target=_blank'; } else { $target = ''; } echo '<li class="nav_button"><a href="' . $nav['link'] . '" ' . $target . '>' . $nav['name'] . '</a></li>'; echo '</div>'; } ?> </ul> </div>Thanks, Gamemann Hi Fellas, having a bit of a brain freeze here, i am trying to set a max width or height for a uploaded image, but my brain has frozen, maybe its the cold weather lol list($width,$height)=getimagesize($uploadedfile); $newwidth=250; $newheight=($height/$width)*$newwidth; $tmp=imagecreatetruecolor($newwidth,$newheight); basicly i want to find the biggest size of an image, beit width or height then set that size to 250... Any pointers here? Hi People. Thanks for all the help on here in the past, you have been brilliant. I run the airfield cards.com website and have a script in the output page that is as follows. Code: [Select] To Embed this Card into your website, cut and paste the following code: <input name="generate" value="<? echo "<iframe src='http://www.airfieldcards.com/php/courtesy_card.php?id=".$id. "' ></iframe>";?>"> Now the way it shows on the site is like this Code: [Select] <iframe src='http://www.airfieldcards.com/php/courtesy_card.php?id=165' ></iframe> So, I look at the iframe code from google that should be cut and pasted into a website (obviously it's working code from google) Code: [Select] <iframe width="700" height="1500" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.co.uk/maps/ms?msa=0&msid=203054009368331462137.0004aa731e7de2e86a0e0&ie=UTF8&t=h&vpsrc=0&ll=53.800651,-4.042969&spn=80.03397,61.435547&z=4&output=embed"></iframe><br /><small>View <a href="http://maps.google.co.uk/maps/ms?msa=0&msid=203054009368331462137.0004aa731e7de2e86a0e0&ie=UTF8&t=h&vpsrc=0&ll=53.800651,-4.042969&spn=80.03397,61.435547&z=4&source=embed" style="color:#0000FF;text-align:left">AirfieldCards.com</a> in a larger map</small> Now I have tried to take the code from the google iframe (width/height/scrolling/etc) and paste it into my source but it doesn't work. Here's how I have done it. Code: [Select] To Embed this Card into your website, cut and paste the following code: <input name="generate" value="<? echo "<iframe width="700" height="1500" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src='http://www.airfieldcards.com/php/courtesy_card.php?id=".$id. "' ></iframe>";?>"> Can someone please modify my fist lot of code so that I have the correct height and width settings (700 x 1500) Thanks in advance Regards Vince Gledhill Hey guys! I have the following php code that grabs variables (and the browsed image) from Flash. //FLASH VARIABLES $Name = $_POST['Name']; $itemNumber = $_POST['itemNumber']; $filename = $_FILES['Filedata']['name']; $filetmpname = $_FILES['Filedata']['tmp_name']; $fileType = $_FILES["Filedata"]["type"]; $fileSizeMB = ($_FILES["Filedata"]["size"] / 1024 / 1000); list($filename, $extension) = explode('.', basename($_FILES['Filedata']['name'])); $filename = $Name; $target = $filename . $itemNumber . "." . $extension; // Place file on server, into the images folder move_uploaded_file($_FILES['Filedata']['tmp_name'], "images/".$target); This works perfect, but what I want to change is the width and height of the uploaded image. Any ideas/suggestions on how this could be done? Thanks in advance!! Cheers! Hi folks, I'm using this code to display a picture that is uploaded in a form. Code: [Select] print "<img src='http://www.coast2kosci.com/mylongrun/test/photo_uploads/$imgx' width='300' height='300' alt='Your photo' />"; At first I tried specifying only the width, without the height. But for tall photos, the display wasn't really what I was after. Then I specified both width and height, which results in a mis-scaled photo. Is there any way that I can specify the height and width atributes as a sort of maximum / or limiter. Ie: If the height is greater than the width, limit the height to 300, and if the width is greater than the height, limit the width to 300? Thanks for your time, Dave |