The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
My last question on PHP, promise :)
I really do appreciate the help that I get on this forum and know that I'm asking a lot. But I learn from all the advice. Thank you.
Here is my final question... Summarizing what I want to do from the start: 1. I have a form with 4 fields. For example $mobile, $code, $message, $tickbox 2. I need to confirm that there are no blank values and that the tickbox is ticked. 3. I need to confirm that $mobile is a number (no other characters) 4. If there are blank values or $mobile contains a value other than a number, I need error messages and the form to be presented back to them with the error messages below. 5. Another tricky part is that I need $code to be checked, so that it is matched to a code in mysql database. Otherwise the user gets requested to re-enter the code (but hopefully the message and mobile fields will still be populated from what the user originally put in each of the fields. This will stop them getting annoyed that the message they spent 10 mins writing has disappeared after the error. 6. If there are no blanks AND the code matches any code on mysql (I have a table there with a single field which has 1000 codes) AND the mobile value is all numbers, then and only then would I like myfile.php to be actioned which involves sending an email (I have the email bit all worked out in the myfile.php) 7. The final bit is that on submission If all the above is correct (no blanks and code confirmed etc...) then I need the code to be deleted from the mysql table. I know that this is quite a bit of work but if anyone could help me with anybit then I would appreciate it. At the moment I might be doing it the wrong way but have this: PHP Code:
But I do need to only have this form submit the email bit if there are no blanks AND the $mobile only contains numbers AND the $code matches a code in mysql table. On submission I would need the used code to be deleted from the table on mysql. All help appreciated! |
#2
|
||||
|
||||
|
#3
|
||||
|
||||
Thanks,
Someone else told me that but I can't get it to work. Do I just replace the lines: PHP Code:
With: PHP Code:
Because this is what I did and it doesn't work like ereg does? This is as far as I have got with the form field validation bit too. If someone can help me finish this, it may be the quickest $30 paypal they've ever made! So I add: PHP Code:
If the value of $code isn't on the table then I have the redirect to http://www.mysite.com/badcode.php PLEASE help if you can and I will paypal you $50 as soon as I have it working. I'm sure that this is easy for a lot of people. Thanks. |
#4
|
|||
|
|||
PHP Code:
|
#5
|
||||
|
||||
thanks marco
you've helped me a bunch of times and i really appreciate it. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|