The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Problem writing to the database
I am having a bit of a problem writing to the database using a form for a league hosting application I am developing. It is located outside of my forums subfolder (however I don't think that has anything to do with it).
Anyway here is the code: register.php: PHP Code:
PHP Code:
Thanks, Oneback |
#2
|
|||
|
|||
It would help if you told us what the problem was...
(P.S. use [php] and [/php] tags around your PHP code. ) |
#3
|
|||
|
|||
Well basically after messing around with it a little bit more when pressing submit all it does is redirects me to register.php?do=addleague without running any code. I know it's something simple that I am probably over looking.
At first I I thought maybe it wasn't picking up the data from the $_POST but now I believe it's not even running the code within if ($_POST['do'] == 'addleague'). |
#4
|
|||
|
|||
Underneath where you check if the form was submitted (if($_POST['do...) add this:
PHP Code:
|
#5
|
|||
|
|||
I am not 100% sure I put it in the right location as I am fairly new at this but here is what I did:
PHP Code:
Again thank you for any help you can provide. |
#6
|
||||
|
||||
If it's in the URL, it's in the GET superglobal, not the POST.
|
#7
|
|||
|
|||
Quote:
Thank you for your help. |
#8
|
||||
|
||||
You use $POST_ when you are grabbing information from a form (person fills out a form - say a name - and you want to use that information on the next page) and you use $GET_ when you are you are getting the variable from the url (url/page.php$do=variable). So, try using $GET_['do'] or $REQUEST_['do'].
(I think I got that right, I do need more coffee this morning!) |
#9
|
|||
|
|||
Quote:
Here is what I've got: League Register template: PHP Code:
PHP Code:
|
#10
|
|||
|
|||
remove the "do=addleague" from the action="..." in your form.
In register.php change $_GET['do'] to $_REQUEST['do']. Run the code, you should be getting some output because your only send data from one page to another. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|