Jump to content


  • Posts

  • Joined

  • Last visited

mandaksk's Achievements


Newbie (1/7)



  1. mandaksk

    Website framework

    You can also do like this in your central page. Depending on what you need you can include specific files.scripts.php------------if($GLOBALS['USE_DB']) include('db.php');if($GLOBALS['USE_SESS']) include('session.php');if($GLOBALS['USE_USERCLASS']) include('user_class.php');MyPage.php--------------$USE_DB=true;include('scripts.php'); //now only db.php gets included and not others.
  2. Some times it also happens that two mysqls (4.x and 5.x) are trying to access same port 3306. Mysql 4.x is already running on 3306, so port is blocked, mysql 5.x cannot connect to it again. Try stopping 4.x and start 5.x. If you are using windows, you can do it via services.msc.Once you connect to mysql server successfully from php, you can issue following sqls, one-by-one or all at once, to create and use the database mysql_query("create database {$myDB}");mysql_query("use {$myDB}");mysql_query('create table MyTable(.......)');mysql_query('select * from MyTable');Note: these are for samples, you should use your own.Manda Krishna Srikanthhttp://www.krishnasrikanth.com
  3. You can also use buffer functions. One of them is ob_flush. Before starting your code, call ob_start(). Then echo whatever you want, and before sleeping call ob_flush(). before flush()ing, nothing will be sent back to browser. after flush()ing the content to be echoed will be discarded by php.See http://in2.php.net/manual/en/function.ob-flush.phpManda Krishna Srikanthhttp://www.krishnasrikanth.com
  4. mandaksk

    XML PArser

    There should be no other technique. Because the XML standard itself says.. " there should be only one root and other elements should be the nodes of the single root.." also the specification for parser also says ".. the parser should stop parsing the xml file that violates the rules of XML.."The xml code you are generating doesn't comply with XML standards, which say, "there should be only one root".. and yours has two roots. So obviously the parser stopped after first root. Manda Krishna Srikanthhttp://www.krishnasrikanth.com
  5. $str="1,2,3,4,5,6,7,8,9,10,11,12,13,14,15";$sql=mysql_query('select email from table where recid in ($str)');while($row=mysql_row($sql)){ mail($sql['emailid'].......);}
  6. mandaksk

    Login Problem

    You are checking the $user and $pass without assigning any values to them in condition 1, and 2. Put these lines before and outside the conditions.<?php$user = $_POST['user'];$pass = $_POST['pass'];if(!isset($user)||!isset($pass)){echo "error1";.....?>
  7. As a security measure, documents on server are not allowed to be changed by viewers. Only FTP users are allowed to change it.If you really want to make people change the contents, ask them to download, change it and upload the file. Then you replace the existing file with the new one.
  8. mandaksk

    XML PArser

    Your xml contains 2 root nodes which is giving the strange result. As per my knowledge there should be only one root node. A simple suggestion is to put it like this.<tag><tagA>...</tagA><tagB>...</tagB></tag>Also PHP will recognize only one root node and not more. Hope you got clarified.-Krishna Srikanthhttp://www.krishnasrikanth.com
  9. Hi,Don't try to put entire page content in database. Then you have to go into database every time you need to make a spelling correction or so. Instead divide the content into different php or html pages and include them dynamically. Put the common content in one page, and dynamic contents in different pages. Call them something like this.<html>..... some common code like headings, banners, ads etc...<?phpinclude($_REQUEST['info'].'.php');?><!-- Navigation --><a href="whatever.php?info=computers">Computers</a><a href="whatever.php?info=health">Health</a></body></html>Also database connections are precious as they effect the script execution time. So use database only for "mission critical" things like meta data, user id and passwords, forum messages etc.- Krishna Srikanthhttp://www.krishnasrikanth.com
  • Create New...