SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast
    Join Date
    Jan 2001
    Location
    Florence, Italy
    Posts
    48
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Before I spend days & nights figuring this out I figured I'd ask first:

    On my search results page each result has a checkbox that the visitor can tick to then send an automatic email informationrequest to that company.

    To do this, all the results are returned within one single form that then processes which checkboxes are ticked (and requires additional visitor info).

    It works great. But so far I've just tried with 3 or 4 bogus results. In real life however the number of results will be considerably more. In a normal situation I would limit the output to say 5 results per page and then put in prev and next links.

    The question: is it possible to do this while keeping all the results in the one form? Will visitors be able to navigate between the various pages ("next" "previous") to tick off boxes and then, perhaps on the last page, click the "request for information" button? Or maybe put a link together with the prev and next links. I'm not sure how to tackle this problem, or even if it's possible.

    Any input is appreciated.

    Thanks
    Willow

  2. #2
    SitePoint Wizard TWTCommish's Avatar
    Join Date
    Aug 1999
    Location
    Pittsburgh, PA, USA
    Posts
    3,910
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Something like cookies or hidden form fields would be needed for this - although I think the use of either one would be significantly complex.

    Could you go into a little more detail on this, and which you might prefer? Are you familiar with cookies/hidden fields?

  3. #3
    SitePoint Enthusiast
    Join Date
    Jan 2001
    Location
    Florence, Italy
    Posts
    48
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sorry for the delay in my reply!

    I actually do already use hidden fields in this. I'll try to give an executive summary:

    The results page shows the Supplier name and has a checkbox next to it (an array).

    echo("Tick this checkbox to send a \"Request for Dialogue\"");
    echo ("<INPUT TYPE=CHECKBOX NAME=supids[] VALUE='$ID'> ");
    } ?>

    They can tick the checkboxes of the suppliers they want to automatically send an email to and then click on a "continue" button at the bottom of the page.

    The following page presents a form where they fill in their contact info and just before the "send" button I have the hidden field:

    <?php foreach ($supids as $IDS) {

    $sup = mysql_query("select SupplierID, SupplierName from suppliers WHERE SupplierID='$IDS'");
    while ($supplier = mysql_fetch_array($sup)) {
    $ID = $supplier["SupplierID"];

    echo ("<input type=hidden NAME=ids[] value=$ID> "); } } ?>
    <input type="submit" name="send" value="Send">

    Now, I'm not sure if this code is "official" but I figured it out myself and it works.

    I probably should be able to use something like the code above, or not?

    I'm not into cookies (yet) so if it's possible with hidden fields, I'd prefer that.

    Any help you can give me is GREATLY appreciated!

    Thanks,

    Willow


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •