Topic: Simple form needed for page re-direction

Hi guys, maybe someone can help me here. We have three customer order forms with different prices on each form. On the index page of our site we would like a small 'textfield' where the customer enters their account number, presses Go and it automatically directs them to the correct form for them. No passwords required or anything.

Presumably I need to somehow create a list of all the account numbers in mysql, and then match each set of account numbers to the correct order form.

Can anyone give me some guidance or help with this? Thanks.

2 (edited by Tobi 2006-08-29 07:39)

Re: Simple form needed for page re-direction

You will have to make a table with all th account numbers that's right.
You will end up there anyway one day, so I advise you to ad at least the basic client data.
Your table ACCOUNTS will contain the fields
ACT_ID
ACT_NO
ACT_CLIENTNAME
ACT_PRICELEVEL
..and so son
the last one you can use for your form.
The form field will have the name ACT_NO in this example.
So every time the form is submitted you do  a query like

$pr = $db->query("select ACT_PRICELEVEL from ACCOUNTS where ACT_NO=".intval($_REQUEST['ACT_NO']);
$ACT_PRICELEVEL = $db->result($pr);
Header("Location:pricelist_" . $ACT_PRICELEVEL . ".php");

Al you need to do is create pages by the names pricelist_1.php, pricelist_2.php and so on and set the valus 1,2, in the ACCOUNT-table for the corresponding account numbers.
Since I don't    know what db functions you use this assumes you take the ones from punbb.
Hope this gets you on the right tracks.
Mind you that for various reasons this method is not very safe; a "real" merchant system would do it totally differently.
But maybe for your purpose it's OK.

The German PunBB Site:
PunBB-forum.de