PHP - Mobile Devices - Display: None; Does Not Work
As the title says, on any mobile device, display: none; does not work. It will work when the CSS file is cached, however, when you refresh the URL (in any browser this will request a new version of the file) it appears that it will ignore display: none; calls. I tested this on several emulators.
I read somewhere that using both display: none; and visibility: hidden; worked, but I have not seen results for this.
Has anyone come across this before, or know a fix/work-around?
Similar TutorialsThis topic has been moved to HTML Help. http://www.phpfreaks.com/forums/index.php?topic=355495.0 Hello masters. I wish to share with you a problem that is killing me in this dais!! I have a website in xhtml, with some php form. This website is made for Japanese customers (all in Japanese) and that's the big trouble. The language encoding of the php form is really killing me. I tried several solutions, but I couldn't sort this problem. So I was wondering if you guis could help me... This is how it should work: customers fill up the form in Japanese. The php script send the deta to my mail address and to the customer one. Simply and plan. No image, just text ... easy. I tested it on my Japanese computer and it works great: I recive the mail, the customer recive the mail and all the field are ok and I can read all the Japanese charachters. The big troubles come out when I try to fill up the form with a Japanese mobile device: Both the customer and me recive a mail with weird characters. something like this: ..????i???.... and so on....damn, I can't understand why. The most weird thing is that it really works great on computer browser. But as this is a website for mobile devices I have no choice but to settle this. Here is part of the code I use for the form: <?php // I set the page encoding to EUC-JP and set the Japanese language mb_language("ja"); mb_internal_encoding("EUC-JP"); // Declare $ $EmailFrom = Trim(stripslashes($_POST['EmailFrom'])); $EmailTo = "orders@mobile-body-ex.com"; $Subject = "Body-ex Cellphone Order"; $Nome = Trim(stripslashes($_POST['Nome'])); $Cognome = Trim(stripslashes($_POST['Cognome'])); $Postal = Trim(stripslashes($_POST['Postal'])); $Address = Trim(stripslashes($_POST['Address'])); $Number = Trim(stripslashes($_POST['Number'])); .... // validation $validationOK=true; if (Trim($EmailFrom)=="") $validationOK=false; if (!$validationOK) { print "<meta http-equiv=\"refresh\" content=\"0;URL=error.xhtml\">"; exit; } // prepare email body text $Body = "モバイルサイトから注文受けました: Angel スリーラウンドペンダント AD-0011 Booking Form;"; $Body .= "名前: "; $Body .= $Nome; $Body .= "\n"; $Body .= "名前(フリガナ): "; $Body .= $Cognome; $Body .= "\n"; $Body .= "郵便番号: "; $Body .= $Postal; $Body .= "\n"; $Body .= "住所: "; ..... // send email $success = mb_send_mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>"); .....Follow the second mail directed to the customer email address. ps: モバ are Japanese characters... Both the html page with the form and the php page are set to EUC-JP (charset="euc-jp"). What should I do to make this work properly? I repeat that it actually works on the net if you use a computer browser (try to see at http://www.mobile-body-ex.com/ora1.html). But I couldn't find a way to make it works if you fill up the form trough a browser for mobile devices (Japanese). ......please, give me some hint Thank you everybody! Some of you may have seen one of my many posts about email issues. Some users don't get them, and I have determined it is probably because we are marked as spam.
We are a service that grades sales team members on their phone skills. Listening to pre-recorded calls, grading and uploading them to our site, and then another part of our business looks them over and sometimes leaves a message that then get's forwarded to this persons work email.
I have determined there is ways to get marked as spam as default by not having an opt out link. This is not an option, these sales members employer has opted in, and the emails are going to work related accounts hosted at that employer. Also, if one of these staff members is not so bright, or disgruntled they may mark us as spam anyways. The bottom line is that we have very little control over whether we are or are not marked as spam.
So we want to start looking into sending text messages and this is where I start to question how good of an idea this is.
First off, if it was me, and the messages where being sent to a device that my employer did not provide, I would in no way want work related text messages coming to me. Unless there is a vested interest in getting them. IE, I'm the boss at this place and am always on the clock. What if you are on the bottom? It's just a job for you.
What if it is a pre-paid device, text messages cost money. What then? What if they don't even have, or want a cell phone?
The short of it is this. If I'm at a job that is just another job, and this employer tells me that I have to get these messages. I'm going to look for another job. I see the organizations having continuous issues and complaints from their employees. Thus us as a business having issues keeping clients.
What am I getting into here? What are your opinions on this matter? What are your recommendations as to alerting users of something on our site that we can rest assured are being received 100% of the time?
Thanks!
Nick
I came up with the following script for displaying an uploaded picture on a webpage but for some reason I can't pinpoint, the picture won't be displayed. I checked my database from php myadmin and sure enough, the picture was successfully uploaded but somehow, the picture won't be displayed. So here is the display script. I named it display_pic.php Code: [Select] <?php //address error handling ini_set ('display_errors', 1); error_reporting (E_ALL & ~E_NOTICE); //authenticate user //Start session session_start(); //Connect to database require ('config.php'); //address error handling ini_set ('display_errors', 1); error_reporting (E_ALL & ~E_NOTICE); //include the config file require('config.php'); $image = stripslashes($_REQUEST[imname]); $rs = mysql_query("SELECT* FROM images WHERE member_id = '".$_SESSION['id']."' AND image_cartegory = 'main' "); $row = mysql_fetch_assoc($rs); $imagebytes = $row[image]; header("Content-type: image/jpeg"); print $imagebytes; ?> The tag on the html page that's supposed to display the picture reads something like this <img src="display_pic.php" width="140" height="140"> And just in case this might help, I will include the image upload script below, which I think worked just fine because my values were successfully inserted into the database. Code: [Select] <?php //This file inserts the main image into the images table. //address error handling ini_set ('display_errors', 1); error_reporting (E_ALL & ~E_NOTICE); //authenticate user //Start session session_start(); //Connect to database require ('config.php'); //Check whether the session variable id is present or not. If not, deny access. if(!isset($_SESSION['id']) || (trim($_SESSION['id']) == '')) { header("location: access_denied.php"); exit(); } else{ // Make sure the user actually // selected and uploaded a file if (isset($_FILES['image']) && $_FILES['image']['size'] > 0) { // Temporary file name stored on the server $tmpName = $_FILES['image']['tmp_name']; // Read the file $fp = fopen($tmpName, 'r'); $data = fread($fp, filesize($tmpName)); $data = addslashes($data); fclose($fp); // Create the query and insert // into our database. $query = "INSERT INTO images (member_id, image_cartegory, image_date, image) VALUES ('{$_SESSION['id']}', 'main', NOW(), '$data')"; $results = mysql_query($query); // Print results print "Thank you, your file has been uploaded."; } else { print "No image selected/uploaded"; } // Close our MySQL Link mysql_close(); } //End of if statmemnt. ?> So any insights as to why the script fails to display the image? Any help is appreciated. Alright.. I guess to start this off I am looking to sometime in the near future start building a web based or browser based application that I want to build a part of the interface to be a gps module. this will be for a self hosted application likely on tablets or laptops where it will use the data for tracking information amongst other things. Any way most of the application is being handled in PHP, mySQL, jQuery. So with that my question is, is there any way to build a gps application with that as the core languages used. If it is possible, whats the best gps unit I can use? remember im not nessisarily looking for a fancy gps unit to do this with.. just a transmitter/reciever is fine so long as I can build software of my own around it, also is it actually possible to do this with something like php/jquery? or is this something I would have to go the route of maybe java to handle the hardware transactions of which I can tie php/jquery into that.. I just can not get my head around this one at all. I have copied exactly the same code from my own template site and added in new content to the head, main body and footer and no matter what I change I can not get the footer text to show the same on a mobile and a pc like my site I took the code from does. The size of the text just goes large on mobiles, yet the same code is used apart from the slight formatting differences, it should still show the text the same. I opted to copied the resulting source code from the browser for both my site and the new site i am doing and stripped out the main content and header and left just the footer and the main body container html for both and my own site show perfectly on all but still the new site is not playing ball. Below is the code for the new site. Can anyone spot anything that I may have missed that is causing the text to show differently (larger) in the footer on mobile devices. New site <!DOCTYPE html> <html lang="en"> <head> <title></title> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <meta name="keywords" content=""> <meta name="description" content=""> <style> body { font-family: Verdana, Arial, Helvetica, sans-serif; color: #464646; text-decoration: none; background-color: #8C8C8C; margin: 0em; padding: 1.125em; } a, a:visited { color: #164365; text-decoration: underline; } a:hover { color: #6F6F6F; text-decoration: none; } .clear { clear: both; } #main { width: 46.188em; margin:auto; } #main-inner { padding: 0em 1.063em 0.313em 1.063em; border: 0em solid red; min-height: 12.5em; background-color: #FFFFFF; } #footer { margin: 0 auto; clear: both; /*font-size: 0.74em;*/ color: #FFFFFF; text-align: center; width: 46.188em; border: 0.1em solid #ddd; } /* 727 */ #footer a:link, #footer a:visited { color: #FFFFFF; text-decoration: none; } #footer a:hover { color: #FFFFFF; text-decoration: underline; } </style> <meta name="ROBOTS" content="INDEX, FOLLOW"> <link rel="icon" href="favicon.ico" type="image/x-icon"> </head> <body> <div id="main"> <div id="main-inner"> </div> <div class="clear"></div> </div> <div id="footer"> <div style="margin: 0em; text-align: center; font-size: 9pt; border: 0px solid #000;"> <a href="#">clickable link one</a> | <a href="#">clickable link two</a> | <a href="#">clickable link three</a> | <a href="#">clickable link four</a> | <a href="#">clickable link five</a> |© 2014 my shop ™ </div> </div> </body> </html> and just to show what my original code does.. <!DOCTYPE html> <html lang="en"> <head> <title></title> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <meta name="keywords" content=""> <meta name="description" content=""> <style> body { font-family: Verdana, Arial, Helvetica, sans-serif; color: #464646; text-decoration: none; background-color: #8C8C8C; margin: 0em; padding: 1.125em; } a, a:visited { color: #164365; text-decoration: underline; } a:hover { color: #6F6F6F; text-decoration: none; } .clear { clear: both; } #main { width: 46.188em; margin:auto; } #main-inner { padding: 0em 1.063em 0.313em 1.063em; border: 0em solid red; min-height: 12.5em; background-color: #FFFFFF; } #footer { margin: 0em auto; clear: both; color:#FFFFFF; text-align: center; padding: 0em 0em 0em 0em; width: 46.188em; border: 0em dashed #ddd; } #footer a:link, #footer a:visited { color: #FFFFFF; text-decoration: none; } #footer a:hover { color: #FFFFFF; text-decoration: underline; } </style> <meta name="ROBOTS" content="INDEX, FOLLOW"> </head> <body> <div id="main"> <div id="main-inner"> </div> <div class="clear"></div> </div> <div id="footer"> <div style="float: left; width: 6em; border: 0em solid #000;"> </div> <div style="float: left; width: 130px; font-size: 7pt; border: 0px solid #000;"> </div> <div style="float: left; width: 275px; font-size: 8pt; border: 0px solid #000;"> <div style="float: left; width: 200px; border: 0px solid #000;"> © <abbr title="">My company</abbr> </div> <div style="float: left; width: 20px; border: 0px solid #000;"> <a href="http://www.realistichostings.com/sitemap.xml" target="_blank" style="text-decoration: none;">sitemap</a> </div> <div class="clear"></div> designed & hosted by <abbr title="">More footer text</abbr><br>images are copyright of their respective owners </div> </div> </body> </html> 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; } } Hi, I would like to add some advertisment banners the link to landing pages. in the regular webdevelopment I use cookies. how do I do it with mobile? does it support cookies? please enlight me. Thank you. I have a site with seperate content and design for pc and mobile devices... What is the best way to detect and serve the correct content... 1. htaccesss file to detect the devise and then serve... 2. config.php file to detect devise and then serve appropriate files?.. ... im guessing it is version 2 that way you can still allow mobile users to access the full website.... kind regards J.. Hey gues, My question is: how is the easy'est way to redirect i mobile visitor to: mobile.domain.com, when visiting: domain.com? Thanks:). Hi I am trying to create a site that determines the device's screen size. Most mobile phone browsers does not have javascript, so to determine the width and height of the screen I cannot use Javascript. Does anyone know how i can test whether a mobile phone is used to visit the site and what that phone's screen resolution is, so that I can redirect it to the right folder. Thanks in advance If any of you have developed mobile apps before I could really use some advice, please. I have never made one, and would like to for my website. I just need to query my database and display the information. From what I have been able to put together so far, I know that I can use css and jquery fine. My main question is: can I use php to query the mysql database? Pretty much I am a novice, so if using these languages together will not work, please feel free to suggest combinations that would be better. Although, I am trying to avoid as much object oriented stuff as I can, because I just don't get it entirely, but I'll still take the suggestion. Thanks. Hoping someone can help me i know very little about php anyways i am trying to get this to work on my eccommerce site which is all in php. Here is the instructions i have i did upload the files all i need help with is where to put the single line of code for the redirect. Installation 1. Create a subdomain on your server called 'm'. (Ex: m.example.com) * Depending on what kind of hosting you have, the procedure to do this may be either editing configuration files and restarting the server, accessing a control panel, or having a system administrator set it up. 2. Upload the files from the 'm' directory to the document root for your new subdomain. 3. Your mobile site is working! Just visit your m subdomain to see it. Setting up auto redirect If your website is in PHP, you can use phpMobilizer to set up automatic redirection to your mobile site for mobile devices. 1. First you will need to determine where to place the redirect code. Usually you would want to place it in a common include file, such as a config file, a database connection file or a header file. 2. Add the following line of code before any html or text output. * require_once('/home/path/to/subdomain/m/mobilize.php'); * Edit the path so it is pointing directly to the mobilize.php file, which will be in the subdomain's document root. 3. Visit your website with a mobile device and verify it redirects you! Hi, I am bit confused as never done mobile website.
I was thinking we have to use jquery to create a website into mobile.
is it possible we can use only php/mysql and html?
Is it mean that mobile website is smaller version or is it mean we have to use some certain technologies like jquery, html5.
How google/other search engines will know this is mobile version and other is general website for computers.
I was thinking differently but today i donwload free version of mobile website and in coding they only used html css? what about php can we use it too without jquery for database.
sorry to ask realy basic question. I am trying to create a first mobile website.
any advice / hints will be much appreciated.
What doctype do i use for mobile webpages when that mobile webpage contains PHP ? I'm useing the w3c reccommended ones but the PHP doesn't work at all but if i remove the php then all is fine..is there a way to combine the two? Hi everyone This is not really about php code...sorry. But i want some advice if you dont mind. I am working on a system, but i would like it to be available for PC use, aswell as for mobile use. What would be the best? To create two websites, one for mobile other for PC, and upload them to .mobi and .com domains, or should i create only one... I need this to be as user-friendly as possible...because the clients who are going to use this, is those ppl that is not comfortable with a PC, not to mention the web. Thanks Hello, How can I send SMS to mobile phone using PHP? Please point me to a tutorial for achieving this. Also, what software will be needed to do this? I have a form created that seems to work across most devices/connection.. but for some reason some phones, Androids specifically so far, seem to time out when the form is submitted using the mobile network. This has happened on multiple android phones. Doesn't seem to have an issue with iPhones. I also had a problem with a Surface tablet when connected to an android wireless signal.. tethering, the same phone that had the issue.
So what happens is once the form is submitted, it hangs for a while and then it'll say "No data received - Unable to load the webpage because the server sent no data. Reload this webpage Press the reload button to resubmit the data needed to load the page. Error code: ERR_EMPTY_RESPONSE" and then after i refresh, it submits and goes through without a problem. Sometimes it refreshsed by itself after flashing this error and goes through.
Another time, using the Surface Pro, wifi and IE, I got the error "Forbidden" you don't have permission to access /new-window-2.php on this server. Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
You can see an example of one of the forms here - connecttopros(dot)com/windows.php
And some of the code is attached below. I'm lost. I've tried using a different server completely, twice, and it didn't fix the issue, so it must be the way the php is put together? Thanks for your help!
Attached Files
Php Freaks.zip 12.25KB
1 downloads Hi, how can i detect if my website is being open in mobile type all devices instead of computer Please help Hi I got a different and typical (for me) requirement from client. Client have a mobile. He will upload XML file from his mobile to my web address (http://111.111.111.111:8080/directoryname/ In my web address, i have to fetch that request (means take XML file) and insert those details into database by using php. Can anyone tell me how can i do this? |