Shanti C 106 Posting Virtuoso

see this for reference:
http://wasp.sourceforge.net/API/wasp.gui/Chunk.html#class_details

what kind of state in php,you said...

Shanti C 106 Posting Virtuoso

ya .you have to create message table in your database..and when user send message,write insert query at backend with sender id and receiver id...
then you can view that messages based on that receiver id...
tel me you have any login provided in your site,if post your table format..

Shanti C 106 Posting Virtuoso

yes,you should create separate folder like "myproject" to your project...and put all the content of your project in that...and make subfolder in your "myproject",if you have administating area...if you use database,then check it in different systems...

Shanti C 106 Posting Virtuoso

you can retrieve database information like this:

while($r=mysql_fetch_assoc(mysql_query("select * from your table")))
{
echo $r['yourfield'];
}
Shanti C 106 Posting Virtuoso

yes,... scru is damn right...
kavitha,keep that point in your mind...

Kavitha Butchi commented: sure shanthi :) +1
Shanti C 106 Posting Virtuoso
Shanti C 106 Posting Virtuoso

hello try this:

#
while(mysql_fetch_assoc(mysql_query($sql)) )) {
echo '<option value="'.$row['id'].'">'.$row['category_name'].'</option>';

}
Shanti C 106 Posting Virtuoso

hello rakesh...
once check cssplay.com

Shanti C 106 Posting Virtuoso

php is a server-side scripting environment. The browser, the user (and that includes search engines) will never see one line of your php code.

Whatever your php code outputs to the browser will be seen though.

Shanti C 106 Posting Virtuoso

after your insert query...put this line:
header(welcome.php);
then after data insertion to your table,than page will redirect to welcome.php

your form can be like this:
<form action="" NAME="abc" method="post">

but put your insert query and header in this condition:

if($_SERVER['REQUEST_METHOD']=='POST')
{
//insert queries...
header(welcome.php);
}
Shanti C 106 Posting Virtuoso

html array!!!!!!!!!
post your code of html array...

Shanti C 106 Posting Virtuoso

yes...
remove the line: $truedata = mysql_fetch_array()

Shanti C 106 Posting Virtuoso

thanks again pritaeas...
Is there any information about indexing,joins to speed up my query loading???

Shanti C 106 Posting Virtuoso
Shanti C 106 Posting Virtuoso

i dont know deeply..
use array_search();

Shanti C 106 Posting Virtuoso

you can give brief information about all your content seperatly on your home page like HOME
SERVICES
TUTORIAL
CONTACT...

Shanti C 106 Posting Virtuoso

first you have to gather all checked check boxes...
see this will help you..
http://www.tizag.com/mysqlTutorial/mysqltables.php

ask me any doubt...

saikishore commented: nice performance +1
Shanti C 106 Posting Virtuoso

ya,this is the continuation code for the above post...
after getting all check boxes you checked,then write this query to delete them(checked)

if(isset($_POST['check_compare']))
{
$tempids=$_POST['check_compare'];	
echo $tempids;

$ser_qry="delete  from sometable where find_in_set(p_id,'".$_POST['check_compare']."')";
$ser_res=mysql_query($ser_qry);


}
Shanti C 106 Posting Virtuoso

first,create a table according to your requirements...
then if there any problems occured,then post erros,somany will help you...
if you dont have an idea about creating table...see this:http://www.tizag.com/mysqlTutorial/mysqltables.php

Shanti C 106 Posting Virtuoso
Shanti C 106 Posting Virtuoso

hello..
see that code is not for validating...
for checking checkboxes only...
its working fine for me...

Shanti C 106 Posting Virtuoso

see this code will work at this url:
http://www.daniweb.com/forums/thread134908.html

Shanti C 106 Posting Virtuoso

thanks pritaeas...

i heard that joins take more load time...
is it right???
then how to justify our queries...

Shanti C 106 Posting Virtuoso

hello friends....

I am PHP programmer using mysql as my database...
Now it is the time to make fast all my queries ,which im using in my programming...

I heard about indexing...
Tel me what is indexing,how to put indexing to my table...
mainly what are the advantages and disadvantages...or any more about indexing...

Thanks in advance..

Shanti.

Shanti C 106 Posting Virtuoso

use float...

Shanti C 106 Posting Virtuoso

post require code...

Shanti C 106 Posting Virtuoso

hello sorry for my bad post above...its damn wrong...
my code is based on if condition ,not on require function...
so please kindly ignore the above post...please..

Shanti C 106 Posting Virtuoso

yep...
see this example...

$value = true;

if($value == true)
{
echo "alright";
}

else
{
require("error.php");
}

// error.php will be included, even when $value is true
Shanti C 106 Posting Virtuoso

Superglobals are variables like $PHP_SELF, $_REQUEST, and $_SERVER. They are so called because they're always available in any functions without you having to make a global declaration.

Shanti C 106 Posting Virtuoso

Difference between "require()" and "include()" in PHP
This should be well known, and people should be aware as to why they are using either or. But, I've noticed lately that a lot of people new to PHP or programming are not aware of the difference. Depending on what you need you, need to decide what the differences are. So...

* require() : If the file does not exist, you will get a fatal error.
* include() : If the file does not exist, you will get a warning and the next line of code will execute.

Shanti C 106 Posting Virtuoso

Unlike include(), require() will always read in the target file, even if the line it's on never executes. If you want to conditionally include a file, use include(). The conditional statement won't affect the require(). However, if the line on which the require() occurs is not executed, neither will any of the code in the target file be executed.

In PHP 3, it is possible to execute a return statement inside a require()ed file, as long as that statement occurs in the global scope of the require()ed file. It may not occur within any block (meaning inside braces ({}). In PHP 4, however, this ability has been discontinued. If you need this functionality, see include().

Shanti C 106 Posting Virtuoso

hello:
do work on this code:

// how many rows to show per page
$rowsPerPage = 20;

// by default we show first page
$pageNum = 1;

// if $_GET['page'] defined, use it as page number
if(isset($_GET['page']))
{
	$pageNum = $_GET['page'];
}

// counting the offset
$offset = ($pageNum - 1) * $rowsPerPage;

$query  = "SELECT * FROM sometableLIMIT $offset, $rowsPerPage";
$result = mysql_query($query) or die('Error, query failed');

// print the random numbers
while($row = mysql_fetch_array($result))
{
	echo $row['val'] . '<br>';
}
echo '<br>';

// how many rows we have in database
$query   = "SELECT COUNT(val) AS numrows FROM randoms";
$result  = mysql_query($query) or die('Error, query failed');
$row     = mysql_fetch_array($result, MYSQL_ASSOC);
$numrows = $row['numrows'];

// how many pages we have when using paging?
$maxPage = ceil($numrows/$rowsPerPage);

// print the link to access each page
$self = $_SERVER['PHP_SELF'];
$nav = '';
for($page = 1; $page <= $maxPage; $page++)
{
	if ($page == $pageNum)
	{
		$nav .= " $page ";   // no need to create a link to current page
	}
	else
	{
		$nav .= " <a href=\"$self?page=$page\">$page</a> ";
	}		
}

// creating previous and next link
// plus the link to go straight to
// the first and last page

if ($pageNum > 1)
{
	$page = $pageNum - 1;
	$prev = " <a href=\"$self?page=$page\">[Prev]</a> ";
	
	$first = " <a href=\"$self?page=1\">[First Page]</a> ";
} 
else
{
	$prev  = '&nbsp;'; // we're on page one, don't print previous link
	$first = '&nbsp;'; // nor the first page link
}

if ($pageNum …
Shanti C 106 Posting Virtuoso
Shanti C 106 Posting Virtuoso

try this:

if(isNaN(d.number.value)){alert("Please Enter only Numbers in Phone no Feild");
	d.number.value="";d.number.focus();return false;}
Shanti C 106 Posting Virtuoso

and also check this:
---------------------------------------------------------------------------------------
PHP provides four functions which enable you to insert code from other files.

* include()
* require()
* include_once()
* require_once()

All four can take a local file or URL as input. None of them can import a remote file.
require() and include() functions are virtually similar in their function except for the way they handle an irretrievable resource. include() and include_once() provide a warning if the resource cannot be retrieved and try to continue execution of the program if possible. require() and require_once functions provide stop processing the page if they cannot retrieve the resource.

Why include_once() and require_once()
The include_once() and require_once() functions are handy in situations where multiple files may reference the same included code. For example:

File A.php includes File B.php and C.php
File B.php includes File C.php

File C.php has been included twice, so the interpreter would print an error. Since a function cannot be redefined once it’s declared, this restriction can help prevent errors.

If both File A.php and File B.php use include_once() or require_once() to import File C.php, no errors would be generated. PHP would understand that you only want one instance of the code in File C and would not try to redeclare the functions.

It is best to use require_once() to include files which contain necessary code and include_once() to include files that contain content which the program can run without …

Shanti C 106 Posting Virtuoso

The require() function is identical to include(), except that it handles errors differently.

The include() function generates a warning (but the script will continue execution) while the require() function generates a fatal error (and the script execution will stop after the error).

check this :
http://www.tizag.com/phpT/require.php

rati commented: good undertanding about php +2
Shanti C 106 Posting Virtuoso

hello see this article is really nice:
http://info.ssl.com/article.aspx?id=10068
http://webdesign.about.com/od/ecommerce/a/aa070407.htm
And keep in mind:
->encode and decode your passwords perfectly..
->be careful about using trusted payment gateways...
->be away of sql injections..

Kavitha Butchi commented: thnk you Shanthi :). Found those links very helpful. +1
Shanti C 106 Posting Virtuoso

hello try this code will work perfectly:

function confirm_delete(x) {
var answer=confirm("Are You Sure You Want to Delete ?");
if(answer==true)
{ 
		window.location.href="delete.php?id="+x;
		} 
		return;
}
Shanti C 106 Posting Virtuoso

thanks for your replies...

And is there any coding tips to avoid this problem
or
generally any coding tips to load our page fastly...
Tel me any ideas if you have...
thanks in advance...

Shanti C 106 Posting Virtuoso

i got understand your problem like this:

<?
session_start();
if(empty($_SESSION['loginuser']))
 {
  header('location:index.php'); 
 }
?>

you have to include this page in all your pages,which must require login to proceed...

Shanti C 106 Posting Virtuoso

hell try this:

$string=nl2br($_POST['textareaname']);

use $string in your insert query...

Shanti C 106 Posting Virtuoso
Shanti C 106 Posting Virtuoso

you just put your alphabetic letters in hyperlinks each other...

Shanti C 106 Posting Virtuoso
Shanti C 106 Posting Virtuoso

For more dynamic dropdown with changing second dropdown....
Refer this url:
http://www.plus2net.com/php_tutorial/php_drop_down_list.php

Shanti C 106 Posting Virtuoso

hello check this code:

$strQuery = "select $intID, $strName from $tableName order by $strOrderField $strMethod";
  $rsrcResult = mysql_query($strQuery);

  while($arrayRow = mysql_fetch_assoc($rsrcResult)) {
   $intIdField = $arrayRow["$intID"];
   $strNameField = $arrayRow["$strName"];
   echo "<option value=\"$intIdField\">$strNameField</option>\n";
  }

  echo "</select>\n\n";
Shanti C 106 Posting Virtuoso

i saw this error on your admin.php page..

Warning: Cannot modify header information - headers already sent by (output started at /home/peipians/public_html/yackub/admin_home.php:23) in /home/peipians/public_html/yackub/admin_home.php on line 131

For this you simply add ob_start(); at stating lines of your php code...

And coming to your thread ,you can pass your primary key of your message on hyper link like:

<a href="some.php?viewid=code for id" >code for showing message</a>
Shanti C 106 Posting Virtuoso

Hello friends...

I got one error ,when my login page is loading...
Fatal error:maximum execution time of 30 seconds exceeded in ../../../login.php

What would i do for preventing this..
Thanks in Advance.
Shanti..

Shanti C 106 Posting Virtuoso

please once try this:

string sql = " INSERT into `employee`(`fname`, `mname`,` lname`) VALUES (@fname, @mname,@lname)";
Shanti C 106 Posting Virtuoso

this is one example:
this is based on joins...

CREATE TABLE Articles (
   ArticleID SMALLINT NOT NULL PRIMARY KEY,
   ArticleTitle VARCHAR(60) NOT NULL,
   Copyright YEAR NOT NULL
)
ENGINE=INNODB;


INSERT INTO Articles VALUES (12786, 'How write a paper', 1934),
                            (13331, 'Publish a paper', 1919),
                            (14356, 'Sell a paper', 1966),
                            (15729, 'Buy a paper', 1932),
                            (16284, 'Conferences', 1996),
                            (17695, 'Journal', 1980),
                            (19264, 'Information', 1992),
                            (19354, 'AI', 1993);


CREATE TABLE Authors (
   AuthID SMALLINT NOT NULL PRIMARY KEY,
   AuthorFirstName VARCHAR(20),
   AuthorMiddleName VARCHAR(20),
   AuthorLastName VARCHAR(20)
)
ENGINE=INNODB;


INSERT INTO Authors VALUES (1006, 'Henry', 'S.', 'Thompson'),
                           (1007, 'Jason', 'Carol', 'Oak'),
                           (1008, 'James', NULL, 'Elk'),
                           (1009, 'Tom', 'M', 'Ride'),
                           (1010, 'Jack', 'K', 'Ken'),
                           (1011, 'Mary', 'G.', 'Lee'),
                           (1012, 'Annie', NULL, 'Peng'),
                           (1013, 'Alan', NULL, 'Wang'),
                           (1014, 'Nelson', NULL, 'Yin');


CREATE TABLE AuthorArticle (
   AuthID SMALLINT NOT NULL,
   ArticleID SMALLINT NOT NULL,
   PRIMARY KEY (AuthID, ArticleID),
   FOREIGN KEY (AuthID) REFERENCES Authors (AuthID),
   FOREIGN KEY (ArticleID) REFERENCES Articles (ArticleID)
)
ENGINE=INNODB;


INSERT INTO AuthorArticle VALUES (1006, 14356), 
                              (1008, 15729), 
                              (1009, 12786), 
                              (1010, 17695),
                              (1011, 15729), 
                              (1012, 19264), 
                              (1012, 19354), 
                              (1014, 16284);
  
SELECT STRAIGHT_JOIN ArticleTitle, Copyright,
   CONCAT_WS(' ', AuthorFirstName, AuthorMiddleName, AuthorLastName) AS Author
FROM Articles AS b, AuthorArticle AS ab, Authors AS a
WHERE b.ArticleID=ab.ArticleID AND ab.AuthID=a.AuthID AND Copyright<1980
ORDER BY ArticleTitle;

see this for reference:
http://www.tizag.com/mysqlTutorial/mysqljoins.php