Jump to content

Search the Community

Showing results for 'detecting mobile device'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

  1. Heya all i just moved to a new server and now im code isnt working with cookies? i have gone through the code several times but cannot find the problem. I have searched through the code to see where it messes it up and found it but still dont know whats wrong. I would really appreciate if someone could have a look at the code. The cookie code is very important since it stops robots/proxy programs from voting (runnin a top list for websites). have a look at this code /*if ($err == 1 && $use_cookies == 1) { if ($anti_cheat[$site] == 1) $err = 2; if ($test_cookies != 1) $err = 5; }*/ i had to comment out that or else the system wouldnt work at all but i need cookies enabled as soon as possible. As i said i would be very glad if someone could have a look at it and i know im not the best programmer hehe [code] <? include "config.php"; $MinPerVote = 5; // 1 vote per 5 minutes $cookie_message = "<font color=red face=verdana size=2>Please enable cookies.</font><br>"; $vote_timeout = "12"; $use_cookies = "1"; if(isset($_GET['site'])){     $site = $_GET['site'];             } else        {     $site = $_POST['site'];         } $Time = Time() - ($MinPerVote * 60); $open = mysql_connect($dbhost, $user, $pass); $data = mysql_db_query($dbname, "DELETE FROM top_ip WHERE time < $Time");     //Links / htaccess       $data = mysql_db_query($dbname, "SELECT * FROM top_user Where sid='$site'");     if($rad = mysql_fetch_array ($data)) {           $inCID = $rad["category"];     }       $data = mysql_db_query($dbname, "SELECT * FROM top_cats Where cid='$inCID'");     if($rad = mysql_fetch_array ($data)) {           $InCurrentID = $rad["cid"];         $inCurrentCatName  = $rad["catname"];         $LLink = str_replace(" ", "-", $inCurrentCatName);         $LLink = str_replace("/", "-", $LLink);         $LLink = strtolower($LLink);     } //Which Category       $Sitecat = $inCID; //Category ID       $incatename = $inCurrentCatName; //Category name $get_rows = mysql_db_query ($dbname,"Select title,url from top_user Where sid='$site'",$db) or die (mysql_error()); if (!mysql_num_rows($get_rows) OR mysql_num_rows ($get_rows) < 1) { header("location: $url_to_folder"); } if ($gateway == 1 && $_POST['stat'] != "gate") {     if ($use_cookies == 1)    {         setcookie ("test_cookies", "1",time()+(3600*$vote_timeout));                 } include "header.php"; ?> <br /> <style type="text/css" media="screen, tv, projection"> @import "menu.css"> </style> <TABLE Width="750" CellPadding="3" CellSpacing="0" style="border-left-width: 1px; border-right: 1px solid #3E4968; border-left: 1px solid #3E4968; border-top-width: 1px; border-bottom-width: 1px" bgcolor="#ddecf8" align="left" > <TR> <TD background="bg_menu.jpg" colspan="5" height="22"> <font color="black" face="<? echo $font_face; ?>" Size="2"<small><center><B>- <?Print "$incatename";?> Top 100</B></center></small></font> </TD> </TR> <TR> <TD> <font color="black" face="<? echo $font_face; ?>" Size="<? echo $font_size; ?>"> <small>                               <body bgcolor="#FFFFFF" onLoad="if (self != top) top.location = self.location"> <FORM ACTION="in.php" METHOD="POST"> <p align="center">&nbsp;</p> <p align="center"> <font color="black" face="<? echo $font_face; ?>" Size="5"<small><center><B><?Print "$incatename";?> Top 100</B></small></font> <p> <?       $open = mysql_connect($dbhost, $user, $pass);       $data = mysql_db_query($dbname, "SELECT * FROM top_user WHERE sid='$site'");       while($rad = mysql_fetch_array ($data)) {           $SiteTitle  = $rad["title"];                  echo "<input type=\"submit\" value=\"Vote for $SiteTitle\" name=\"SUBMIT_IMAGE\" ALT=\"ENTER TO $top_name\"><BR>\n";     //which category       $data = mysql_db_query($dbname, "SELECT * FROM top_user WHERE sid='$site'");     if($rad = mysql_fetch_array ($data)) {           $Category = $rad["category"];     } ?>             <script type="text/javascript"><!--         google_ad_client = "";         google_ad_width = 468;         google_ad_height = 60;         google_ad_format = "468x60_as";         google_ad_channel ="";         google_color_border = "ddecf8";         google_color_bg = "ddecf8";         google_color_link = "ddecf8";         google_color_url = "008000";         google_color_text = "000000";         //--></script>         <script type="text/javascript"           src="http://pagead2.googlesyndication.com/pagead/show_ads.js">         </script>              <center><p>[Please click <a href="">here</a> if you have been tricked.]</p></center>         <center><p>Voting is once every 12 hours</p></center>         <center><p>In/Out resets every 30 days</p></center> <?}?>     </p>     <p align="center">&nbsp;</p>     <INPUT TYPE="HIDDEN" NAME="site" VALUE="<?Print $site;?>">     <INPUT TYPE="HIDDEN" NAME="stat" VALUE="gate">     </FORM>     <a href=""></a> &copy; 2004 <br></font>     </small><br>     <br>     </font>     </TD>     </TR>     <TR>     <TD Colspan="6"  Align="center" background="logoborder.jpg" height="13">     </TD>     </TR>     </Table>     <font style="FONT-FAMILY: Verdana, Tahoma, Arial; FONT-SIZE: 7pt;">     <br />      <?     } else {setcookie ("test_cookies", "1",time()+(3600*$vote_timeout));} if ($gateway == 1 && isset($_POST['site'])) {     //Finding the correct category for the website       $data = mysql_db_query($dbname, "SELECT * FROM top_user WHERE sid='$site'");     if($rad = mysql_fetch_array ($data)) {           $Category = $rad["category"];     }     //Looking up if the users is connecting through a proxy     if($_SERVER['HTTP_X_FORWARDED_FOR'] != "" && $_SERVER['HTTP_VIA'] != "") {     //Print "Proxy detected!\n";         header("location: $url_to_folder/$LLink");     exit;     }     // Checking if the website has voted within 5 minutes     $open = mysql_connect($dbhost, $user, $pass);     $data = mysql_db_query($dbname, "SELECT * FROM top_ip WHERE sid='$site'");     if($rad = mysql_fetch_array ($data)) {       header("location: $url_to_folder/$LLink");       exit;     }     else {       $Time = Time();       $data = mysql_db_query($dbname, "INSERT top_ip (sid, time) VALUES ('$site', '$Time')");     }     if ($use_cookies == 1) {         setcookie ("test_cookies", "1",time()+(3600*$vote_timeout));     }     $cdate = date ("Ymd");     $err = 1;     $pdate = time()-(3600*$vote_timeout);     $cndate = time();     $REMOTE_ADDR=$_SERVER['remote_addr'];     $query = mysql_db_query ($dbname,"Select ip from top_hits Where sid='$site' and cdate between $pdate and $cndate and ip='$REMOTE_ADDR'",$db) or die (mysql_error());     if ($err == 1 && @mysql_num_rows($query) >= 1) $err = 2;     /*if ($err == 1 && $use_cookies == 1) {         if ($anti_cheat[$site] == 1) $err = 2;         if ($test_cookies != 1) $err = 5;     }*/     if ($err == 1) {         if ($use_cookies == 1) {             setcookie ("anti_cheat[$site]", "1",time()+(3600*$vote_timeout));     }         mysql_db_query ($dbname,"update top_user set thin=thin+1 Where sid='$site'",$db) or die (mysql_error());         mysql_db_query ($dbname,"update top_user set totin=totin+1 Where sid='$site'",$db) or die (mysql_error());//- Total in         mysql_db_query ($dbname,"update top_user set monthin=monthin+1 Where sid='$site'",$db) or die (mysql_error());//- Monthly in         mysql_db_query ($dbname,"insert into top_hits (sid,ip) values ('$site','$REMOTE_ADDR')",$db) or die (mysql_error());     }          header("location: $url_to_folder/$LLink"); } include "footer.php"; ?> [/code]
  2. Wow...the array returned looks normal now. array ( 'handleSimpleUserUploadResult' => array ( 'Username' => 'Banthien.hEynL', 'Password' => 'dfrtMG', 'Forename' => 'Alex', 'Surname' => 'Banthien', 'Email' => 'will@e-rizon.com', 'Phone' => '01925 222 005', 'Mobile' => '0780 392 7771', 'Address1' => '49 Rushton Close', 'Address2' => 'Burtonwood', 'Address3' => 'Warrington', 'Address4' => 'Cheshire', 'Address5' => 'WA5 4HB', 'MembershipNumber' => '000094', 'PayPointId' => '00000184', ), ) How do I now extract the membership Number to $membership_no I tried $member_no = $result['MembershipNumber']; //no result and $new_result= var_export($result,true); $member_no = $new_result['MembershipNumber'];// returned a value of "a"????? Any ideas? Thanks so far Will
  3. Hi, My little application is a simple file upload system. There is only ever going to be one user who will upload, and one user who will download the file. There is also an archive of current uploaded files for the download person, and a separate archive page for the uploader which is the same, but includes a delete function to delete the db record and also to delete the actual file. When a file is uploaded, an email is sent to the person who will download the file when he is ready, by visiting the archive page and choosing which file he wishes to dowload and clicking the 'download' link. So far so good. What I want to do now is to have a 'Yes'/'No' next to the archive of each file which will let the user know whether the file has been downloaded or not. The question is.....how do I detect if the file has been downloaded or not? Thanks for any suggestions. Neil
  4. You would expect that to work...but for a reason beyond my comprhesion it doesn't. The $result is populated by this piece of code $result = $soap_proxy->handleSimpleUserUpload($param); This is how I get the: Array ( [1] => Array ( [Username] => aaaaa [Password] => bbbbb [Forename] => Alex [Surname] => ccccc [Email] => will@xxxx.com [Phone] => 01925xxxxxx[Mobile] => 0780 xxxxxxx [Address1] => 49 xxxxxxx[Address2] => Bxxxxxx [Address3] => Warrington [Address4] => Cheshire [Address5] => xxxxxx [MembershipNumber] => 000056 [PayPointId] => 00000146 ) [value] => Array ( [Username] => aaaaa[Password] => bbbbb [Forename] => Alex [Surname] => xxxxx[Email] => will@xxxxx.com [Phone] => 01925 xxxxx[Mobile] => 0780 xxxxxx[Address1] => 49 xxxxxx[Address2] => xxxxxxxx [Address3] => Warrington [Address4] => Cheshire [Address5] => xxxxxx[MembershipNumber] => 000056 [PayPointId] => 00000146 ) [0] => handleSimpleUserUploadResult [key] => handleSimpleUserUploadResult ) Now it is worth mentioning here that this is all driven by a SOAP Envelope Client (NuSOAP.php) request to a WS server. Although I can't see why that would make a difference. The $param is obviously populated and in turn populating the $result....but I can't extract ANY data from it....just keep getting blank returns Will
  5. How did you know I was going to answer this one??? :-) Try this [code]<?php $test = Array ( '1' => Array('Username' => 'aaaaa',                                       'Password' => 'bbbbb',                                       'Forename' => 'Alex',                                       'Surname' => 'ccccc',                                       'Email' => 'will@xxxx.com',                                       'Phone' => '01925xxxxxx',                                       'Mobile' => '0780 xxxxxxx',                                       'Address1' => '49 xxxxxxx',                                       'Address2' => 'Bxxxxxx',                                       'Address3' => 'Warrington',                                       'Address4' => 'Cheshire',                                       'Address5' => 'xxxxxx',                                       'MembershipNumber' => '000056',                                       'PayPointId' => '00000146'),                     'value' => Array ('Username' => 'aaaaa',                                       'Password' => 'bbbbb',                                       'Forename' => 'Alex',                                       'Surname' => 'xxxxx',                                       'Email' => 'will@xxxxx.com',                                       'Phone' => '01925 xxxxx',                                       'Mobile' => '0780 xxxxxx',                                       'Address1' => '49 xxxxxx',                                       'Address2' => 'xxxxxxxx',                                       'Address3' => 'Warrington',                                       'Address4' => 'Cheshire',                                       'Address5' => 'xxxxxx',                                       'MembershipNumber' => '000056',                                       'PayPointId' => '00000146'),                 '0' => 'handleSimpleUserUploadResult', 'key' => 'handleSimpleUserUploadResult' ); $membership_no = $test[1]['MembershipNumber']; ?>[/code] Ken
  6. The response I receive from a web service app is in the form of an array. This is set as $result. Heres the first part of code $item=each($result); print_r($item); and this returns the following (sensitive data replaced Array ( [1] => Array ( [Username] => aaaaa [Password] => bbbbb [Forename] => Alex [Surname] => ccccc [Email] => will@xxxx.com [Phone] => 01925xxxxxx[Mobile] => 0780 xxxxxxx [Address1] => 49 xxxxxxx[Address2] => Bxxxxxx [Address3] => Warrington [Address4] => Cheshire [Address5] => xxxxxx [MembershipNumber] => 000056 [PayPointId] => 00000146 ) [value] => Array ( [Username] => aaaaa[Password] => bbbbb [Forename] => Alex [Surname] => xxxxx[Email] => will@xxxxx.com [Phone] => 01925 xxxxx[Mobile] => 0780 xxxxxx[Address1] => 49 xxxxxx[Address2] => xxxxxxxx [Address3] => Warrington [Address4] => Cheshire [Address5] => xxxxxx[MembershipNumber] => 000056 [PayPointId] => 00000146 ) [0] => handleSimpleUserUploadResult [key] => handleSimpleUserUploadResult ) Now you will note that this is a multi dimensional array. For some reason the data seems to appear twice...but Im not that bothered. I simple need to set $membership_no as the [MembershipNumber] value I have tried but in vain....any help much appreciated. Will
  7. I have a script that uses fopen to open a csv file, replace the text within it with 2 lines. Then we use PHPMailer to send the file as an attachement via email. Doing this, the csv only contains about 1/4th of the content, yet when I view the csv file on the server, it contains all the information. If I just attach without the fopening and all, it attaches the full file. So I thought that it might be a timing issue, maybe i was attaching the file before php could complete writing to it, so I paused it for 5 seconds, then 10 seconds, no progress, it still stops at the same point. Can anyone explain what is going on? Here is the coding: [code]     $headerline = '"slno","trackingCode","currdate","currtime","referField","amtRequired","loanPurpose","fName","mName","lName","dob","maritalStatus","empStatus","postCode","address","area","town","hlongyears","hlongmonths","hometype","telephone","mobile","wnumber","email","contacttime","numbpref","jointapplication","occupation","grossincome","s2pcode","s2address","s2area","s2town","s2empstatus","s2occupation","s2grossincome","s2houseworth","s2mortage","s2findus","s2ppi","s2fName","s2mName","s2lName","s2dob","s2empstatus1","s2occupation1","s2grossincome1","firstAppEmpName","secondAppEmpName","firstAppEmpAddr","secondAppEmpAddr","firstAppEmpNo","secondAppEmpNo","firstAppEmpDur","secondAppEmpDur","firstAppPrevEmpName","secondAppPrevEmpName","firstAppPrevEmpAddr","secondAppPrevEmpAddr","firstAppPrevEmpDur","secondAppPrevEmpDur","bankName","bankAddr","hlYears","hlMonths","children","mrp","mct","chkCredit","type1","name1","amount1","monthlypymt1","settle1","type2","name2","amount2","monthlypymt2","settle2","type3","name3","amount3","monthlypymt3","settle3","type4","name4","amount4","monthlypymt4","settle4","loan_archive","loan_delete","stageform","app_status","app_lock","call_attd","app_stat_feed","app_attd_date","addn_addr","ppi","addn_info","app_attd_time","app_comp_stat","loanTerm","keywords"';     $headerline = $headerline."\r\n";     $norton = mysql_query("SELECT * FROM email WHERE lender='Nor'") or die(mysql_error());     $nrow = mysql_fetch_array($norton);     $ncount = $nrow['count'];     $number = $ncount + 1;     mysql_query("UPDATE email SET count='$number' WHERE lender='Nor'") or die(mysql_error());     $ndate = date("d/m/y");     $ntime = date("H:i:s");     $entry_line = '"'.$number.'","test","'.$ndate.'","'.$ntime.'","","'.$amount.'","'.$reason.'","'.$name.'","","'.$surname.'","'.$dob.'","'.$marital.'","'.$empstatus.'","'.$postcode.'","'.$addline1.'","'.$addline2.'","'.$addline3.'","","","homeowner","'.$homephone.'","'.$mobilephone.'","'.$workphone.'","'.$email.'","","","","'.$occupation.'","'.$monthlyincome.'","","","","","","","","'.$propvalue.'","'.$mortout.'","","","","","","","","","","","","","","","","'.$emptime.'","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","new","","","","","","","","","","0",""';     $content = $headerline.$entry_line;     //add header line to csv     $fp = fopen("export.csv", "w");     fputs($fp, $content);     fclose($fp);      require("class.phpmailer.php"); $mail = new PHPMailer(); $mail->IsMAIL(); // telling the class to use SMTP $mail->From = "mu@email.com"; $mail->AddAddress("my@email.com"); $mail->Subject = "Test CSV"; $mail->Body = "This is a test CSV"; $mail->WordWrap = 50; $filename = $number.".csv"; $mail->AddAttachment("export.csv"); if(!$mail->Send()) {    echo "Message was not sent";    echo "Mailer Error: " . $mail->ErrorInfo; } else {    echo "Message has been sent"; } [/code]
  8. anatak

    mobile html

    I figured out the problem with the password. the problem was situated 40 cm of the screen (me) I didn't notice that my cellphone changes to numerical input when you go into a password field so I have another question. redirecting to a url does not seem to work on my cellphone I am trying to do this <meta http-equiv="refresh" content="0; url=http://www.kyushunetwork.com/mobile/index.php" /> this is supposed to be supported according to the reference here [a href=\"http://www.w3.org/TR/1998/NOTE-compactHTML-19980209/#ref\" target=\"_blank\"]http://www.w3.org/TR/1998/NOTE-compactHTML-19980209/#ref[/a] (scroll down to see reference) any idea what is wrong or another way to do this ?
  9. [!--quoteo(post=350515:date=Mar 1 2006, 05:25 AM:name=wickning1)--][div class=\'quotetop\']QUOTE(wickning1 @ Mar 1 2006, 05:25 AM) [snapback]350515[/snapback][/div][div class=\'quotemain\'][!--quotec--] Maybe you could post some relevant information about your table structures. [/quote] Here is the structure with some data: [code] CREATE TABLE `attendance` (   `id` int(10) unsigned NOT NULL auto_increment,   `event` int(10) unsigned NOT NULL default '0',   `player` tinyint(3) unsigned NOT NULL default '0',   `present` enum('yes','no') NOT NULL default 'no',   PRIMARY KEY  (`id`) ) TYPE=MyISAM PACK_KEYS=0 AUTO_INCREMENT=11; -- -- Dumping data for table `attendance` -- INSERT INTO `attendance` VALUES (10, 1, 2, 'yes'); -- -------------------------------------------------------- -- -- Table structure for table `calendar` -- CREATE TABLE `calendar` (   `id` int(10) unsigned NOT NULL auto_increment,   `name` varchar(128) NOT NULL default '',   `author` tinyint(3) unsigned NOT NULL default '0',   `event` text NOT NULL,   `start` int(16) NOT NULL default '0',   `end` int(16) NOT NULL default '0',   `added` int(16) NOT NULL default '0',   PRIMARY KEY  (`id`) ) TYPE=MyISAM PACK_KEYS=1 AUTO_INCREMENT=12; -- -- Dumping data for table `calendar` -- INSERT INTO `calendar` VALUES (11, 'Event', 1, 'This is an event', 1141207200, 1141221600, 1141061678); -- -------------------------------------------------------- -- -- Table structure for table `players` -- CREATE TABLE `players` (   `id` tinyint(3) unsigned NOT NULL auto_increment,   `name` varchar(128) NOT NULL default '',   `surname` varchar(128) NOT NULL default '',   `email` varchar(128) NOT NULL default '',   `password` varchar(128) NOT NULL default '',   `homephone` varchar(128) NOT NULL default '',   `mobile` varchar(128) NOT NULL default '',   PRIMARY KEY  (`id`) ) TYPE=MyISAM PACK_KEYS=1 AUTO_INCREMENT=10; -- -- Dumping data for table `players` -- INSERT INTO `players` VALUES (8, 'John', 'Doe', 'john@doe.com', 'md5password', '123456789', '8768686865'); INSERT INTO `players` VALUES (9, 'Bob', 'the Builder', 'bob@builder.com', 'thisismypassword', '987654321', '989797976');[/code] I hope it helps. It has 2 people and one event to which Bob is attending.
  10. Ok lets say I have a system where users upload their pictures to the website. Then as a Copyright for the user (so that other users cant copy their image onto their page) the jpeg will be copyrighted (commented) with their username and then when another user attempts to upload their image it will detect that copyright COMMENT within the image (using exif_read_data()) and then will block the user from uploading it. How would I add the comment into the JPEG image.
  11. Hey, I made some progress, I found out this is called cartesian product (expalined in [a href=\"http://en.wikipedia.org/wiki/Cartesian_product\" target=\"_blank\"]wikipedia[/a] and [a href=\"http://www.fluffycat.com/SQL/Cartesian-Joins/\" target=\"_blank\"]sql[/a]) So the code looks like this now: [code] SELECT p.id , p.name , p.surname , p.email , c.start AS beginning , c.end AS finnish , c.name AS title , c.event AS description , c.id AS eventid FROM calendar c INNER JOIN attendance a ON a.event = c.id INNER JOIN players p ON p.id = a.player WHERE ((a.present = "yes" AND c.start >= '1141826733' AND c.start <= '1142431533') OR (c.added >= '1141740333' AND c.added <= '1141826733')) ORDER BY p.id ASC , c.start ASC[/code] But the second part of the OR statement doesn't work. That is if I remove the c.start part, it will return an empty set. I was expecting to get all results added in the previous 24 hours and all the events that people said they were coming that will occur in the next week. If anyone could help that would be great, there's the db below: [code] -- -- Table structure for table `attendance` -- CREATE TABLE `attendance` (   `id` int(10) unsigned NOT NULL auto_increment,   `event` int(10) unsigned NOT NULL default '0',   `player` tinyint(3) unsigned NOT NULL default '0',   `present` enum('yes','no') NOT NULL default 'no',   PRIMARY KEY  (`id`) ) TYPE=MyISAM PACK_KEYS=0 AUTO_INCREMENT=2; -- -- Dumping data for table `attendance` -- INSERT INTO `attendance` VALUES (1, 1, 2, 'yes'); -- -------------------------------------------------------- -- -- Table structure for table `calendar` -- CREATE TABLE `calendar` (   `id` int(10) unsigned NOT NULL auto_increment,   `name` varchar(128) NOT NULL default '',   `author` tinyint(3) unsigned NOT NULL default '0',   `event` text NOT NULL,   `start` int(16) NOT NULL default '0',   `end` int(16) NOT NULL default '0',   `added` int(16) NOT NULL default '0',   PRIMARY KEY  (`id`) ) TYPE=MyISAM PACK_KEYS=1 AUTO_INCREMENT=2; -- -- Dumping data for table `calendar` -- INSERT INTO `calendar` VALUES (1, 'Birthday', 1, 'It''s my birthday!', 1141999200, 1142006400, 1141826592); -- -------------------------------------------------------- -- -- Table structure for table `players` -- CREATE TABLE `players` (   `id` tinyint(3) unsigned NOT NULL auto_increment,   `name` varchar(128) NOT NULL default '',   `surname` varchar(128) NOT NULL default '',   `email` varchar(128) NOT NULL default '',   `password` varchar(128) NOT NULL default '',   `homephone` varchar(128) NOT NULL default '',   `mobile` varchar(128) NOT NULL default '',   PRIMARY KEY  (`id`) ) TYPE=MyISAM PACK_KEYS=1 AUTO_INCREMENT=3; -- -- Dumping data for table `players` -- INSERT INTO `players` VALUES (1, 'John', 'Doe', 'john@doe.com', 'md5password', '123456789', '8768686865'); INSERT INTO `players` VALUES (2, 'Bob', 'the Builder', 'bob@builder.com', 'thisismypassword', '987654321', '989797976'); [/code]
  12. [!--quoteo(post=351111:date=Mar 2 2006, 03:21 PM:name=joecooper)--][div class=\'quotetop\']QUOTE(joecooper @ Mar 2 2006, 03:21 PM) [snapback]351111[/snapback][/div][div class=\'quotemain\'][!--quotec--] does anyone else know how to turn error reporting off? [/quote] Hecken is right. Thats definately one you should NOT be ignoring. At least not without detecting and logging it. While you don't want your clients to see error messages, you do not want to ignore them completely. Use error_reporting() to supress warning and error messages.
  13. No. php runs on the server. iframes run on the client. Javascript can do something for you - maybe. Google from javascript frame detection and/or frame busting.
  14. Is there anyway to detect if a page is inside an iframe in PHP? Or is there a script that can do this? THanks. thewird
  15. [!--quoteo(post=352624:date=Mar 7 2006, 04:38 PM:name=Bogdan)--][div class=\'quotetop\']QUOTE(Bogdan @ Mar 7 2006, 04:38 PM) [snapback]352624[/snapback][/div][div class=\'quotemain\'][!--quotec--] I planning to create forms in PHP/MySQL. but i'm not sure if it works on Pocket PC, Sidekick, or others PDA devices. did anyone done it? Any suggestions? Thanks a lot for your responce Bogdan [/quote] PHP/MySQL is server side. ie, the server is responsible for running the code. Only HTML/WML/CSS/Javascript is output to the client. So, yeah.. provided your code outputs HTML that those devices can handle, it works fine.
  16. I planning to create forms in PHP/MySQL. but i'm not sure if it works on Pocket PC, Sidekick, or others PDA devices. did anyone done it? Any suggestions? Thanks a lot for your responce Bogdan
  17. or tell me how do i detect the name of a field that contains a certain text. for example how do I get the name of the field that holds litter "abcdef".
  18. I'm looking for a bit of advice regards the code shown below. I am implementing a questionairre in html/php and got some great help on the code in another thread. One thing i would like to be able to do with my answers is to have them randomly display on the screen instead of them being in the same order all the time. For example, one question may be: What make of mobile phone do you own? A)Nokia B)Motorolla C)Siemens D)Sony. The choices will always be the same except i would like Nokia to be in a different positions from choice A the next time someone runs the questionairre. Is this possible? if($successful) { echo '<table align="left">'; while ($row=mysql_fetch_array($result,MYSQL_NUM)){ $id = $row[0]; $q = $row[1]; $answer1 = $row[2]; $answer2 = $row[3]; $answer3 = $row[4]; $answer3 = $row[4]; echo'<tr><td align=\"left\">'.$q.'</td></tr> <tr><td align=\"left\"><input type="radio" name="option['.$id.']"value="'.$answer1.'"/>'.$answer1.'</td></tr> <tr><td align=\"left\"><input type="radio" name="option['.$id.']"value="'.$answer2.'"/>'.$answer2.'</td></tr> <tr><td align=\"left\"><input type="radio" name="option['.$id.']"value="'.$answer3.'"/>'.$answer3.'</td></tr> <tr><td align=\"left\"><input type="radio" name="option['.$id.']"value="'.$answer4.'"/>'.$answer4.'</td></tr>'."\n"; } echo '</table>'; echo '</form>'; }else{ echo'<p><b>Error. Please contact admin</b></p>'; }
  19. [!--quoteo(post=353810:date=Mar 10 2006, 09:13 PM:name=abcabc)--][div class=\'quotetop\']QUOTE(abcabc @ Mar 10 2006, 09:13 PM) [snapback]353810[/snapback][/div][div class=\'quotemain\'][!--quotec--] I did refer to that manual beforehand, and used it to put together this code. Also, look at [a href=\"http://www.developershome.com/wap/detection/detection.asp?page=readHeader\" target=\"_blank\"]http://www.developershome.com/wap/detectio...page=readHeader[/a] and scroll down to header "Retrieving HTTP Headers with PHP" and you will see it listed as OK. [/quote] Fair enough...I never actually looked at all the elements in the server array before. On my home server, the value of that particular element is: [HTTP_ACCEPT_LANGUAGE] => en-us,en;q=0.5 So, I don't see any reason, off hand, why your code wouldn't work.
  20. [!--quoteo(post=353801:date=Mar 10 2006, 08:37 PM:name=hitman6003)--][div class=\'quotetop\']QUOTE(hitman6003 @ Mar 10 2006, 08:37 PM) [snapback]353801[/snapback][/div][div class=\'quotemain\'][!--quotec--] According to the manual, $_SERVER['HTTP_ACCEPT_LANGUAGE'] is not one of the predefined variables available. Refer to [a href=\"http://us2.php.net/manual/en/reserved.variables.php#reserved.variables.server\" target=\"_blank\"]http://us2.php.net/manual/en/reserved.vari...ariables.server[/a] to see which variables are available by default. [/quote] I did refer to that manual beforehand, and used it to put together this code. Also, look at [a href=\"http://www.developershome.com/wap/detection/detection.asp?page=readHeader\" target=\"_blank\"]http://www.developershome.com/wap/detectio...page=readHeader[/a] and scroll down to header "Retrieving HTTP Headers with PHP" and you will see it listed as OK.
  21. Hello, Does anyone know if there are any (php) scripts out there that can detect user imput into a MySQL database that is differs slightly. Or how you can handle such a problem without having to resolve to going "manually" through the database entries. E.g. a script that can detect that - Traversée Mont Blanc - Salbitschijen, West Face is very similar to - Traversee Mont Blanc - West face Salbitschijen And asks if 1 should be replaced by 2 or vice versa... thx ! Tom
  22. whilst i'm sre that there are a million ways to detect javascript, here's a way i've used before. the following is 'include'd in all my files in my site. basically it does a quick check by using javascript command to submit a form, then logs the result as a session variable. the check is only carried out once, unless someone has javascript turned off (just incase they turn it back on after the warning). i'm sure you could modify it your own way: <?php // jstest.php // javascript detector for php. ideal to be placed in a script used commonly through a site. session_start(); // check that the test hasn't already been done // test will be repeated if either it's not been done before, or if javascript is off to check // if a user has turned it on during a session. if (!isset($_SESSION['js_on']) || $_SESSION['js_on'] == false) { // check for post values - if we have post values, it means the form was submitted by javascript. if (isset($_POST['jstest'])) { $_SESSION['js_on'] = true; } else { // first time - construct a form and submit it with javascript echo '<form name="jstest" method="post">'; echo '<input name="jstest" type="hidden" value="js_on" />'; echo '<script type="text/javascript" language="javascript">'; echo 'document.jstest.submit();'; echo '</script>'; echo '</form>'; // if we get here, it means javascript is OFF $_SESSION['js_on'] = false; } } // rest of script goes here.... // // // // etc // // // echo "javascript is ".($_SESSION['js_on'] ? "on":"off")."<br>"; echo 'normal script here'; ?>
  23. I have a unix server running Apache with 30+ domains on it. How can I tell what script is being attacked to send spam
  24. I know very little about its usage but I read that source can be compiled for desktop app purposes. If that is the case, are there ways for me to connect to and view my webcam and connect to sound devices going this route? Php has been a formidable mountain for me to climb thus far and I'd like to stick with a derivative of it at least.. if its possible. I have visual C++ 6.0 if I have to go down that road for my needs, but I don't know a darn thing about C and I'm already late in the game attempting to bring a home brewed web app to life. >_< Any and all replies are greatly appreciated.
  25. Fellow PHP Freaks, I need some help! Let me describe my setup first. Dedicated Server, running Fedora Core 3, Plesk 7.5, Apache 2, PHP 4.3, MySql 3.x. This server hosts a number of systems, all built using PHP. Some of the older ones aren't built so well, so are memory hogs, the more recent ones are built using Seagull and are nice and pleasant. The core of our system is an XMLRPC Syncscript, that allows Palm devices to synchronize their data. So a single sync generates numerous tcp connections, and quickly eats up CPU and Memory. In 99% of the cases, every thing is fine. People can sync with no problem, access our various websites without trouble. Every so often there will be lag while people are syncing, but it's always for a short period of time. However now more often we are getting reports from users who are getting random connection problems. For instance, the XMLRPC server will at times return "nothing". But in all attemps, we cannot recreate the problem. From what we can determine, it is not a memory issue, and we do not feel it is a PHP timeout issue...as with all of our simulations, we cannot replicate. For instance, I whipped up a Java program that spawns X number of threads and simulates a sync with the server using httpunit. We can spawn up to 100 threads on a number of machines and have absolutely no problems! And now recently, our websites have been getting reports of problems. Where people are reporting problems like "Cannot display page" and "cannot find server" while browsing the website. We monitor our servers with MRTG, and every so often we see TCP connection spikes, but memory and cpu are always quite sensible. And since our last reboot, we have not paged once. We've scanned through logs, every so often we see apache automatically restarting...but it never coincides with an incident reported by a user. Another thing that we have noticed, that may be related, is that we have noticed a lot of foreign connections to our SMTP server. Unfortunately this box also has to run mail services...and none of us are too excited to start configuring qmail. If anybody has any ideas, it would be greatly appreciated! Thanks, Toby
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.