Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 8 of 8
  1. #1
    Regular Coder mOrloff's Avatar
    Join Date
    Nov 2008
    Location
    The Great Pacific NW, USA
    Posts
    422
    Thanks
    8
    Thanked 6 Times in 6 Posts

    Can I use an Intermediate page on a form submit?

    To see my work in progress, click here.

    I am currently working with the Part Search form at the top right.
    More-so the back story than a quote. Years ago, we purchased a "Lifetime" service providing the ability to search this outside database. This service was a branch that the company attempted to diversify into, but has since stopped persueing, and as such, we can't get support any longer even though the service is still running.
    I am submitting the form to the appropriate page, and getting appropriate results (try searching "1N4001"), but they are obviously displayed with a style inconsistent to the rest of the site (because it's not our site).

    Is there a way I can have this form submit to a page within our site, then just forward the request to an iFrame for the results?
    Something like having the "action" value pointing to a local page which would then pass the POST values to a different action?
    My goal is to list the results, and have them look native.

    Any advice?

    ~ Mo
    Last edited by mOrloff; 12-16-2008 at 11:13 PM.

  • #2
    Regular Coder lokeshshettyk's Avatar
    Join Date
    Aug 2008
    Location
    On the way to the moon!
    Posts
    157
    Thanks
    5
    Thanked 20 Times in 20 Posts
    Try submitting the page to one of your own storing the values in a session/cookie var and in that page set an iframe passing the session/cookie var. hope this helps

  • #3
    Regular Coder
    Join Date
    Dec 2006
    Posts
    166
    Thanks
    9
    Thanked 4 Times in 4 Posts
    This discussion may be pertinent:
    http://stackoverflow.com/questions/2...-css-to-iframe

  • #4
    Senior Coder
    Join Date
    May 2005
    Posts
    2,137
    Thanks
    96
    Thanked 72 Times in 72 Posts
    Hmmm do you mean having the search feature only on your website and use like

    search.php?do=search:$search ?

  • #5
    Regular Coder mOrloff's Avatar
    Join Date
    Nov 2008
    Location
    The Great Pacific NW, USA
    Posts
    422
    Thanks
    8
    Thanked 6 Times in 6 Posts
    Quote Originally Posted by lokeshshettyk View Post
    Try ... storing the values in a session/cookie var and ... passing the session/cookie var...
    This is kinda what I was hoping to achieve, but as I'm pretty much a newbie, could someone please shed a little light on how to do this?

    ~Mo

  • #6
    Regular Coder mOrloff's Avatar
    Join Date
    Nov 2008
    Location
    The Great Pacific NW, USA
    Posts
    422
    Thanks
    8
    Thanked 6 Times in 6 Posts
    Quote Originally Posted by masterofollies View Post
    Hmmm do you mean having the search feature only on your website and use like
    search.php?do=search:$search ?
    As just now stated above, I'm more-or-less a newbie.
    Please explain what this search.php?do=search:$search does.

    It may be my best option, but I wouldn't recognize it as I've never come across the do=search: before.

    Thanks-a-bunch,
    ~Mo
    Last edited by mOrloff; 12-16-2008 at 04:44 PM.

  • #7
    Regular Coder
    Join Date
    Dec 2006
    Posts
    166
    Thanks
    9
    Thanked 4 Times in 4 Posts
    Basically, you have a file called search.php, and the extra bit after the ? [question mark] is called the query string. In this case, the easiest method would be to use the 'GET method' which basically appends ?var=val&var2=val2... etcetera.

    In the example that masterofollies used, your variable would be do, and your value would be 'search:$search'. Notice that it is a string though; the syntax that masterofollies uses is simply something of preference which varies from individual to individual.

    In PHP to use the information in the query string, see below. (Note that I'm using masterofollies' example)
    URL: search.php?do=search:1N4001
    PHP Code:
    $qstr $_GET['do'];  // where 'do' is the name of the variable
    $q explode(':',$qstr); //separates the type of action and the input for the action
    switch ($q[0])
    {
    case 
    'search':
      
    searchFunction($q[1]);
      break;

    default:
      break;


  • #8
    Regular Coder mOrloff's Avatar
    Join Date
    Nov 2008
    Location
    The Great Pacific NW, USA
    Posts
    422
    Thanks
    8
    Thanked 6 Times in 6 Posts
    Thanks, the colon ":" is where I was getting lost.
    Do I understand your example correctly that it doesn't have any inherent value?
    Was it simply used as a delimiter?

    Still, how would this get the query submitted to the outside page?

    ~ Mo


  •  

    Posting Permissions

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