see this for reference:
http://wasp.sourceforge.net/API/wasp.gui/Chunk.html#class_details
what kind of state in php,you said...
see this for reference:
http://wasp.sourceforge.net/API/wasp.gui/Chunk.html#class_details
what kind of state in php,you said...
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..
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...
you can retrieve database information like this:
while($r=mysql_fetch_assoc(mysql_query("select * from your table")))
{
echo $r['yourfield'];
}
yes,... scru is damn right...
kavitha,keep that point in your mind...
hello try this:
#
while(mysql_fetch_assoc(mysql_query($sql)) )) {
echo '<option value="'.$row['id'].'">'.$row['category_name'].'</option>';
}
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.
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);
}
html array!!!!!!!!!
post your code of html array...
yes...
remove the line: $truedata = mysql_fetch_array()
thanks again pritaeas...
Is there any information about indexing,joins to speed up my query loading???
hello..
refer these links , will help you..
http://www.thefreecountry.com/php/live-chat-scripts.shtml
http://www.hotscripts.com/PHP/Scripts_and_Programs/Chat_Scripts/more6.html
i dont know deeply..
use array_search();
you can give brief information about all your content seperatly on your home page like HOME
SERVICES
TUTORIAL
CONTACT...
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...
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);
}
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
hello..
see that code is not for validating...
for checking checkboxes only...
its working fine for me...
thanks pritaeas...
i heard that joins take more load time...
is it right???
then how to justify our queries...
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.
post require code...
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..
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
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.
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.
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().
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 = ' '; // we're on page one, don't print previous link
$first = ' '; // nor the first page link
}
if ($pageNum …
i dont know exactly:
have a look on this url:
http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/ccd01aeb-a78c-4cc3-adb9-ae0089f23d12.mspx?mfr=true
try this:
if(isNaN(d.number.value)){alert("Please Enter only Numbers in Phone no Feild");
d.number.value="";d.number.focus();return false;}
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 …
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
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..
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;
}
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...
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...
hell try this:
$string=nl2br($_POST['textareaname']);
use $string in your insert query...
you just put your alphabetic letters in hyperlinks each other...
check this:
http://20bits.com/2007/04/10/10-tips-for-optimizing-mysql-queries-that-dont-suck/
http://www.informit.com/articles/article.aspx?p=377652
http://www.sbras.ru/win/docs/db/mysql/manual10.html
And i think we would have all select queries before our <html> tag...
http://blog.digitalstruct.com/2008/06/18/php-performance-series-maximizing-your-mysql-database/
For more dynamic dropdown with changing second dropdown....
Refer this url:
http://www.plus2net.com/php_tutorial/php_drop_down_list.php
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";
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>
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..
please once try this:
string sql = " INSERT into `employee`(`fname`, `mname`,` lname`) VALUES (@fname, @mname,@lname)";
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