Hey,
I need to make a sponsorship form for a online store...but for that i need to know how can I check if emails, name and surname are already in database on validation...
exemple below:
Your name :.............
Surname :...............
email :.................
You are invited by
Name :............
Surname :.........
email : ..........
In fact, the person can suscribe only if the "you are invited" part exists in database.
I don't know if i am clear...
Hi dangee,
you are clear, you need to use a db query with the server side validation, show me your db table structure and I will show you a sample code!
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
OK thanks...but i don't know what you mean by "db table structure" 😢 Where can I find that ? Is it jos_users ??
the table which will have the list of persons who can "invite" others
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
OK, so I guess it is jos_vm_user_info with fields last_name, first_name and user_email
Please Help me Admin Master 😀
Hi Dangee,
please show me the table structure for table jos_vm_user_info which has the full list of those who can invite others!
Cheers,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
see table structure in attachment. hope this is what you want...
good, this is a sample code:
<?php
global $mainframe;
$database =& JFactory::getDBO();
$query = "SELECT * FROM `#__vm_user_info` WHERE user_email = '".$_POST['email']."'";
$database->setQuery( $query );
$result = $database->loadObject();
if(!$result)return "this user doesn't exist";
the code above needs to go into the server side validation box and the field of the invited by email should have the name "email"
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Oops...sorry it works 😀 😀
The best would be now to verify the name as well...😶