Jump to content

Recommended Posts

I have a GET conflict as I set the method of two forms. one form should select something that should cause the page to load and keep the first form as it is and show another form with the method GET

now I know I can use GET for the first and POST to the second ... but I need the URL to appear as:

index.php?select1=value1&select2=value2

I am doing this with smarty:
[code]
{* =============== START DISPLAY ================ *}
{* SELECT PREACHER*}
<tr>
    <td width=5%>
    <FORM ACTION="" METHOD="GET">
        <SELECT NAME="preacher" OnChange="this.form.submit();">
              <OPTION SELECTED > ÇÎÊÑ ÇáæÇÚÙ
          {section name=preacher max=$p_count loop=$preachers }
          <OPTION VALUE="{$preachers[preacher].id_p}"
                   {if $preacher == $preachers[preacher].id_p} SELECTED {/if} >{$preachers[preacher].preacher}
          </option>
          {/section}
        </SELECT>
    </FORM>
    </td>


{* END SELECT YEAR*}
{* ---------------- *}
{* SELECT DATE *}
  {if $preacher}
    <td width=40%>

    <FORM ACTION="" METHOD="GET">
        <SELECT NAME="year" OnChange="this.form.submit();">
              <OPTION SELECTED > ÇÎÊÑ ÇáÓäÉ
          {section name=year max=$y_count loop=$years }
          <OPTION VALUE="{$years[year].year}"
                   {if $year == $years[year].year }
                   SELECTED {/if}>
                   {$years[year].year}
          </option>
          {/section}
        </SELECT>
    </FORM>
    </td>

  {/if}
{* END SELECT YEAR*}
{* ---------------- *}
[/code]
now as you can see the first form is to select a preacher so after selecting it the URL goes like this: index.php?preacher=1
at the same time the page loads and the second form should appear with to select a year. I need the URL to go like this: index.php?preacher=1&year=2005 ... ofcourse that would display records later according to both of these values.

any help will be appriciated
Link to comment
https://forums.phpfreaks.com/topic/3849-get-conflict/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.