Jump to content

ankur0101

Members
  • Posts

    242
  • Joined

  • Last visited

Everything posted by ankur0101

  1. Hi, I have following code : <?php class CategoryWork { public $form = ""; public $error = ""; public $add_form = "<br /><br /><p><strong>Add New Category</strong></p><br /><form id=\"form1\" name=\"form1\" method=\"post\" action=\"category.php?action=add\"> <table width=\"550\" height=\"170\" border=\"0\"> <tr> <td width=\"153\">Name :</td> <td colspan=\"2\"><label for=\"cat_name\"></label> <input name=\"cat_name\" type=\"text\" id=\"cat_name\" size=\"50\" maxlength=\"50\" /></td> </tr> <tr> <td>Slug :</td> <td colspan=\"2\"><label for=\"cat_slug\"></label> <input name=\"cat_slug\" type=\"text\" id=\"cat_slug\" size=\"50\" maxlength=\"50\" /></td> </tr> <tr> <td>Description</td> <td colspan=\"2\"><label for=\"cat_desc\"></label> <textarea name=\"cat_desc\" id=\"cat_desc\" cols=\"48\" rows=\"10\"></textarea></td> </tr> <tr> <td> </td> <td width=\"97\"><input type=\"submit\" name=\"button\" id=\"button\" value=\"Submit\" /></td> <td width=\"286\"><input type=\"reset\" name=\"button2\" id=\"button2\" value=\"Reset\" /></td> </tr> <tr> <td> </td> <td colspan=\"2\">error</td> </tr> </table> </form>"; } ?> At the line of <td colspan=\"2\">error</td> I want to insert $error, hence I made the line as <td colspan=\"2\">".$error."</td> and also tried <td colspan=\"2\">".$this->error."</td> After executing with this, php says syntax error at the line of public $add_form I am going to declare an error at the $error When I do <td colspan=\"2\">$error</td> it says : Parse error: syntax error, unexpected '"' at line of public $add_form When I do <td colspan=\"2\">".$error."</td> it says : Parse error: syntax error, unexpected '.', expecting ',' or ';' at the above line i.e. of <td> I am damn confused, I googled but nothing found any helpful material. Anybody please help me.. Thanks
  2. That is why I love phpfreaks, problem solved in 15 minutes
  3. OMG, Its working, special thanks to user behicthebuilder :-) Also, can you tell me how can I make it more secure ? I mean how can I prevent sql injection ?
  4. Hi, I am making a login page which consists of 2 pages, index.php and config.php Following is a code of config.php <?php define("HOST", "localhost"); define("USER", "aaaabbbccc"); define("PASS", "aaabbbccc"); define("DATABASE", "pricetagindia"); $connection = @mysql_connect(HOST, USER, PASS); $select_db = @mysql_select_db(DATABASE, $connection); if(!$connection) { echo "<h1>Cannot connect to database</h1>"; exit(0); } if(!$select_db) { echo "<h1>Cannot select database</h1>"; exit(1); } ?> Here is a coding of index.php <?php include('config.php'); $_error = "<p></p>"; if (isset($_POST['username']) || isset($_POST['password'])) { $username = $_POST['username']; $password = $_POST['password']; if($username == NULL || $password == NULL) { $_error = "<p>Username and Password, both fields are required.</p>"; } else { // Check in DB $password = md5($password); $checkuser_query = "SELECT * FROM users WHERE username = '$username.' AND password = '$password'"; $checkuser_result = mysql_query($checkuser_query); $checkuser_count = mysql_num_rows($checkuser_result); if($checkuser_count == 1) { echo "match found"; } else { echo "nothing found error, username was ".$username." and pass is ".$password; echo "<p></p>"; echo $checkuser_result; } } } ?> <!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" /> <title>Price Tag India</title> </head> <body> <center> <h1>Price Tag India</h1> <p> </p> </center> <center> <form action="index.php" method="post" target=""> <table width="389" height="168" border="0"> <tr> <td width="141">Username :</td> <td colspan="2"><label for="username"></label> <input type="text" name="username" id="username" /></td> </tr> <tr> <td>Password :</td> <td colspan="2"><label for="password"></label> <input type="password" name="password" id="password" /></td> </tr> <tr> <td> </td> <td width="56"><input type="submit" name="button" id="button" value="Submit" /></td> <td width="223"><input type="reset" name="button2" id="button2" value="Reset" /></td> </tr> <tr> <td> </td> <td colspan="2"> <?php echo $_error; ?> </td> </tr> </table> <p> </p> </form> </center> </body> </html> I have attached the screenshot of database. Problem is when I do valid login i.e. with user admin and its password, it is not working, I spent 1 hour for solving this issue but didnt find any solution. Its frustrating now.....I know its simple but still its not working. It is giving me error as nothing found error, username was admin and pass is 62cc2d8b4bf2d8728120d052163a77df Resource id #5
  5. Hi, Have you uploaded it ? I am also developing the same, may be, I would get some logic idea.
  6. Thanks Problem solved :-)
  7. Hi, I want to search for keywords in a sentence Something like >> $abc = "I drink water. I drink vodka too."; if (word 'water' found in $abc or word 'vodka' found in $abc) { echo "I found some kind of liquid"; } How can I do that ?
  8. Yeah, I was about to write this that using this, it works. Problem SOlved.
  9. var_dump($temp['registrar']) gave me following output : string(1)"<" Now using print_r($temp['registrar']) gives following output : <
  10. Okay, I will try and update this thread.
  11. Hi, I am performing some whois query using phpwois. http://www.phpwhois.org/ So after doing its object output i.e. $whois = new Whois(); $result = $whois->Lookup($domain); $winfo = ''; $utils = new utils; $winfo = $utils->showHTML($result); , I am getting following data for for phpfreaks.com> regrinfo->Array domain->Array name->phpfreaks.com nserver->Array ns1.serverpowered.net->204.13.168.4 ns2.serverpowered.net->216.12.222.4 ns3.serverpowered.net->66.97.171.74 ns4.serverpowered.net->66.97.171.254 status->Locked changed->2011-08-29 created->2001-10-11 expires->2016-10-11 registered->yes owner->Array name->Web Freaks address->Array 0->Contact Administrative () admin->Array email->[email protected] name->Contact Administrative phone->4072751117 fax->+1.4072757706 address->Array 0->Web Freaks 4->3700 Commerce Blvd 5->Suite 154 6->Kissimmee, FL 34741 7->US tech->Array email->[email protected] name->Contact Administrative phone->4072751117 fax->+1.4072757706 address->Array 0->Web Freaks 4->3700 Commerce Blvd 5->Suite 154 6->Kissimmee, FL 34741 7->US regyinfo->Array registrar->ENOM, INC. referrer->http://www.enom.com servers->Array 0->Array server->com.whois-servers.net args->domain =phpfreaks.com port->43 1->Array server->whois.enom.com args->phpfreaks.com port->43 type->domain Now I want to show Domain registrar (Enom, INC.) So I did following echo $winfo['regyinfo']; Now above code shows following >> registrar->ENOM, INC. referrer->http://www.enom.com servers->Array 0->Array server->com.whois-servers.net args->domain =phpfreaks.com port->43 1->Array server->whois.enom.com args->phpfreaks.com port->43 type->domain To obtain I mean to show ENOM, INC, I used following > echo $winfo['regyinfo']['registrar']; But it gave error, so I used following >> $temp = $winfo['regyinfo']; echo $temp['registrar']; But it give output as follows : < I dont know what wrong I am doing ? If it is showing regyinfo, then it should also show registrar. Thanks
  12. Hi, I am using following syntax >> /^[a-z0-9][a-z0-9\-]+[a-z0-9](\.[a-z]{2,4})+$/i Is that right ?
  13. Yes, I forgot that point. What to do for domains such as >> something.co.in something.com.mx Thanks
  14. It would be good if you can increase font size of widgets heading. Think about using some different background. Such as http://www.retailmenot.com/ But in little bit bright color. There is some space between your logo and main menu, think about reducing it. Your 404 error page looks messy. Also create sitemap of your WP :-)
  15. With 100%, I agree with Adam. For me, site looks too much bright, gives strength on my eyes. Only 3 colours are used, white, green and gray Think about using some different backgrounds and cufon fonts
  16. Something is wrong. Your site just shows >> d-.
  17. Hello I have a domain WHOIS website made in PHP. http://www.domain-whois-lookup.com/ It says version 1.1 BETA because I got various ideas in my mind to make it as good as domaintools or who.is In future I will introduce domaintools and who.is features. I would be happy to read your reviews. Thanks
  18. I dont think so. They must have discovered this problem while development of their sites. I think they are using some perl script. But question remains as it is, why ? why PHP is not able to get real result ?
  19. So now what to do to get right result ? Is this kind of BUG ? How other given domain lookup sites are showing 6 ?
  20. Even domain registrar's WHOIS is showing 6 records : https://manage.name.com/whois_result?type=domain&domain_name=domain-whois-lookup.com&submit=Whois+Search
  21. At my domain registrar, I have kept 6. I know. How following sites are showing 6 ? http://who.is/whois/domain-whois-lookup.com/ http://whois.domaintools.com/domain-whois-lookup.com
  22. Hi, I have a domain called domain-whois-lookup.com It is having 6 NS records, you can verify that at domaintools.com/domain-whois-lookup.com I have a following code : <?php $result = dns_get_record("domain-whois-lookup.com", DNS_NS); echo count($result); echo "<p></p>"; print_r ($result['0']); echo "<p>================</p>"; for($i=0; $i<=count($result); $i++) { // @print_r ($result["$i"]); @$target_ns = $result["$i"]; echo "<p></p>"; print_r ($target_ns["target"]); echo "<p></p>"; } ?> After executing this, it shows only 4 records instead of 6, why ? One more thing is many times, first name server (e.g. ns1) shows as 2nd and 2nd NS as first, why ?
  23. Hi, I am developing a website where I need geo ip functions. How can I install geo ip on windows ? I googled but found such thing which confused me. Please, help me
  24. I would like to ask one more question. I have an array such as >> $whoisservers = array( "ac" =>"whois.nic.ac", "ae" =>"whois.nic.ae", "aero"=>"whois.aero", "af" =>"whois.nic.af", "ag" =>"whois.nic.ag", "al" =>"whois.ripe.net", "am" =>"whois.amnic.net", "arpa" =>"whois.iana.org", "as" =>"whois.nic.as", "asia" =>"whois.nic.asia", "at" =>"whois.nic.at", "au" =>"whois.aunic.net", "az" =>"whois.ripe.net", "ba" =>"whois.ripe.net", "be" =>"whois.dns.be", "bg" =>"whois.register.bg", "bi" =>"whois.nic.bi", "biz" =>"whois.biz", "bj" =>"whois.nic.bj", "br" =>"whois.registro.br", "bt" =>"whois.netnames.net", "by" =>"whois.ripe.net", "bz" =>"whois.belizenic.bz", "ca" =>"whois.cira.ca", "cat" =>"whois.cat", "cc" =>"whois.nic.cc", "cd" =>"whois.nic.cd", "ch" =>"whois.nic.ch", "ci" =>"whois.nic.ci", "ck" =>"whois.nic.ck", "cl" =>"whois.nic.cl", "cn" =>"whois.cnnic.net.cn", "com" =>"whois.verisign-grs.com", "coop" =>"whois.nic.coop", "cx" =>"whois.nic.cx", "cy" =>"whois.ripe.net", "cz" =>"whois.nic.cz", "de" =>"whois.denic.de", "dk" =>"whois.dk-hostmaster.dk", "dm" =>"whois.nic.cx", "dz" =>"whois.ripe.net", "edu" =>"whois.educause.edu", "ee" =>"whois.eenet.ee", "eg" =>"whois.ripe.net", "es" =>"whois.ripe.net", "eu" =>"whois.eu", "fi" =>"whois.ficora.fi", "fo" =>"whois.ripe.net", "fr" =>"whois.nic.fr", "gb" =>"whois.ripe.net", "gd" =>"whois.adamsnames.com", "ge" =>"whois.ripe.net", "gg" =>"whois.channelisles.net", "gi" =>"whois2.afilias-grs.net", "gl" =>"whois.ripe.net", "gm" =>"whois.ripe.net", "gov" =>"whois.nic.gov", "gr" =>"whois.ripe.net", "gs" =>"whois.nic.gs", "gw" =>"whois.nic.gw", "gy" =>"whois.registry.gy", "hk" =>"whois.hkirc.hk", "hm" =>"whois.registry.hm", "hn" =>"whois2.afilias-grs.net", "hr" =>"whois.ripe.net", "hu" =>"whois.nic.hu", "ie" =>"whois.domainregistry.ie", "il" =>"whois.isoc.org.il", "in" =>"whois.inregistry.net", "info" =>"whois.afilias.net", "int" =>"whois.iana.org", "io" =>"whois.nic.io", "iq" =>"vrx.net", "ir" =>"whois.nic.ir", "is" =>"whois.isnic.is", "it" =>"whois.nic.it", "je" =>"whois.channelisles.net", "jobs" =>"jobswhois.verisign-grs.com", "jp" =>"whois.jprs.jp", "ke" =>"whois.kenic.or.ke", "kg" =>"www.domain.kg", "ki" =>"whois.nic.ki", "kr" =>"whois.nic.or.kr", "kz" =>"whois.nic.kz", "la" =>"whois.nic.la", "li" =>"whois.nic.li", "lt" =>"whois.domreg.lt", "lu" =>"whois.dns.lu", "lv" =>"whois.nic.lv", "ly" =>"whois.nic.ly", "ma" =>"whois.iam.net.ma", "mc" =>"whois.ripe.net", "md" =>"whois.ripe.net", "me" =>"whois.meregistry.net", "mg" =>"whois.nic.mg", "mil" =>"whois.nic.mil", "mn" =>"whois.nic.mn", "mobi" =>"whois.dotmobiregistry.net", "ms" =>"whois.adamsnames.tc", "mt" =>"whois.ripe.net", "mu" =>"whois.nic.mu", "museum" =>"whois.museum", "mx" =>"whois.nic.mx", "my" =>"whois.mynic.net.my", "na" =>"whois.na-nic.com.na", "name" =>"whois.nic.name", "net" =>"whois.verisign-grs.net", "nf" =>"whois.nic.nf", "nl" =>"whois.domain-registry.nl", "no" =>"whois.norid.no", "nu" =>"whois.nic.nu", "nz" =>"whois.srs.net.nz", "org" =>"whois.pir.org", "pl" =>"whois.dns.pl", "pm" =>"whois.nic.pm", "pr" =>"whois.uprr.pr", "pro" =>"whois.registrypro.pro", "pt" =>"whois.dns.pt", "re" =>"whois.nic.re", "ro" =>"whois.rotld.ro", "ru" =>"whois.ripn.net", "sa" =>"whois.nic.net.sa", "sb" =>"whois.nic.net.sb", "sc" =>"whois2.afilias-grs.net", "se" =>"whois.iis.se", "sg" =>"whois.nic.net.sg", "sh" =>"whois.nic.sh", "si" =>"whois.arnes.si", "sk" =>"whois.ripe.net", "sm" =>"whois.ripe.net", "st" =>"whois.nic.st", "su" =>"whois.ripn.net", "tc" =>"whois.adamsnames.tc", "tel" =>"whois.nic.tel", "tf" =>"whois.nic.tf", "th" =>"whois.thnic.net", "tj" =>"whois.nic.tj", "tk" =>"whois.dot.tk", "tl" =>"whois.nic.tl", "tm" =>"whois.nic.tm", "tn" =>"whois.ripe.net", "to" =>"whois.tonic.to", "tp" =>"whois.nic.tl", "tr" =>"whois.nic.tr", "travel" =>"whois.nic.travel", "tv" => "tvwhois.verisign-grs.com", "tw" =>"whois.twnic.net.tw", "ua" =>"whois.net.ua", "ug" =>"whois.co.ug", "uk" =>"whois.nic.uk", "us" =>"whois.nic.us", "uy" =>"nic.uy", "uz" =>"whois.cctld.uz", "va" =>"whois.ripe.net", "vc" =>"whois2.afilias-grs.net", "ve" =>"whois.nic.ve", "vg" =>"whois.adamsnames.tc", "wf" =>"whois.nic.wf", "ws" =>"whois.website.ws", "yt" =>"whois.nic.yt", "yu" =>"whois.ripe.net"); The TLD should match to given tlds in array. If it wont match, it will go back to index.php with header() I am confused , how to do this ?
  25. Yes, I know this can happen only with mod rewrite but how to write that code ?
×
×
  • 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.