Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

how to connect new html page in PHP.
hallo ,

i wrote this ,   echo "Submit = $submit";    as you said.

but comments in echo statements are appearing on same pages before clicking 
submit button
and in between same pages content .

i want these comment on new page or same page but without original content o
f that page

how to connect new html page in PHP after clicking submit button
let simple code is like this,

<?php

echo "--Submit= $submit--";
if ($submit)
{
$dbh=mysql_connect ("localhost", "root", ) or die ('I cannot connect to the 
database because: ' . mysql_error());
mysql_select_db ("dollar1_allinfo");

mysql_query("INSERT INTO totalinfo (username,password,) VALUES ('$loginusern
ame','$loginpassword',)");


echo'thank you';
echo' Hurry Up';

}
?>


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
> 
> {
> $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 and
echoes.

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 to
easily debug their code:
Try adding debugging statements to help you find problems. A few echoes
or prints in selected locations will help identify the issue. Make sure
your variables are evaluating to values that you think they should be.

If you want to keep the debugging statements in your code and just
activate them when you need to see them, do something like:
// near the top of your code
$debug=TRUE;
// and anywehere in your code
if ($debug) {
echo "DEBUG: Submit = $submit
\n";
}
// or whatever echo might help you nail down the problem. Put as many of
these in your code and you can turm them ON and OFF very easily, by
changing 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 the
URL. Example: http://www.php.net/path/my.html?debug=TRUE
or: 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 a
BIG security hole. You really would want to do this on a development
machine and network, and remove the debug code for production. That
really should go without saying.

Good luck.

:Mike S.
:Austin TX USA






---------------------------------
Do you Yahoo!?
Jazz up your holiday email with celebrity designs. Learn more.

Report this thread to moderator Post Follow-up to this message
Old Post
Amol Patil
12-25-04 08:56 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PHP DB archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 08:39 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.