want to execute comments on new pages after clicking submit.
| From: | amol patil | Date: | Sat, 25 Dec 2004 07:36:18 +0000 |
| Subject: | want to execute comments on new pages after clicking submit. | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-37839@lists.php.net to get a copy of this message | ||
hallo,
thanks for reply, but
code is like below , i want comment in echo statemets to executed on
same page(without pages original contenti.e only echo comments )or on new pages
how to link new pages in php, after clicking submit
also.
[these first two echo statements are giving parse errors errors,unexpected '/']
<?php
echo "--$submit--";echo "--$_POST["submit"]--";
if ($submit)
{$db =
mysql_connect("localhost","root");mysql_select_db("dollar1_allinfo",$db);
mysql_query("INSERT INTO totalinfo (username,password,)
VALUES('$loginusername','$loginpassword')");echo 'thank you';echo
'So Hurry Up';}?>
thank you.
<graeme_foster@sherubtse.edu.bt> wrote:
The purpose of putting the echo "Submit = $submit"; is to find out what is happening with
your code. Once everything is working correctly they will be removed. What you need to find out is
what is being held in the variable submit when you move from one page to the next, a point when you
are expecting to enter the if($submit) clause.
I hope that clarifies it a bit.
all the best,
graeme.
amol patil wrote:
hallo, i wrote this echo "Submit = $submit"; before 'if statement' but ,
the sentences in echo statements are executing on same pages , showing original page with these
echo statement. i want to execute , some comments and tables on same page(without original contents)
or on new pages , after clicking on submit buttonwhat to do for it. thank you."Mike S."
<list.phpdb.01@netmask.com> wrote:
hallo ,i have wriiten simple php script , below.created databse "dollar1_allinfo" with
table 'totalinfo'but on clicking submit button ,information entered is not entering in
database.also, echo statements are also not displaying after submit
if ($submit)
{$db =
mysql_connect("localhost","root");mysql_select_db("dollar1_allinfo",$db);mysql_query("INSERT
INTO totalinfo (username,password,)
VALUES('$loginusername','$loginpassword')");echo 'thank you';echo
'So Hurry Up';}?>thank you.
Because your query and echoes are within an "if" block, I'd say that$submit is
evaluating to FALSE, and thus not executing the query andechoes.Add (before the if statement):echo
"Submit = $submit";Make sure that $submit is evaluating to TRUE.To All Beginning
Programmers ("Newbies"), or just people who want toeasily debug their code:Try adding
debugging statements to help you find problems. A few echoesor prints in selected locations will
help identify the issue. Make sureyour variables are evaluating to values that you think they should
be.If you want to keep the debugging statements in your code and justactivate them when you need to
see them, do something like:// near the top of your code$debug=TRUE;// and anywehere in your codeif
($debug) {echo "DEBUG: Submit = $submit\n";}// or whatever echo might help you nail down
the problem. Put as many ofthese in your code and you can turm them ON and OFF very easily,
bychanging one line of code.OR for even quicker debugging, replace
$debug=TRUE; with$debug=$_GET['debug'];and then you can turn it on in by adding
?debug=TRUE at the end of theURL. Example: http://www.php.net/path/my.html?debug=TRUEor:
http://www.php.net/path/my.html?debug=1**DISCLAIMER** Using the URL method is NOT a secure way to do
this!!! And I'm sure there's plenty of folks groaning out there because it is aBIG
security hole. You really would want to do this on a developmentmachine and network, and remove the
debug code for production. Thatreally should go without saying.Good luck.:Mike S.:Austin TX
USA ---------------------------------Do you Yahoo!? Yahoo! Mail - Helps protect you from nasty
viruses.
---------------------------------
Do you Yahoo!?
Yahoo! Mail - now with 250MB free storage. Learn more.