PHP - Background Image Only Shows In Safari
I am using the following css
.content { min-height: 850px; color: #CCC; padding-right: 320px; background-image:url(../images/wheelie.png); background-repeat: no-repeat; background-position: right bottom; }however the background image only shows in the desktop version of safari, I have checked firefox and chrome and mobile safari. I can't see why. Similar TutorialsHi I'm using an IP database to correctly (+/-) serve related ads based on country. This seems to work fine BUT when tested on a USA proxy (I'm in the UK) I am getting TWO ads served, one for USA (correctly) and one for the UK (proxy error?). When surfing via proxy from the Netherlands I get no image at all. Looking for somebody to see what I've done wrong he $server = 'localhost'; // MySQL hostname $username = '***'; // MySQL username $password = '***'; // MySQL password $dbname = '***'; // MySQL db name $db = mysql_connect($server, $username, $password) or die(mysql_error()); mysql_select_db($dbname) or die(mysql_error()); $sql = 'SELECT country FROM ip2nation WHERE ip < INET_ATON("'.$_SERVER['REMOTE_ADDR'].'") ORDER BY ip DESC LIMIT 0,1'; list($country) = mysql_fetch_row(mysql_query($sql)); switch ($country) { case 'us': // Image or USA echo '<img src="impact/samsungN210PLUS_usa.jpg">'; case 'uk': // Image for UK echo '<img src="impact/samsungN210PLUS_uk.jpg">'; default: // Image for everybody else (europe) echo '<img src="impact/samsungN210PLUS_europe.jpg">'; end; } echo '<div width="420" class="loc"><span class="loc" align="center">Not from '; $sql = 'SELECT c.country FROM ip2nationCountries c, ip2nation i WHERE i.ip < INET_ATON("'.$_SERVER['REMOTE_ADDR'].'") AND c.code = i.country ORDER BY i.ip DESC LIMIT 0,1'; list($countryName) = mysql_fetch_row(mysql_query($sql)); // Output full country name echo $countryName; $domain = str_replace("www.","", $_SERVER['HTTP_HOST']); echo '? Choose your flag: <a href="http://uk.' .$domain. '"><img src="images/flags/ukflag.gif"></a> <a href="http://usa.' .$domain. '"><img src="images/flags/usaflag.gif"></a> <a href="http://europe.' .$domain. '"><img src="images/flags/euflag.gif"></a></span></div>'; All help appreciated and thanks in advance. PS. The script is working he http://darrenbassett.com/trial if somebody in the USA wishes to check and let me kow if it is a proxy surfing error (seeing BOTH IP's). Not a real website just a 'play' page to get the bones of the script working. I have a page that displays various articles. I would like to show a background image for each article. Let's say I have articles for beaches. I would like to have a beach photo. Airplane article, show airplanes, etc. How can I accomplish this. This topic has been moved to HTML Help. http://www.phpfreaks.com/forums/index.php?topic=319094.0 This creates an image 1500x1500 pixels. But it creates it in black... how can i make it white. And i have to use imagecreatetruecolor() not imagecreate(). <?php $im = imagecreatetruecolor(1500,1500); // Output the image to the browser header('Content-type: image/jpg'); imagejpeg($im); imagedestroy($im); ?> Thanks! This topic has been moved to CSS Help. http://www.phpfreaks.com/forums/index.php?topic=349151.0 Well here is the original code in my script file, and it has a background color Green now: [/php]$article_content = "<center><table style='color: #FFFF31; background: Green; width: 400px; border: 1px solid #9BDDFF;'><tr><td><i><b><u>Welcome to Mysidia City's fishing pool</b></u></i><br><br><br> Before you actually begin your fishing career, I'd strongly recommend you to doublecheck if you have a fishing rod already since it is apparently required for every fisherman here. <br><br><br><a href='fishing.php?act=1'>Enter</a> the fishing pool now if you have a fishing rod already or <br>Visit this <a href='fishingquiz.php'>Page</a> to take the fishing quiz and earn yourself an old rod to begin with. <td></tr></table><br><center><img src='picuploads/other/lakeofrage.png'></center>";[/php] Now I wish to replace the background color with a background image, what should I do? The image url is provided below: http://www.pokemansion.net/picuploads/other/seadrabg.png I was wondering if there is any way to let visitor chose image background of div and store it in session so every page have same background? This topic has been moved to CSS Help. http://www.phpfreaks.com/forums/index.php?topic=355565.0 This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=331191.0 Hello
I am working on a site and the theme is a responsive theme but the header background is not resizing on mobile and tablets below is a link to the site
http://unitednews.sr/category/news/each category / page has a unique header , this is what I have in css for category news body.category-news #header-wrap { background: url( http://unitednews.sr/wp-content/uploads/2014/10/Header_UnitedNews.jpg); background-repeat:no-repeat; }Adding background size: cover does not work any idea ? Edited by crawling, 13 November 2014 - 11:47 AM. Chrome is the browser I use, I have it set up so that the script detects safari and chrome as separate entities. When I browse to it, it shows: You are using Windows XP with a Chrome Web Browserwith a Safari Web Browser now I know stristr() is a case-insensitive version of strstr(), which will find the first form of a word in a string. The problem is that when I use it, the rest of the script doesn't work... it goes to the part as if nothing is there, and shows the text on the bottom. I can't figure out why. Can someone help me, is there a chrome/safari level of priority or am I just missing something? Code: [Select] <?php //Booleans to set OS and Browser to False. $os = false; $browser = false; //Booleans for Web Browser & OS Functions. $xp = xp(); $vista = vista(); $win7 = win7(); $ubuntu = ubuntu(); $chrome = chrome(); $safari = safari(); $firefox = firefox(); $ie9 = ie9(); $ie8 = ie8(); //Operating Systems function xp(){return(preg_match("/Windows NT 5.1/", $_SERVER['HTTP_USER_AGENT']));} function vista(){return(preg_match("/Windows NT 6.0/", $_SERVER['HTTP_USER_AGENT']));} function win7(){return(preg_match("/Windows NT 6.1/", $_SERVER['HTTP_USER_AGENT']));} function ubuntu(){return(preg_match("/Ubuntu/", $_SERVER['HTTP_USER_AGENT']));} //Web Browsers function chrome(){return(preg_match("/Chrome/", $_SERVER['HTTP_USER_AGENT']));} function safari(){return(preg_match("/Safari/", $_SERVER['HTTP_USER_AGENT']));} function firefox(){return(preg_match("/Firefox/", $_SERVER['HTTP_USER_AGENT']));} function ie9(){return(preg_match("/MSIE 9.0/", $_SERVER['HTTP_USER_AGENT']));} function ie8(){return(preg_match("/MSIE 8.0/", $_SERVER['HTTP_USER_AGENT']));} // If you have one of the valid Operating System. if($ubuntu){echo 'You are using Ubuntu Operating System ';} if($xp){echo 'You are using Windows XP ';} if($vista){echo 'You are using Windows Vista Operating System ';} if($win7){echo 'You are using Windows 7 Operating System ';} // If you have one of the valid Web Browser. if($chrome){echo 'with a Chrome Web Browser';} if($firefox){echo 'with an Firefox Web Browser';} if($safari){echo 'with a Safari Web Browser';} if($ie8){echo 'with an Internet Explorer 8 Web Browser';} if($ie9){echo 'with an Internet Explorer 9 Web Browser';} //If OS or Browser not found in list. if ($ubuntu || $xp || $vista || $win7) $os = true; if($firefox || $chrome || $safari || $ie9 || $ie8) $browser = true; if(!$browser || !$os){ echo'<strong>'; echo '<br />' . $_SERVER['HTTP_USER_AGENT'] . '<br /><br />Administrator someone in your work force is using an unsupported browser or OS, please email this information to the developer of the NCMR software you are using. It will allow your browser/OS combination to be used correctly. Sorry for the inconvenience.</strong> <br /><br />Please copy and paste the text above and send it to your web administrator. It will explain everything he/she needs to do.<br />';} ?> I am trying to add a background image via a custom style, but it breaks my site. I am a php novice, can someone point out my error please? The echo is being used other places on this page, so I know this code is ok: <?php echo $event->data->thumbnails['medium']; ?> but I am missing something here, this keeps breaking the page: <?php echo '<article data-style="'.$label_style.'" style="background-image:url(\<?php echo $event->data->thumbnails['medium']; ?>\")" class="mec-event-article mec-clear '.$this->get_event_classes($event).'"' . $colorful_bg_color . '>'; ?> Thanks for any help, as I learn! I am trying to copy an image into another image. Code: [Select] $im = imagecreatefrompng("/oldimg.png"); //this is a semi-transparent image where I want the new image to be copied imagealphablending($im, 1); //this seems to remove the black background header('Content-type: image/png'); //outputs old image with a transparent background (YAY!) imagepng($im); imagecopy($im, $newimage, 32, 0, 0, 0, 32, 32); //I want to replace a part of the old image with a new semi-transparent image header('Content-type: image/png'); //outputs image with a black background (noooooooooo!) imagepng($im); Can anyone help me? I want to get image background removal with core php like(remove.bg website without using any API)
i want to do it with code any guidance how can i do this with programmatically in php. I want to place Custom background image for embedded media player Can anyone help me? This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=347058.0 Hey all. I have a simple code for verifying some data. I have two echos from if statements. The first is if the text input is empty echo: HELLO. The second is if text input data is not found in database echo: NOPE. Now in the following code the second one works fine. But the problem is if I leave the field empty BOTH echos show. So if I leave the input empty instead of saying "HELLO" it says, "HELLONOPE". Yet the second one works fine and display only "NOPE" The other thing is if I switch the two echos to die instead, they work fine. Code: [Select] if (isset($_POST['submit'])) { // if form has been submitted // makes sure they filled it in if(!$_POST['id']) { echo "HELLO"; } // checks it against the database $check = mysql_query("SELECT * FROM emp WHERE id = '".$_POST['id']."'")or die(mysql_error()); //Gives error if user dosen't exist $check2 = mysql_num_rows($check); if ($check2 == 0) { echo "NOPE"; } else { //if login good then redirect them to the members area $id = $_POST['id']; header("Location: somepage.php?id=$id"); } } else { // they are not logged in } <form action="<?php echo $_SERVER['PHP_SELF']?>" method="post"> <input type="text" name="id" maxlength="40"> <input type="submit" name="submit" value="Login"> </form> What am I doing wrong? Hi I have deleted quite lot data from mysql database however, php still shows that page but blank ie page.php?id=186 - this id and all assosiated fields with this id has been removed from mysql but id still showing on the net and google cached all of them ( 600 pages) . page.php is still in use but I was wondering if there is any way not to show these blank pages/ids from mysql db and more importantly how can I remove these blank pages from google? Thanks for your help. I set up the following code to successfully individual items based on the id number. ?id=1 etc. However, I thought it would be simple to change to show another row so I changed all the terms to 'description'. However, if I enter ?description=abcde it shows nothing. But if I type in ?description=description is bizarrely shows everything. The only thing I can only put it down to is numbers. Does $_GET react differently react differently to numbers or does it require commas surrounding the string? <?php if( isset($_GET['description'])) $_GET['description']; $query = "SELECT * FROM productfeed WHERE description = $description LIMIT 0, 10"; $fetchdata = mysql_query($query) or die("query: $query<br>This has an error: " . mysql_error() . '<br>'); while($row = mysql_fetch_array($fetchdata)) { $id = $row['id']; $image = $row['awImage']; $link = $row['link']; $description = $row['description']; $fulldescription = $row['fulldescription']; $price = $row['price']; echo "<div class='productdisplayshell'> <div class='productdisplayoutline'> <div class='productborder'><center> <a href='$link' target='_blank'><img src='$image'/></a> </center> </div></div> <div class='productdescriptionoutline'> <div class='productdescriptionbox'> <a href='$link' target='_blank' >$description</a> </div> <div class='productfulldescriptionbox'>$fulldescription</div> </div> <div class='productpriceoutline'> <div class='productpricebox'> <center>&#163; $price</center> </div> <div class='productbuybutton'> <center><a href='$link' target='_blank' ><img src=/images/buybutton.png /></a></center> </div> </div> </div>"; } ?> I have a database where I have 2 departments, and I want it to not show if they are both taken, but I'm not sure how to do this? Currently I have Code: [Select] $type_sql2 = mssql_query("SELECT * FROM Database2 Where SaleID ='$salesid'"); while($RS2 = mssql_fetch_assoc($type_sql2)) { $used_dist = $RS2['DistID']; $type_sql = mssql_query("SELECT * FROM Database Where Disable = 0 AND DeptID!= '$used_dist'"); while($RS = mssql_fetch_assoc($type_sql)) { $DeptID_ID = $RS['DeptID']; $DeptID_Name = $RS['DeptDescription']; echo "<option value=\"$DeptID_ID\">$DeptID_Name</option>\n"; } }And my DeptID is SE and CM, now in another database where these are used, I want this to not show them if they are both used and only show the one not being used any other time, but I can't just do it one at a time, because I may have more departments later on, but right now, with the above, if one is used, then it works, because only one shows up, but if both are used, it shows both still because it then sees SE and puts in CM, then loops thru again and sees CM and puts in SE then the second time. I hope this makes sence. But how do I not show either if both are used, and if one is used then only show the other? Thanks |