1

I have a client that wants to setup a system that they can upload serial numbers for their products for warranty information. Then users can submit their serial number on the front-end and it would check against what was entered to see if that serial number is valid.

I'll use Solspace's Importer to allow them to upload the data to the website and build a Safecracker form for visitors, but what do you guys think would be the best way of comparing what serial numbers are valid and checking that against what the visitors enter?

There are many approaches I could take with this and wanted to hear your thoughts first!

Thanks again!

2
  • 1
    Do you need just a check if s/n is valid or you need to keep this request in db, or do some additional actions?
    – Max Lazar
    Nov 26, 2013 at 18:36
  • 1
    Yes we'll need to store that information as well. I'm thinking I'll set each serial number up as it's own entry. Then visitors will enter that information into the Safecracker form and if it matches I'll need to have other custom fields populated to tie the s/n with the user. Would you approach this differently? Nov 26, 2013 at 19:25

2 Answers 2

1

It is depended what do you want to do and how secure it must be. If just check it by s/n - make custom from,

<form action="/site/sn_check/" method="post">
    First name: <input type="text" name="firstname"><br>
</from>

then, using Mo’ Variables, get _POST value what user is entered and make request using Query module

{exp:query sql="SELECT entry_id FROM exp_channel_data WHERE field_id_10 = '{post:sn}' "}
  {entry_id}
 {if no_results} Sorry, is no s/n here! {/if}
{/exp:query}
0

Assuming the product data (including serial number) is now imported as channel entries, how about using either the {exp:channel:entries} tag with the search:myfield="" parameter, or EE's native search form?:

http://ellislab.com/expressionengine/user-guide/modules/search/index.html

Alternatively, if you're looking for more power in your search form, Solspace's Super Search module would allow you to search your channel entries for a serial number entered in a search form:

http://www.solspace.com/docs/Super_Search

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.