Lookup value in db, return associated field URL, redirect user to that URL

  • bulgin23
  • Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 16
  • Thank you received: 0

bulgin23 created the topic: Lookup value in db, return associated field URL, redirect user to that URL

I have a pretty simple requirement and interested to how if breezing forms can adapt.

Need to create a simple form for input of a token. Once entered, a mysql lookup is performed on a database that contains tokens in one field and an associated URL in the other. The associated URL for that token is returned and the user is then redirected to it.

Can this be accomplished. The very important part is redirecting the user to the exterior URL. The other important part is, can breezing forms create the database that will contain the token and associated URL, imported from a spreadsheet.

These users have disabilities and need to limit their point and click.

Thank you.
#234019
  • Posts: 1933
  • Karma: 67
  • Thank you received: 234

mihaela replied the topic: Lookup value in db, return associated field URL, redirect user to that URL

Hello,

As for the first part, here is how this can be done. You can create a form with one field only to enter the token. Then the user would have to CLICK on the SUBMIT button to be redirected to corresponding url.

That part would be solved by writing an sql query to database based on the value (token) that was entered in the form in form's Advanced pieces > More options > Submit pieces > End submit.

Here are examples of some sql quieris in End Submit crosstec.org/en/forums/1-forums/125334-m...rom-list.html#231735 , crosstec.org/en/forums/1-forums/124300-r...selected.html#227304 .

In your case you would have a simple code like for example:
$this->execPieceByName('ff_InitLib'); //Include BreezingForms Library
$db = JFactory::getDBO();//Get Database Object
$submittedtoken = ff_getSubmit('token');
$db->setQuery("Select url From #__tablename where token =". $submittedtoken );
$urlToRedirect = $db->loadResult();

Then you would simply write the code to redirect to wanted page with header function similar as explained here: crosstec.org/en/support/online-documenta...-on-select-list.html .

As for the other important part for you, the database table can't be imported from a spreadsheet using BreezinForms. You should create a table with tokens and url-s in database and then you can work on it.

Let me know whether this helped. If you have more questions, feel free to ask.

Regards,

Mihaela
#234027
  • bulgin23
  • Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 16
  • Thank you received: 0

bulgin23 replied the topic: Lookup value in db, return associated field URL, redirect user to that URL

Thank you Mihaela,

That is wonderful!

Just one point regarding the import of data from a spreadsheet.

I meant that I would create the database in mysql/phpmyadmin that breezing forms would have access to (unless Breezing forms has the capabilities to create databases, which would be easier, actually). Then I would import the tokens and their associated URLs into that database.

Are you saying that wouldn't work?
#234058
  • Posts: 1933
  • Karma: 67
  • Thank you received: 234

mihaela replied the topic: Lookup value in db, return associated field URL, redirect user to that URL

Hello again,

I think we misunderstood each other. You CAN create the database in mysql/phpmyadmin that breezing forms would have access to and manually import the tokens and their associated URLs into that database.

Before I've understood that you want BreezingForms to create database table and fills it somehow. There is a possibility to integrate BreezingForms form with the database table using the integrator, but in you case I don't think you need this since all you need is to take certain value from database table based on token entered in the form.

You can learn more about the integrator here crosstec.org/en/support/online-documenta...update-tutorial.html

Let me know whether you understand what I am trying to say and whetehr that is what you wanted to know.

Regards,

Mihaela
#234070
  • bulgin23
  • Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 16
  • Thank you received: 0

bulgin23 replied the topic: Lookup value in db, return associated field URL, redirect user to that URL

Yes Mihaela! I understand perfectly. Thank you so much for your excellent advise. I'm wishing you a very happy day!
#234076
  • Posts: 1933
  • Karma: 67
  • Thank you received: 234

mihaela replied the topic: Lookup value in db, return associated field URL, redirect user to that URL

Hello again,

Thank you for the kind words. I'm glad I've helped.
Enjoy your day as well.

Regards,

Mihaela
#234117
Moderators: ForumSupporttomeperica
Time to create page: 0.069 seconds

Community Reward

Help us to create new extensions and plugins! With only $5 you help us a lot and get unlimited download access to all of our products, professional support and even more. Get your reward now!

Read More Here

News and Updates

Get informed about new downloads, updates and more in our News and Updates newsletter.

All Extensions Subscription

Get 1 year access to all of our current and future products and 1 year of professional support -- 99€

No support per domain or website installation limits! Includes all of our current and future Joomla!® extensions, Joomla!® templates for the duration of your membership. This means, by purchasing an All Extensions Subscription you'll have it all covered!

Get it from here

3rd Party Discount - 25% Off

We help you to keep your costs under control. If you are a new member and purchased a form building tool from a different form vendor, then you'll get a 25% discount on our subscription plans.

How to receive the discount:

Send us a quick email to sales@crosstec.org with a proof of purchase (for example a paypal receipt), await payment instructions and enjoy your membership!

Community Reward

Help us to create new extensions and plugins! With only $5 you help us a lot and get unlimited download access to all of our products, professional support and even more. Get your reward now!

Read More Here