PHP - Rotation Conflicts Among Web Browsers
I have several images created with a Kodak electronic camera and my iPhone. All images are displayed with the correct orientation (portrait or landscape) in the HTML code. The HTML code is wrapped inside a brief PHP code to enable password entry, and the PHP code is uploaded to my Web site along with the images. I have examined the images on my Web site using Web browsers in Windows 10 and Apple MacBook Air. The orientation is incorrect for at least one of the images in each browser -- Internet Explorer, Firefox, Chrome and Safari. Although a majority of the images are oriented correctly, incorrect rotation occurs for some of the phone and Kodak images. I shall provide more information to anyone who can provide me with help and suggestions, which will be much appreciated. Thank you spruce18b
Similar TutorialsHey, I don't know much PHP yet. I'm trying to write an offer and landing page rotation. This is what I've come up with so far: <?php extract($_REQUEST); //Landing page rotation $counthandle=fopen("lprotation.txt","r"); $getcurrent=fread($counthandle,filesize("lprotation.txt")); switch($getcurrent){ case "lp1": $lp_link = "lp1.php"; $getcurrent = "lp2"; break; case "lp2": $lp_link = "lp2.php"; $getcurrent = "lp1"; break; } fclose($counthandle); $counthandle1=fopen("lprotation.txt","w"); fputs($counthandle1,$getcurrent); fclose($counthandle1); //Offer rotation $counthandle=fopen("offerrotation.txt","r"); $getcurrent=fread($counthandle,filesize("offerrotation.txt")); switch($getcurrent){ case "offer1": $offer = "a Pair of UGG Shoes"; $offer_link = "offer1.php"; $getcurrent = "offer2"; break; case "offer2": $offer = "an Apple iPhone 4"; $offer_link = "offer2.php"; $getcurrent = "offer1"; break; } fclose($counthandle); $counthandle1=fopen("offerrotation.txt","w"); fputs($counthandle1,$getcurrent); fclose($counthandle1); include($lp_link); ?> The problem with this code is that it alternates between lp1+offer1 and lp2+offer2. I can think of several ways to fix this e.g. doubling the offers. offer1 = offer2, offer3 = offer4 and so on...The more offers and lp's I add the more ugly the code gets. I need it to rotate like this: lp1 + offer1, lp2 + offer1, lp1+offer2, lp2+offer2. Can anyone think of a more simple and elegant way to do this? Thanks alot :-) Mathias Hello,
I have some photos that were taken using a cellphone in an upright/vertical position. They were downloaded and placed in a folder to be viewed on a webpage but they displayed horizontally/sideways (with the persons head on the left). I am assuming that the EXIF information in the image tells it which side is up and what the intended 'top' of the picture should be.. I want to have a PHP function that will rotate the image to its intended display position so that photos of mountain ranges [intentionally holding the smartphone sideways] are horizontal and portraits [where the smartphone in upright] are vertical. I placed this code in a PHP file but got no change in the image: function correctImageOrientation($filename) { if (function_exists('exif_read_data')) { $exif = exif_read_data($filename); if($exif && isset($exif['Orientation'])) { $orientation = $exif['Orientation']; if($orientation != 1){ $img = imagecreatefromjpeg($filename); $deg = 0; switch ($orientation) { case 3: $deg = 180; break; case 6: $deg = 270; break; case 8: $deg = 90; break; } if ($deg) { $img = imagerotate($img, $deg, 0); } // then rewrite the rotated image back to the disk as $filename imagejpeg($img, $filename, 95); } } } } $filename = 'upload/myTest.jpg'; correctImageOrientation($filename); Am I using the correct approach to get the desired result? Is the code correct?
Hi! Top Hi If any one has any spare time or is intrigued in any way. I am constructing a website forum like the one you use. This one requires a log on. It works in FF 6.0, Opera Safari and Chrome but not in IE 8.0. I have filled in the passwords(s) extra security. http://www.des-otoole.co.uk/streetangels/ Many thanks if you can work it out. You just need to push the button (login) I'm creating a learning tool where people can paste in information and learn about random subjects.
Ideally for a desktop view eg. widescreen, a browser/search engine is on the left, and the interface is on the right.
So I need to embed a browser, I have tried to embed Google but I think, obviously, that they do not permit that.
I have seen possible alternatives like Chromium or Mozilla not firefox, something else "Gecko?"
Anyway, aside from not knowing what a browser is... for example how else can you access a website without a browser, SSH right? But it's about parsing / interpreting the languages correctly...
So what options do I have? Or should I just optimize the website to be used split screen with a browser in a separate tab? (Currently what I'm doing).
I have a Create new account page. The form is in page named Register.php and once user submit it, it will go to Confirm.php, where it validates the field if everything is correct shows the " Account Created " Message. In Chrome. The error message is shown in Register.php and once all fields are filled then only will show confirm.php. But in Mozilla, it goes to Confirm.php and shows a blank page. My code for Register.php is : Code: [Select] <div class="signup_form"> <form action="confirm.php" method="post" > <?php session_start(); if(isset($_SESSION['error'])) { echo '<p>'.$_SESSION['error']['username'].'</p>'; echo '<p>'.$_SESSION['error']['email'].'</p>'; echo '<p>'.$_SESSION['error']['password'].'</p>'; unset($_SESSION['error']); } ?> <p> <font size="3" face="arial" color="gray"> <label for="username"><b> UserName*</b> </label> </font> <input name="username" type="text" id="username" input style="height:33px" size = "50" size="30"/> </p> <p> <font size="3" face="arial" color="gray"> <label for="email"><b> E-mail Address*</b> </label> </font> <input name="email" type="text" id="email" input style="height:33px" size = "50" size="30"/> </p> <p> <font size="3" face="arial" color="gray"> <label for="password"><b> Password*</b> </label> </font> <input name="password" type="password" id="password" input style="height:33px" size = "50" size="30"/> </p> <p> <input name="submit" type="image" src="images/submit.gif" value="submit"/> </p> </form> </div> and for Confirm.php code is : Code: [Select] <?php session_start(); include('configdb.php'); if(isset($_POST['submit'])) { if($_POST['username'] == '') { $_SESSION['error']['username'] = "User Name is required."; } if($_POST['email'] == '') { $_SESSION['error']['email'] = "E-mail is required."; } else { if(preg_match("/^([a-zA-Z0-9])+([a-zA-Z0-9\._-])*@([a-zA-Z0-9_-])+([a-zA-Z0-9\._-]+)+$/", $_POST['email'])) { $email= $_POST['email']; $sql1 = "SELECT * FROM user WHERE email = '$email'"; $result1 = mysqli_query($mysqli,$sql1) or die(mysqli_error($mysqli)); if (mysqli_num_rows($result1) > 0) { $_SESSION['error']['email'] = "This Email is already used."; } } else { $_SESSION['error']['email'] = "Your email is not valid."; } } if($_POST['password'] == '') { $_SESSION['error']['password'] = "Password is required."; } if(isset($_SESSION['error'])) { header("Location: register.php"); exit; } else { $username = $_POST['username']; $email = $_POST['email']; $password = $_POST['password']; $sql2 = "INSERT INTO users (username, email, password) VALUES ('$username', '$email', '$password')"; $result2 = mysqli_query($mysqli,$sql2) or die(mysqli_error()); if($result2) { echo '<div>Your account is now active. You may now <a href="login.php">Log in</a></div>'; We are trying to capture customer details & redirecting the customer to payment gateway page and, after succesful transaction from payment gateway we are facing a problem for different browsers. Ideally after successful transaction the page should redirect to order confirmation page but it is redirecting to our cart page.In IE7 it is working fine but in mozilla firefox it is redireting to cart page.On analyzing we found that session is not persisting in firefox. Please help we have stuck here Suggest something if you have faced similar issue with different browsers. |