Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
  #1  
Old 08-03-2005, 05:38 PM
Vitesse Vitesse is offline
 
Join Date: Jun 2005
Location: Essex, UK
Posts: 41
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Help creating button needed and populating a table

I've follwoed the instructions in this thread to add a page:
https://vborg.vbsupport.ru/showthrea...n+powered+page

Now i've got a few questions (total Vbulletin newbie here and php newb too). Basically my site is a car site and i wanted a way of having a list of quarter-mile times for site users, that they can add to and amend themselves. So I'm adding another Mysql database (if this will work and i didnt really want to modify the forum database).

1. I've added a button and text field on the page for the user to enter their 1/4 mile time and submit it. But how do i actually get the button to do anything i.e. how do i detect when it's been clicked in the php and how do i get the value from the text field. Please let me know in Laymens terms as i still dont follow the vbulletin terminology yet

2. Can someone please give me some guidance on how to populate a table from the contents of the database.

The way i want this to eventually work (i sort of got the basics of using conditionals in templates) is when a user puts a time in the field and clicks submit it will check the user is logged in, if so checks to see if they already are in the database, if not the username $bbuserinfo[username], $bbuserinfo[field5] and $bbuserinfo[field6] which are Car make and car model and the value of the text field are added to the database. If they already exist and are amending it just replaces the value for their time in the DB. When the page is opened i want to populate a table with the contents of the database (i'll have a go at coding this stuff myself just really need help getting the values off the page and into the script and vice-versa)

I know this is a big project for a newb to attempt but i'm doing it on my test site so any screw-ups wont matter much and any advice anyone can give on how to even go about this would be greatly appreciated.
Reply With Quote
  #2  
Old 08-04-2005, 07:30 PM
Vitesse Vitesse is offline
 
Join Date: Jun 2005
Location: Essex, UK
Posts: 41
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

well, i've managed on my own to solve part of the problem now.

This is what i had to do to get the value of the field read into a variable in the php script:

This is in the end of the template i made
HTML Code:
<form action="evaluatetest.php" method="get">
<input type="text" class="bginput" name="quartertime" /></div>
</br>
<input type="submit" class="button" value="Submit / Amend" />
</form>
and this is in the evalueatetest.php file

PHP Code:
$quartertime$_GET['quartertime']; 
Then i can add it to my database from here along with the username and their custom profile field content (which is car make/model).

Still gotta work out how to read values back from my database and populate the table so only half-way there. If anyone has any ideas how to do this please let me know....thanks
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 05:53 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03428 seconds
  • Memory Usage 2,164KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_html
  • (1)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (2)post_thanks_box
  • (2)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (2)post_thanks_postbit_info
  • (2)postbit
  • (2)postbit_onlinestatus
  • (2)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete