PHP - Mobile Sites
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 Similar TutorialsHi guys and gals, i have two sites which interact with each other, if someone lands on my local site and searches, if the answer isnt found it will transfer them to my other site which has a wider range for what they are looking for. My question is, how would i go about delaying the transfer and displaying a message that the user is now being transfered to a different site? I was thinking something similar to one of those uploading please wait type overlays or somthing? Any ideas would be useful, at the moment its done with a simple form and php, but is instant. Hi, i webmaster multi sites and at the moment run php code to block unwanted ip addresses because of bad submittings.
I am running this code at the moment
<?php I'm trying to create a mac widget that will display my college's football schedule. How do i get started pulling the table data of this page? or any webpage for that matter? It doesn't appear to wrapped in any kind of xml Code: [Select] http://www.aggieathletics.com/sports/m-footbl/sched/tam-m-footbl-sched.html The html is about 3/4 of the down in the source code. I know this has been asked before and I have searched but I can't find an answer. I have a cookie that is set on a customers web site(yes I've tested it and it is defined) and I was going to use it to display certain info on my web site. Sooo ... How do I get a cookie to work across multiple (2) web sites? Thanks I use this on my sites and it works fine on one and not the others and I can't figure out why. The sites are all hosted at the some place and even share an IP but for some reason only one of them is working. Here's the stamp: Copyright © <?php echo date(Y); ?>. So can someone tell me what the problem is? Thanks Hi, I making a banner exchange script. Members will have to place a banner code on their sites to make banners appear. Some members might cheat by using bots to refresh the page to gain impressions and to waste other members impressions so i wanted to know if bots have ip addresses? because i want to only give member impressions if their visitors have ip. What are the other things i can do to check if members are cheating?. Thanks
$ip=$_SERVER['REMOTE_ADDR']; Hello, stristr('http://www.google.com/', 'google') doesn't work but stristr('http://localhost/test.html', 'sandro') works why is this? and how can I solve this problem? I have written a small script for my own personal use that checks the servers of my favorite sites to see if they are operational. I'm having trouble getting it to work, I have most of it (I think) and I'm very new to PHP. The script also allows for a form to add any sites to the file, which I think I explode into an array correctly, at a later time. Here's my code, Please Help! <html> <head> <title>project.php</title> </head> <body> <?php $filename = "websites.txt"; $file = file_get_contents($filename); // reads entire file into a string $DomainNames = explode("\n", $file); // split the string at new line characters, returns an array $length = count($DomainNames) - 1; // count is the correct way to get the length of an array $i=0; while($i<=$length){ $fp = @fsockopen ($DomainNames[$i], 80, $errno, $errstr, 10); if (!$fp) echo "$DomainNames[$i] : <font color='red'>Failed!</font>"; else { echo "$DomainNames[$i] : <font color='green'>Online!</font>"; echo "<br>"; $i++; } } if (isset($_POST['submit'])) { $DomainNames[] = $_POST['url']; // append url to array $file = implode("\n", $DomainNames); // convert array to string, delimiting by new lines file_put_contents($filename, $file); // save contents to file } ?> <form action="project.php" method="post"> <fieldset> <label for="url">Url: </label> <input type="text" name="url" id="url" /> <input type="submit" name="submit" id="submit" value="Add URL" /> </fieldset> </form> </body> </html> has anyone here ever seen these 2 sites?
IP DENY
TOR EXIT NODES with regard to the former, the domain has one page per country I believe. so, you can get listings for like say, China and Russia on these 2 pages: China: https://www.ipdeny.com/ipblocks/data/countries/cn.zone Russia: https://www.ipdeny.com/ipblocks/data/countries/ru.zone my question to folks here is, would this information be useful to me? I am putting together some website content that I do not want everyone in the world to see. And, it is possible that by some miracle, the sophisticated hacker world outside the USA will want to take it down and/or disrupt the service offerings of it if they find out that it exists. Anyone got any advice on whether these resources are even worth the effort to use? and if they are, what is the best way to leverage them? e.g. - when pulling info from the server DB to display content on the page, check this IP data first to see who they are and whether I will allow them or block them? thanks. Adam @requinix, I know we've talked about blocking illegitimate traffic before. and I know you said I can't ever get rid of all of it. but this is new info that I've run across. Just wondering what you guys think of this. =) I'm learning to develop social media buttons, and I'm trying to figure out, how to find out the correct submit links to the social media sites? For example: Digg has their submit link like this: return "<a href='http://digg.com/submit?url=$link& title=$title&bodytext=$text'>Digg This</a>"; Digg also requires to use urlencode for the variables inside the URL. But delicious has their submit link like this: return "<a href='http://del.icio.us/post?url= $link&description=$text&replace=no'>Add to Delicious</a>"; When I go on delicious.com (under this URL: http://www.delicious.com/help/api#posts_add) I will find the link: Code: [Select] https://api.del.icio.us/v1/posts/add? Which is stated on the API page, but that link won't work. I rather have to use the link I showed earlier. So my question is, what is the proper way in figuring the correct submit links for each website and how to format them properly to their requirements, I can not find any information on the websites? So I can build social media buttons to the other sites as well. i need to submit 1 article (3 input fields: title, category, description), to multiple sites. it must be done with 1 click. one more thing... each site to which i have to submit has different input names, but are the same 3, also 1 is for title 1 for category and 1 for description. 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.. 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. hello dear php-friends i currently work on a little parser project i have to find solutions for the a. fetching part b. parser part here we go - the target urls: see the overview: http://dms-schule.bildung.hessen.de/index.html http://dms-schule.bildung.hessen.de/suchen/suche_schul_db.html Search by pressing the button "type" and then choose all schools with the mouse! Results 2400 schools Here i can provide some "more help for getting the target!" - btw: see some details for this target-server: http://dms-schule.bildung.hessen.de/suchen/suche_schul_db.html?show_school=9009 http://dms-schule.bildung.hessen.de/suchen/suche_schul_db.html?show_school=9742 http://dms-schule.bildung.hessen.de/suchen/suche_schul_db.html?show_school=9871 well - you see i have to itterate over the sites - with a function /(a loop) http://dms-schule.bildung.hessen.de/suchen/suche_schul_db.html?show_school=1000 to 10000 BTW - after fetching the page i have to see which one are empty - those ones do not need to be parsed! Well - i want to do this with curl-multi since this is the most advanced way to do this: I see i have an array that can be filled -... but i have to think about the string-concatenation - i guess that i have make some sophisticated string concatenation. this one does not fit - for($i=1;$i<=$match[1];$i++) { $url = "http://www.example.com/page?page={$i}"; and besides this i have an array - i c an fill the array. can you help me how to run in a loop with <?php /************************************\ * Multi interface in PHP with curl * * Requires PHP 5.0, Apache 2.0 and * * Curl * ************************************* * Writen By Cyborg 19671897 * * Bugfixed by Jeremy Ellman * \***********************************/ $urls = array( "http://www.google.com/", "http://www.altavista.com/", "http://www.yahoo.com/" ); $mh = curl_multi_init(); foreach ($urls as $i => $url) { $conn[$i]=curl_init($url); curl_setopt($conn[$i],CURLOPT_RETURNTRANSFER,1);//return data as string curl_setopt($conn[$i],CURLOPT_FOLLOWLOCATION,1);//follow redirects curl_setopt($conn[$i],CURLOPT_MAXREDIRS,2);//maximum redirects curl_setopt($conn[$i],CURLOPT_CONNECTTIMEOUT,10);//timeout curl_multi_add_handle ($mh,$conn[$i]); } do { $n=curl_multi_exec($mh,$active); } while ($active); foreach ($urls as $i => $url) { $res[$i]=curl_multi_getcontent($conn[$i]); curl_multi_remove_handle($mh,$conn[$i]); curl_close($conn[$i]); } curl_multi_close($mh); print_r($res); ?> 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. 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.
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 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? 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! |