PHP - Touchscreen Css/jquery For Iphone/ipad
Hi Guys,
I have a navigation menu that works great on a desktop however on a mobile or touch screen device the navigation menu doesn't seem to pause when i click on the drop down menu. Any help with a solution to this?
index.php with menu
<div class="header"> <div class="nav"> <ul class="drop-menu"> <li><a class="first current" href="#"><span class="first-border-left"> </span>home</a></li> <li><a href="#" title="About Us">about us</a> <ul> <li><a href="#" title="Latest News">Latest News</a></li> <li><a href="#" title="Why choose us">Why choose us</a></li> <li class="end"><a href="#" title="Mission Statement">Mission Statement</a></li> </ul> </li> <li><a class="last" href="#" title="Contact Us"><span class="first-border-right"> </span>Contact Us</a></li> </ul> </div> </div>css file .header .nav {min-height:58px; position:absolute; top:193px; z-index:6;} .drop-menu { margin:0 0 0 0px; padding:0 0 0 0px; list-style: none; width:940px; font-size:14px; line-height:58px; text-transform:uppercase; } .drop-menu li a { text-decoration:none; color:#fff; font-family:"Trebuchet MS", Arial, Helvetica, sans-serif; width:146px; text-align:center; display:block; border-right:1px solid #616161; background:url(menu-tail.gif) 0 0 repeat-x #0c2362; } .drop-menu li a:hover { color:#fff; background:url(menu-hover.gif) 0 0 repeat-x #0c2362; } .drop-menu li.dropHover a { background:url(menu-hover.gif) 0 0 repeat-x #0c2362; } .drop-menu a.current { color:#3e3e3e; background:url(menu-active.png) 0 0 repeat-x #d8d6d6; border-top:none; } .drop-menu li.dropHover a.current { color:#3e3e3e; background:url(menu-active.png) 0 0 repeat-x #d8d6d6; } .drop-menu ul { position: absolute; top: -999em; background:url(submenu-tail.png) 0 0 repeat !important; } .drop-menu ul li { width: 100%; } .drop-menu li:hover { visibility: inherit; } .drop-menu li { position: relative; background:none; float:left; line-height:58px; height:58px; } .drop-menu li li { font-size:12px; height:40px; line-height:40px; background:url(menu-spacer.gif) center bottom no-repeat; } .drop-menu li .end { border:none; background:none; } .drop-menu li li a { font-family:"Trebuchet MS", Arial, Helvetica, sans-serif; font-weight:bold; color:#fff; line-height:40px; height:40px; width:188px; overflow:hidden; display:block; border:none; background:none !important; } .drop-menu li li li { height:34px; line-height:34px; } .drop-menu li li a:hover, .drop-menu li li.dropHover a { color:#038ee7; } .drop-menu li li li a { height:34px; width:200px; font-size:12px; padding:0; margin:0; color:#fff !important; text-align:center; line-height:34px; border:none; background:url(menu-spacer.gif) center bottom no-repeat; } .drop-menu li li li a:hover { color:#038ee7 !important; } .drop-menu li li li li { height:34px; line-height:34px; } .drop-menu li li li li a { height:34px; width:200px; font-size:12px; padding:0; margin:0; color:#0c2362 !important; text-align:center; line-height:34px; border:none; background:url(menu-spacer.gif) center bottom no-repeat; } .drop-menu li li li li a:hover { color:#038ee7 !important; } .drop-menu a { display: block; position: relative; } .drop-menu li:hover ul, .drop-menu li.dropHover ul { left: -1px; top: 58px; z-index: 99; } ul.drop-menu li:hover li ul, ul.drop-menu li.dropHover li ul { top: -999em; } ul.drop-menu li li:hover ul, ul.drop-menu li li.dropHover ul { left: 188px; top: 0; } ul.drop-menu li li:hover li ul, ul.drop-menu li li.dropHover li ul { top: -999em; } .drop-menu .first { width:84px; border-right:1px solid #616161; position:relative; } .drop-menu .first span.first-border-left { width:6px; height:58px; float:left; background: url(nav_left.png) top left no-repeat; } .drop-menu .last span.first-border-right { width:6px; height:58px; float:right; background: url(nav_right.png) top right no-repeat; } .drop-menu .last { width:120px; border-right:none; position:relative; } Similar TutorialsI have been using some CSS written by Matthew Taylor (www.http://matthewjamestaylor.com), for displaying my web page on iPad orsimilar device. It works in most cases but for some reason it gives strange results when I try to output a table in the main screen area.
It puts the title heading in the right place, but the table for some reason underneath the footer and the page menu disappears completely.
It is usually caused by unclosed div tags, but I have checked them and they appear to be correct.
There is a good explaination of how the CSS works on his web site.
Here is the code for the PHP/HTML:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="generator" content="CoffeeCup HTML Editor (www.coffeecup.com)"> <meta name="dcterms.created" content="Sat, 02 Mar 2013 20:21:23 GMT"> <meta name="description" content=""> <meta name="keywords" content=""> <meta name="viewport" content="width=768px, minium-scale=1.0, maximum-scale=1.0" /> <title></title> <link rel="stylesheet" href="stylesheets/ipad.css" /> <!--[if IE]> <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> </head> <body> <div id="fb-root"> <script>(function(d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/en_GB/all.js#xfbml=1"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk'));</script></div><!--end fb-root--> <div id="wrap"> <!--Start wrap--> <div id="header"> <!--Start header--> <img src="images/Head!.png" width="100%" height="150px" alt="" title="" border="0" /> <h1>1066 cards4U</h1> </div><!-- end header --> <div id="content"> <!--Start content--> <div id="main"> <!--Start main--> <h3>Statistics for <? echo $Country; ?> in 2014</h3> <h4>If only the header is shown, there is no data for this country</h4> <?php include('connect_visits.php'); doDB7(); $limitStart = $_POST['QUARTER'] - 13; $Visit_data="SELECT WeekNo.WNo, WeekNo.WCom, Countries.Country, ctryvisits.CVisits FROM ctryvisits LEFT JOIN Countries ON ctryvisits.country = Countries.CID LEFT JOIN WeekNo ON ctryvisits.WNo=WeekNo.WNo WHERE Countries.CID = '{$_POST['country']}' ORDER BY ctryvisits.WNo LIMIT {$limitStart}, 13"; $Visit_data_res = mysqli_query($mysqli, $Visit_data) or die(mysqli_error($mysqli)); $display_block = " <table width=\"20%\" cellpadding=\"3\" cellspacing=\"1\" border=\"1\" BGCOLOR=\"white\" > <tr> <th>Week No</th> <th>Week Commencing</th> <th>Visits</th> </tr>"; while ($C_info = mysqli_fetch_array($Visit_data_res)) { $Cid = $C_info['WNo']; $Visits = ($C_info['CVisits']); $WeekNo = ($C_info['WCom']); //add to display $display_block .= " <tr> <td width=\"1%\" valign=\"top\">".$Cid."<br/></td> <td width=\"8%\" valign=\"top\">".$WeekNo."<br/></td> <td width=\"5%\" valign=\"top\">".$Visits."<br/></td> </td></tr>"; } mysqli_free_result($Visit_data_res); $CNo2Cty ="SELECT CID, Country FROM Countries WHERE CID='{$_POST['country']}'"; $CNo2Cty_res =mysqli_query($mysqli, $CNo2Cty) or die(mysqli_error($mysqli)); if (mysqli_num_rows($CNo2Cty_res)<1){ $display_block="<p><em>Invalid Country, Please try again</em></p>"; } while ($C_name = mysqli_fetch_array($CNo2Cty_res)) { } mysqli_free_result($CNo2Cty_res); //mysqli_close(mysqli); ?> <?php echo $display_block; ?> <div class="fb-comments" data-href="http://www.1066cards4u.co.uk" data-width="470"></div><br /> <div class="fb-like" data-href="http://www.1066cards4u.co.uk" data-send="true" data-layout="box_count" data-width="300" data-show-faces="true" data-font="arial"></div> <!-- end fb-like --> </div> <!--end main--> <div id="side"> <!--Start side--> <div id="sidea"> <!--Start sidea--> <h3>Main Menu</h3> <p><ul> <li><a href="index1.html">Home</a></li> <li><a href="iLinks.html">Links</a></li> <li><a href="iTechniques.html">Techniques</a></li> <li><a href="iVerse_Menu.html">Verse's</a></li> <li><a href="icontact.html">Contact Us</a></li> <li><a href="iblog.php">Blog</a></li> <li><a href="iAboutUs.html">About Us</a></li> <li><a href="iGallery.html">Gallery</a></li> <li><a href="iStats_Menu.html">Stats</a></li> <li><a href="iRelHol_Menu.html">Religious Holiday's</a></li> <li><a href="iSub_form.html">Subscribe to Newsletter</a></li> </ul></p> </br> </div> <!--end sidea--> <div id="sideb"> <!--Start sideb--> </div> <!--end sideb--> <div id="sidec"> <!--Start sidec--> </div> <!--end sidec--> </div> <!--end side--> </div> <!--end content--> <div id="footer"> <!--Start footer--> <p>© 2012 Content:1066 Cards 4U. All rights reserved. <br /> With thanks to Matt Taylor - matthewjamestaylor.com</p> </div> <!--end footer--> </div> <!--end wrap--> </body> </html>Here is the CSS: * { margin:0; padding:0; } h2 { padding:1em 0 0 0; } p { line-height:1.4em; } p + p { text-indent:2em; } body { font-size:100%; text-align:center; background:#ddd; } pre { display:block; margin:1em 0 0 0; width:488px; } pre code { background:#eee; display:block; padding:10px; } .r { float:right; padding:0 0 10px 20px; } /* Landscape mode (default) */ #wrap { margin:0 auto; width:1024px; position:relative; overflow:hidden; text-align:left; background:#fff; } #header { float:left; width:1024px; padding:10px 0 20px 0; background:#fff; border-bottom:1px solid #000; } #header h1 { padding:10px 30px 0 30px; } #header p { padding:0 30px; line-height:1.4em; } #content { float:left; width:1024px; background:#eee; position:relative; left:768px; } #main { float:left; width:708px; position:relative; right:738px; padding:20px 0; } #side { float:right; width:216px; position:relative; right:788px; padding-bottom:20px; } #sidea, #sideb, #sidec { clear:left; float:left; width:216px; } #footer { clear:both; float:left; width:1024px; border-top:1px solid #000; background:#ddd; } #footer p { padding:20px 30px; } @media only screen and (orientation:portrait){ /* portrait mode */ #header, #wrap, #footer { } #content { left:0; background:#fff; } #main { float:left; width:708px; position:relative; right:0; left:30px; padding:20px 0; } #side { clear:left; float:left; width:768px; right:0; padding-bottom:20px; background:#eee; } #sidea { clear:none; width:216px; float:left; position:relative; left:30px; padding-top:20px; } #sideb { clear:none; width:216px; float:left; position:relative; left:60px; padding-top:20px; } #sidec { clear:none; width:216px; float:right; position:relative; right:30px; padding-top:20px; } #footer { position:absolute; bottom:0; width:100%; height:60px; /* Height of the footer */ background:#6cf; width:768px; } }I have spent hours trying different things, but I can't find a solution. I believe its a CSS problem, but if you think it is HTML can the moderator move it? Your help would be appreciated. http://buildmyweb.org/testing/starter/
at the link above, you can see a test-page. the problem im having is that the content in the footer gets cutoff on the right side of the footer when viewed in an ipad. id love to hear it if anyone can figure out why
here is the html:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <meta name="keywords" content = "Under Construction" /> <meta name="description" content="is currently Under Construction." /> <title>Under Construction</title> <link rel="stylesheet" type="text/css" href="bmw_footer_abs.css" /> </head> <body id="page_home"> <div id="wrapper"> <div id="banner"> </div> <!-- close banner --> <div id="main"> <p> Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. </p> <p> Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. </p> </div> <!-- close main --> </div> <!-- close wrapper --> <div id="footer"> <div id="footer_content"> Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. </div> <!-- close footer_content --> </div> <!-- close footer --> </body> </html>and the css: html { position: relative; min-height: 100%; } body { margin: 0 0 100px; /* bottom = footer height */ } #footer { position: absolute; left: 0; bottom: 0; height: 100px; width: 100%; min-width:1000px; background:gray; } #wrapper { position:relative; top:0px; margin:0 auto; width:1000px; text-align:left; background:pink; padding:0px; } /* **************** BANNER *************** */ #banner { float:left; background:green; width:100%; height:10px; } /* **************** MAIN *************** */ #main { float:left; width:100%; background-color:#f0f3f8; } /* **************** FOOTER *************** */ #footer { font-size:85%; line-height:1.3; } #footer_content { width:1000px; margin:0px auto; background:orange; } My php and MySQL scripting works perfectly, but when someone enters data into the php form, using an iPad with Safari browser, all number entries are inserted into the database table incorrectly. It is still a number entry but the number differs substantially from the original input. Note: All other entries, where the individual selects something from a drop-down list and date selecter works perfectly from the same form. Please help me here, since at least 70% of my employees use iPads, thus I need to find a cure for this problem ASAP. Thanks in advance for any help offered. JayDude Hi, I am new trying to make a simple test iPhone app that reads data from a MySql server via php get method. As a test I used a 'film' database but soon realised that if the get method contains two words '%20' is added to the middle. As a workaround, I tried: if (strpos($_GET['film'], '%20') !==false) $film = str_replace("%20", " ", $_GET['film']; else $_GET[film]=$film; and then appending $film to the end of my sql query. I have tried many variations of this but cannot get it to work! Any advice would be much appreciated. Niall Is it possible to retrieve a visitor's iPhone device id? If so, how? If it's not possible, do all iPhones accept cookies? This topic has been moved to CSS Help. http://www.phpfreaks.com/forums/index.php?topic=347457.0 Hello guys, hope you are doing good. I urgently need your help at a point where I am stuck. I have created this form and applied some css to it. If I am viewing that form using Google Chrome, it looks perfectly fine but when I am viewing it using IE9 or Mozilla or viewing it on my iPhone, the whole border, button etc. gets messed up. Anybody knows how I can fix this so that it looks completely fine no matter if one is viewing it using any browser? The form can be viewed over here http://sigmalogistix.com/index3.php and this is the code: Code: [Select] <html> <head> <title>Login - Sigma Logistics</title> <style type="text/css"> form { padding:5px 450px; } img { padding:20px 521px; } a:link { color:#43759b; text-decoration:underline; } a:visited { color:#43759b; text-decoration:underline; } a:hover { color:#43759b; text-decoration:underline; } a:active { color:#43759b; text-decoration:underline; } a.otherLink:link { color:#43759b; text-decoration:none; } a.otherLink:visited { color:#43759b; text-decoration:none; } a.otherLink:hover { color:#43759b; text-decoration:underline; } a.otherLink:active { color:#43759b; text-decoration:none; } label { width: 12.2em; float: left; text-align: right; margin-right: 0.5em; display: block } .submit input { margin-left: 10.5em; } input { color: #47596e; background: #fee3ad; border: 1px solid #47596e; margin-left: 3.6em } .submit input { color: #000; background: #ffa20f; border: 2px outset #d7b9c9 } fieldset { border: 2px solid #47596e; width: 21em -moz-box-shadow: 0px 5px 12px #cdd0cc; box-shadow: 0px 5px 12px #cdd0cc; } legend { color: black; background: #ffa20c; border: 2px solid #47596e; padding: 2px 6px } </style> </head> <img src="http://sigmalogistix.com/wp-content/uploads/2012/02/Untitled-22.png" /> <form action='login.php' method='POST'> <fieldset> <legend>Track & Trace</legend> <p><label for="username"><font face="Arial" size="2">Username</font></label> <br><input type="text" name="username" size="35" /></p> <p><label for="password"><font face="Arial" size="2">Password</font></label> <br><input type="password" name="password" size="35" /></p> <p class="submit"><input type="submit" value="Log in" /></p> <a href='http://www.sigmalogistix.com'>← <font size="2" face="Arial">Back to Sigma Logistics</font></a> </fieldset> </form> </html> This is how it looks when I view it using Google Chrome 19 (everything's perfect). This is how it looks when I view it using Firefox 12 (notice that the shadow behind the form is misaligned). This is how it looks when I view it using IE9 (everything's misaligned ) And this is on iPhone's Safari browser. Please help me guys, thanks. Hi everybody
I want to put this code (or something like that) in my index.php to redirect the iPhones etc.
But where do I have to put it in? In the head or body?? And how can I call this function?
Thanks a lot for helping a beginner!
function ismobile(){ $useragent = $_SERVER[‘HTTP_USER_AGENT’]; // Standard vendor-model/version user agents if(preg_match(‘/^((ACER¦Alcatel¦AUDIOVOX¦BlackBerry¦CDM¦Ericsson¦LG\b¦LGE¦Motorola¦MOT¦NEC¦Nokia¦Panasonic¦QCI¦SAGEM¦SAMSUNG¦SEC¦Sanyo¦Sendo¦SHARP¦SIE¦SonyEricsson¦Telit¦Telit_mobile_Terminals¦TSM)[- ]?([^\/\s\_]+))(\/(\S+))?/’, $useragent)){ return true; }else{ return false; } } Hello, I have a very big problem with stolen data and i don't know how to STOP that. The situation : I have a website where i spend lot of time to register events and info on events (something like www.CoolEvents.com) Users can log in and then comment events, and do others actions when logged. The PROBLEM : Someone created AN IPHONE APPLICATION that is an EXACT copy of my website, and is name CoolEvent App !!! Same infos, same comments, and you can log in via this app (parsing my site) and post comment on my website ! It's horrible for me, because 40% of my users now used this application (who earn money by displaying advertising). So i losed 40% of visitors !!! Without using legal channels, how can i STOP an IPHONE APP to parse my website or to acces to my website ? Do you know a TECHNICAL solution to prevent an APP to PARSE and then copy my website ? At least, is it possible to made it IMPOSSIBLE to log in to my website (and so be able to post comment on my site) by using this APP ? Thanks for your help !! I tried both of these articles, I have a windows 8.1 tablet and both of the different "codes" worked but I tried my friend's iPhone and the camera viewport is just a black square or doesn't show at all... the problem seems to be that the pop up where you push "allow" or "deny" doesn't show up at all, this makes me think the trigger isn't "triggered".
These are the sites
I'm using HTML5 and Javascript, didn't do much modifcation yet, I just needed the basic web cam access, cropping, saving functions at the moment.
http://davidwalsh.name/browser-camera
http://mycodingtrick...ipt/webcam-api/
How can I recover deleted iphone contacts?
Hey guys I'm using a php based form for my website to take contact information and an attachment from a user and it sends it to my company email address. All the email account information is correct because when I open the message up in Microsoft Outlook I get the information and the attachments. However, when I try to open up the message on my iPhone 4, I just get information with no attachments. I frequently check my email from my iPhone because sometimes I am not able to make it to my computer to use Outlook. I would really like for this to work and would appreciate any help you guys have. Not sure if it is needed but here is the code for the from I use: <?php //turn off error reporting --easily commented out for development, but keeps site visitors from seeing any random thrown errors error_reporting(0); // specify the recipients and subject $to = "test@mywebsite.com"; $subject = "Someone Has Requested A Quote"; //grab all our vars from the form extract($_POST); //build the body of the message from the form $body = " The Quote Requested Name: $fname $lname Company: $company Phone Number: $phone Ext: $phoneext Description: $description Best time to call: $call "; //Let's start our headers $headers = "From:noreply@mywebsite.com\r\n"; //$headers .= "Reply-To:PUT_YOUR_EMAIL_ADDRESS_OR_VARIABLE_HERE\r\n"; $headers .= "MIME-Version: 1.0\n"; $headers .= "Content-Type: multipart/related; type=\"multipart/alternative\"; boundary=\"----=MIME_BOUNDRY_main_message\"\n"; $headers .= "X-Sender:noreply@mywebsite.com\r\n"; $headers .= "X-Mailer: PHP5\n"; $headers .= "X-Priority: 3\n"; //1 = Urgent, 3 = Normal //$headers .= "Return-Path:PUT_YOUR_EMAIL_ADDRESS_OR_VARIABLE_HERE\r\n"; $headers .= "This is a multi-part message in MIME format.\n"; $headers .= "------=MIME_BOUNDRY_main_message \n"; $headers .= "Content-Type: multipart/alternative; boundary=\"----=MIME_BOUNDRY_message_parts\"\n"; $message = "------=MIME_BOUNDRY_message_parts\n"; $message .= "Content-Type: text/plain; charset=\"iso-8859-1\"\n"; $message .= "Content-Transfer-Encoding: quoted-printable\n"; $message .= "\n"; /* Add our message, in this case it's plain text. You could also add HTML by changing the Content-Type to text/html */ $message .= "$body\n"; $message .= "\n"; $message .= "------=MIME_BOUNDRY_message_parts--\n"; $message .= "\n"; /*deal with mulitple attachments */ foreach($_FILES as $file => $value) { $_tmpname = $_FILES[$file]['tmp_name']; $_filename = $_FILES[$file]['name']; if (is_uploaded_file($_tmpname)) { //Do we have a file uploaded? $fp = fopen($_tmpname, "rb"); //Open it $data = fread($fp, filesize($_tmpname)); //Read it $data = chunk_split(base64_encode($data)); //Chunk it up and encode it as base64 so it can emailed $message .= "------=MIME_BOUNDRY_main_message\n"; $message .= "Content-Type: application/octet-stream;\n\tname=\"" . $_filename . "\"\n"; $message .= "Content-Transfer-Encoding: base64\n"; $message .= "Content-Disposition: attachment;\n\tfilename=\"" . $_filename . "\"\n\n"; $message .= $data; //The base64 encoded message $message .= "\n\n"; fclose($fp); } } $message .= "------=MIME_BOUNDRY_main_message--\n"; // set specific SMTP for this message - you may not need this, but I have to manually set the SMTP because it is not localhost ini_set('SMTP','mail.mywebsite.com'); // send message to recipients @mail( $to, $subject, $message, $headers ); // redirect to thank you page after sending email header("Location: http://www.mywebsite.com/quoteComplete.html"); ?> I want to build a online "app builder" project that users can create android / iphone applications online without any coding knowledge. These sites are very common in market. They offer onclick app builder. I have skill in development of web applications using php frameworks. My question is How we can generate android apk from our server after getting the necessary information from user? (Appname, icon, packagename etc) PHP can do this entire task?, if yes any framework for that? Can you give me some basic tips to generate apk from our server? Can we genrate both android and iphone app from one single code? What are the requirements needed for the server? Anybody having skills in these areas, please help me. I need basic tips to get started this project. Thanks Hi,
I have a booking form that displays fine on a desktop and other mobile devices, except on an iPhone 5. Does anyone know what could cause this? I know javascript is working on the iPhone, but not sure why the form isnt displaying.
Thanks
So whether I am uploading an image through my iphone or sending that image to my computer and uploading it from the computer, it has the same effect. If I upload that image, it'll orient the image in landscape mode. Having said that, I found a function that can fix the orient issue. The problem is I don't know the proper way to integrate it into the image upload script. I have tried several different ways but they all give me errors. Can you show me where exactly I should use this function? // IMAGE ORIENTATION function getOrientedImage($imagePath) { $image = imagecreatefromstring(file_get_contents($imagePath)); $exif = exif_read_data($imagePath); if(!empty($exif['Orientation'])) { switch($exif['Orientation']) { case 8: $image = imagerotate($image,90,0); swapHW(); break; case 3: $image = imagerotate($image,180,0); break; case 6: $image = imagerotate($image,-90,0); swapHW(); break; } } return $image; } // IMAGE UPLOAD SCRIPT if(isset($_FILES['fileToUpload']) AND !empty($_FILES['fileToUpload']["name"])) { if(is_uploaded_file($_FILES['fileToUpload']["tmp_name"])) { $target_dir = '../members/images/'.$global_user_id.'/projects/'.$url_project_id.'/'; $target_file = $target_dir . basename($_FILES["fileToUpload"]["name"]); $imageFileType = pathinfo($target_file,PATHINFO_EXTENSION); $source_file = $_FILES["fileToUpload"]["tmp_name"]; $random_name = generateRandomString(10); $new_image = $random_name . '.' . $imageFileType; $resized_image = compressImage($source_file, $new_image, 50); $new_file_path = $target_dir . $resized_image; if(!is_dir($target_dir)){ mkdir($target_dir, 0775, true); } $uploadOk = 1; // Check if image file is a actual image or fake image $check = getimagesize($source_file); if($check !== false) { // echo "File is an image - " . $check["mime"] . "."; $uploadOk = 1; } else { $errors[] = 'File is not an image!'; $uploadOk = 0; } // Check if file already exists if (file_exists($target_file)) { $errors[] = 'Sorry, file already exists!'; $uploadOk = 0; } // Check file size if ($_FILES["fileToUpload"]["size"] > 5000000) { $errors[] = 'Sorry, your file size is bigger than 5mb!'; $uploadOk = 0; } // Allow certain file formats if($imageFileType != "jpg" && $imageFileType != "png" && $imageFileType != "jpeg" && $imageFileType != "gif" && $imageFileType != "JPG" && $imageFileType != "PNG" && $imageFileType != "JPEG" && $imageFileType != "GIF") { $errors[] = 'Sorry, only JPG, JPEG, PNG & GIF files are allowed!'; $uploadOk = 0; } // Check if $uploadOk is set to 0 by an error if($uploadOk == 0) { $errors[] = 'Sorry, your file was not uploaded!'; // if everything is ok, try to upload file } else { if(rename($new_image, $new_file_path)) { echo 'success'; } else { $errors[] = 'Sorry, there was an error uploading your file!'; } } } else { $errors[] = 'You must upload an image!'; } } Edited December 23, 2019 by imgrooot I have a notification system that notifies users of new comments, inside the email I have images, some of the logo, some of different people, everything shows up fine on my computer (yahoo email), however in the iPhones email application no images show up, there are just the blue squares with the question marks in them. I'm not sure what I'm missing. Code: [Select] $from = "Kithell <notifications@kithell.com>"; $headers = "From:" . $from ."\r\n"; $headers .= 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $subject = name($from_id, 'fl').$action; $message = '<html><body> <style>@charset "utf-8"; /* CSS Document */ .e-container { background-color: #FFF;position: relative;width: 90%;min-height:1px;margin-right: auto;margin-left: auto; } .e-container .e-m-header { padding: 2px; background-image: url(http://www.kithell.com/assets/tall-grey-header.png); background-repeat: repeat-x; border: 1px solid #CCC; background-position: bottom; display: block; text-align: center; } .e-container p { font-family: Arial, Helvetica, sans-serif; font-size: 12px; font-weight: normal; color: #666; vertical-align: text-top; display: inline-block; } .e-container .e-usr-photo { display: inline-block; margin: 10px; float: left; background-color: #F4F4F4; } .e-container p a { font-weight: bold; color: #3F60A3; text-decoration: underline; padding: 0px; float: left; margin-top: 0px; margin-right: 5px; margin-bottom: 0px; margin-left: 0px; } .e-container .e-quotes { font-size: 20px; font-weight: bold; color: #999; font-family: Tahoma, Geneva, sans-serif; display: block; padding: 0px; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 75px; margin-top:10px; } .e-container .e-message { font-size: 13px; color: #333; padding: 0px; margin-top: 0px; margin-right: 10px; margin-bottom: 0px; margin-left: 10px; clear: none; display: inline; }</style> <div class="e-container"><div class="e-m-header"><img src="http://www.kithell.com/assets/kithell-logo.png" /></div><img class="e-usr-photo" src="http://www.kithell.com/'.photo($from_id, 55).'" /><br /><p><a target="_blank" href="http://www.kithell.com/#/profile&id='.$from_id.'">'.name($from_id, "fl").' </a> '.$action.'<div class="e-quotes">"<p class="e-message">'.nl2br(htmlentities(stripslashes($message))).'</p>"</div></p></div></body></html>'; mail($to,$subject,$message,$headers); I keep saying I'm going to have to learn javascript and then the library jQuery but find myself learning Swift now instead.
Short one today. I want these two functions to occur back to back. Second function only begins after the first function is complete.
$(function() { $('.tlt').textillate(); }) $(function() { $('.tlt1').textillate(); })If you can please help me with this not only in just code to make that happen but also an explanation of what you did I sure would appreciate it. I've read all morning on promises etc. but have yet to be successful in implementing this. As you can tell I'm using the plug-in textillate to fade text out one letter at a time. Works great! But I have multiple paragraphs I'm wanting to apply this too so I can't make the div class .tlt since I then lose all paragraphs since it's strips it into spans. That would be ideal of course but I think I forced into making different classes for each paragraph. This will become problematic in the future though since the content is generated dynamically and I will have no idea how many paragraphs that dynamic content will contain. So if there was a way to keep my <p> and </p> that would be even better. Thanks! Hi I am in the process of teaching myself web development, coming from a vb and mssql background. I am building a small page that will display my film library, I just want something quick and simple that gets things working. I have three img tags on my page that display the film posters. The current film and the one previous and next. What I would like is a left and a right arrow that just scroll through the library. I am thinking I need to read the sub folder of D:\movies and story the full path name into an array, and then when the user presses a arrow it moves forward or back. Everything is local and I am unsure about how to handle the event of the left/arrow being pressed. Does PHP handle that kind of event or would Jquery be more suitable or something else completely?? thanks for any pointers. Hi All (Again) I am looking to pick up variables in jquery from a string created: function search_by() { var search_term = $('#search_for', $(this).attr('value')); alert(search_term); } I cant seem to get the value i am trying to into a "var". This is the code on the page i am using a onClick="search_by();" i.e: <a class="show_cats" search_cat="PDAs & Accessories" search_for="fire" onclick="search_by();" href="#"> I am trying to get the value inside the "search_for" field. Any ideas???? Im wondering if i should use jQuery or Php. and how about i would go about doing this. Code: [Select] <?php print "<table border=\"0\" cellpadding=\"0\" width=\"100%\" height=\"100\"cellspacing=\"0\" style=\"border-collapse:collapse\"bordercolor=\"grey\" bgcolor=\"white\" valign=\"top\"> <td align=\"left\" width=\"100%\" onclick=\"I3.location.href='getuserdetail.php?prop=$ownerid'\"><b>Property Name</b></td><td><b>Tenant</b></td><td><b>Property Status</b></td><td>Rent Amount</td>"; $connect = mysql_connect("localhost","root",""); mysql_select_db("magic"); $query = "SELECT * FROM props WHERE ownerid = '$ownerid' ORDER BY name ASC "; $result = mysql_query($query); while($row = mysql_fetch_assoc($result)) { $propertyid = $row['propid']; $propertyname = $row['name']; $propertydesc = $row['description']; $propertycity = $row['city']; $propertystate = $row['state']; $propertyzip = $row['zip']; $active = $row['active']; $lease = $row['lease']; $leaseamt = $row['leaseamt']; if($active == "1"){ $propertystatus = "Active"; } else { $propertystatys = "Unknown"; } print"<tr onMouseOver=\"this.bgColor = '#CEE3F6'\" onMouseOut =\"this.bgColor = '#FFFFFF'\"> <td align=\"left\" width=\"25%\" onclick=\"window.open('viewpropdetail.php?prop=$propertyid','mywindow','width=1200,height=600,scrollbars=1')\">$propertyname</td><td>$ownerfirstname $ownerlastname</td><td>$propertystatus</td><td>$$leaseamt</td> "; } print"</td></table>"; ?> Basically i have a link under that is add property. it pops up a box. with a form you fill it out, and it inserts the record into database. What I'm trying to do. is get it to "Refresh" the property list ( ex. code above). so it shows the new property in the table. i have never used jQuery. but was wondering if i could do that with php. Is there a way to say if records are changed.. update? |