The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Help needed... FORMS & PHP (not as noob as you think)
Ok, here's my problem:
I'm currently using an XHTML form (duh), which sends some data to a PHP file. Now, one of the text input boxes, looks like this: HTML Code:
<input name="products[$order[productid]][quantity]" type="text" class="bginput" value="1" size="2">
HTML Code:
products[1][quantity] I'm pretty sure this is possible, but I can't figure it out. Help is appreciated, as always. |
#2
|
|||
|
|||
I'd parse the $variable OUT of html personally.
|
#3
|
|||
|
|||
Yes, but doing it like this is a lot more effective (you would need to see the code to understand this, though)
|
#4
|
|||
|
|||
Try:
PHP Code:
|
#5
|
|||
|
|||
I don't get how I could get that "1" from products[1][quantity] with your code...
I've tried str_replace, but I would need to know the number already... If it is possible with your code, could you maybe give an example? |
#6
|
|||
|
|||
$products will hodl the '1'.
I already gave you an example. |
#7
|
|||
|
|||
I believe you when you say it'll hold a 1, trust me ^^.
But the question is, how should I define products[1][quantity] with that code? Should I globalize it, or just use the $_POST['products[1][quantity]']? |
#8
|
|||
|
|||
You should globalize it, but using the $_POST would also work.
|
#9
|
|||
|
|||
Could you maybe give an example?
What I'm doing is this: PHP Code:
Code:
Warning: Invalid argument supplied for foreach() in /products.php on line 70 PHP Code:
|
#10
|
|||
|
|||
PHP Code:
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|