If you say so it has to be true.
I hope to find a php forum for this. I have been googling for topic how to pass a jquery variable to php in the proper way. I have it and can see it, but if I use the variable $newNumber with php code like this:
- $currentNumber = $_POST['currentNumber'];
function increment($currentNumber) {
global $newNumber;
$newNumber = $currentNumber + 1;
return $newNumber;
}
echo increment($currentNumber);
- // $currentNumber is used for a database table entry
notice that I added global to the function.
What happens is this:
I start the script in the browser. I click the link. The tabel.column called count gets an update from empty to 1.
The second time the link is clicked its the table is update to 2 but suddenly I get html code to see that is not processed by the browser properly like this:
<br />
<font size='1'><table class='xdebug-error xe-warning' dir='ltr'
border='1' cellspacing='0' cellpadding='1'>
<tr><th align='left' bgcolor='#f57900' colspan="5"><span
style='background-color: #cc0000; color: #fce94f; font-size:
x-large;'>( ! )</span> Warning: A non-numeric value
etc.
And the strange thing is that the count starts a 0 and counts up to 1.
First thing for me I dont get: why is the html source code shown? Second: How to get rid of the source code that is showed?
And then I want to find a solution for counting up properly.
I know its partially PHP code for processing this, but, some parts are related to jquery too, so I'd reckon I still can post it here to see what your ideas are about it.