The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#11
|
||||
|
||||
PHP Code:
Just to clarify this comment "//we check to see if the user has filled in at least two variables" - nothing actually happens here yet. It is just the function declaration, but it does check when you actually use the function below. Other than that, yes - it should work. |
#12
|
|||
|
|||
I swapped the true and false in the function though, so if theres more than two the function is false. so if there's less than two, the function will be true, and cause the script to die. (I think)
I'm trying to run the script now, but I'm getting a parse error: Code:
Parse error: parse error, unexpected $ in /home/.sites/22/site13/web/livexchange/tools/photocalc.php on line 295 I've even tried deleting the last lines of the script, but it still says the last line has a dollar sign. This is the whole thing, with a bunch of sections commented out: PHP Code:
|
#13
|
|||
|
|||
Here's a simpler version, that's still giving me the unexpected $ on the last line error:
PHP Code:
|
#14
|
||||
|
||||
I find it much easier when you indent everything "properly" (to my eyes, anyway). After doing so, I found the problem fairly quickly:
PHP Code:
PHP Code:
PHP Code:
|
#15
|
|||
|
|||
Thank you! I didn't know there was a certain way to indent stuff (this is my first script), but now that I see it, it makes sense.
Is there a way to make Dreamweaver do the indenting for you? I've added a bit more code to it, and I've got the new stuff running without errors, but It's not behaving as expected. If I leave the "TD" input field blank, the code: PHP Code:
If I give it all three values, this should check if they all add up corectly: PHP Code:
And finally, this: PHP Code:
Here's the whole thing in context: PHP Code:
This is my first time doing this, and I appreciate your taking the time to help me. |
#16
|
||||
|
||||
You should do indenting manually... your editor should automatically indent to where you were on the previous line when you press enter, if not look at the settings. Whenever you open braces, the line after it should be indented further, and when you close that set of braces off go back to the left one so they line up. It makes it much easier to read it without going into detail!
Isset() checks if the variable is SET. So this means if <input type="text" name="TD" /> (for example) is in your form, regardless of whether or not you enter any data into it), it will be set. I would suggest one of the following intead: PHP Code:
|
#17
|
|||
|
|||
Thank you.
I added a section to unset all post variables with no data: PHP Code:
It's calculating everything correctly now, and it's not giving errors, but it's spitting the answer out on a blank page. How can I take my answer ($TD) and set it equall to .htmlspecialchars($_POST['TD']). so that it displays the answer in the unfilled form field? can I just use: PHP Code:
Nick |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|