vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   cycle through various POST array variables and types (https://vborg.vbsupport.ru/showthread.php?t=56036)

AmericanWoman 08-10-2003 12:27 AM

The form generates a script tag, e.g.:

PHP Code:

<script language="javascript" src="blah.php?forumid=[x,x,x,x]&font=Verdana&border=0"></script

The script file needs to be able to parse through the forumid array and build the "where" clause of the sql statement accordingly.

I've got all the colors, etc., working, but the forumid part is the most important...and right now, it's just saying "forumid=Array".

I'm trying to figure out why. :(

g-force2k2 08-10-2003 12:32 AM

i think thats because both php and javascript take "[" "]" and treat it like its an array... try and remove them from the code

g-force2k2

AmericanWoman 08-10-2003 12:36 AM

It wasn't in the code, originally, and it still output the same thing, but hang on, I'll try it again for kicks.

Dangit. I really wish there were a way to just beam code down to Earth. :(

g-force2k2 08-10-2003 12:51 AM

this is the code i get in my test....

Code:

test.php?&forumid=[10,11,12,13,14,15,16,17,18,]
we have to be doing somethign different...

[edit] nice job :)

g-force2k2

AmericanWoman 08-10-2003 12:52 AM

Figured it out!

I don't know WHY, but for whatever reason, in the second loop (testing whether the POST var is an array, then writing the output), I have to refer to the POST var as $POST_VARS[$key] instead of just $key.

Woot!

g-force2k2 08-10-2003 12:57 AM

im glad that you figured it out

good luck with the script :)

g-force2k2

AmericanWoman 08-10-2003 01:14 AM

Thanks! If I get it working really well, I'll put it in the beta release forum on Monday. :)

I appreciate all your help.

Dean C 08-10-2003 10:19 AM

Interesting... You use PHP3's method of looping through an array :)

AmericanWoman 08-10-2003 12:04 PM

Quote:

Today at 07:19 AM Mist said this in Post #18
Interesting... You use PHP3's method of looping through an array :)
I used the loop structure I was given. :p It's been a very long while since I was a web developer for a living, and I'm terribly rusty but determined to muddle through!

What syntax would you have used?


All times are GMT. The time now is 06:58 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01172 seconds
  • Memory Usage 1,730KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (1)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete