The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
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. |
#2
|
|||
|
|||
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> PHP Code:
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 |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|