Jump to content

Archived

This topic is now archived and is closed to further replies.

Dev_Isos

GET CONFLICT

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

Share this post


Link to post
Share on other sites
[code]
<?
reset($_SERVER['argv']);
do {
    $newheader.=current($_SERVER['argv'])."&";
} while(next($_SERVER['argv']));
?>
<FORM ACTION="<? echo end(explode("/",$_SERVER['PHP_SELF']))."?".$newheader; ?>" METHOD="GET">
[/code]

Share this post


Link to post
Share on other sites

×

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.