[PHP] Refresh Error

2003-09-11 Thread Rex Brooks
Okay, I'm displaying an entire table of numbers from my database.  Using a
form on the same page, you can enter an amount to add to the table and then
click submit.  I pass all of the information in $_POST back to the same
page.  Here is my code:


if ($_POST["number"] != NULL) {

if (is_numeric($_POST["number"]) || $_POST["number"] <= 0.0){
...
display stuff telling them they need to try again
...
}
else {
...
do stuff that adds the number to the table
...

$_POST["number"] = NULL;
}
}

 ...body of HTML document...




Add Amount








Everything seems to work fine, up until you click the refresh button, then
it will add whatever you just added to the table again, even if you have
nothing typed into the form and dont hit the submit button.  So basically I
can add 500 by typing it in and clicking the submit button, then continue to
add an addition 500 every time I click the submit button.  I want to be able
to refresh the page, but I cant figure out what is going wrong.  Any ideas?

Rex

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: storing quotes into a variable

2003-09-11 Thread Rex Brooks
I think you just have to escape every double quote that you want to be a
part of the HTML code like this -->   /"
That should work.  I dont think you have to escape the single quotes, but I
could be wrong.



"Doug Parker" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> isn't there a function that allows me to store a string with a bunch of
> quotes in it (like an html tag) into a variable?
>
> for example, i need something like:  $perf_mod =  onclick="popWindow('popup.php')">
>
> thanks...
>
> --
>
>
>
> 
> http://www.phreshdesign.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php