Announcement

Collapse
No announcement yet.

Created a search block but get security token was invalid

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • [Forum] Created a search block but get security token was invalid

    I have created a custom forum block using the below code i took from within. The search works using Firefox browser and returns results BUT when testing under IE and Chrome i get

    Your submission could not be processed because a security token was invalid.

    I know this is probably error on my part not being a coder as such and probably missed something.

    In addition i would like if possible to add also Search in Forum(s) list from advance search to this block as an option but getting the below to work correctly is first priority.


    Code:
    <form action="search.php?do=process" method="post" name="vbform" id="searchform" class="">
    
        <div class="section">
    
            <div class="blockrow">
                <ul class="multifield group">
                    <li>
                        <input id="keyword" class="textbox" name="query" tabindex="1" value="" type="text" size="26">
                    </li>
    
                    <li>
                        <select id="titleonly" name="titleonly" tabindex="1">
                            <option value="0" selected="selected">Search Entire Posts</option>
                            <option value="1">Search Titles Only</option>
                        </select>        
                    </li>
                </ul>
                <div id="tag_add" class="popupmenu nomouseover noclick nohovermenu popupcustom">
                    <div class="popupbody" id="tag_add_body"></div></div>
            </div>
    
            
        </div>
    
        <div class="blockfoot actionbuttons">
            <div class="group">
                <input class="button" name="dosearch" value="Search Now" tabindex="1" accesskey="s" type="submit">&nbsp;
            </div>
        </div>
    
        <input name="searchthreadid" value="" type="hidden">
    
        <input name="s" value="" type="hidden">
        <input name="securitytoken" value="1355912517-8e6dbd0ff2e050d8b5072f8dc8faa8ca3c1a0fce" type="hidden">
        <input name="searchfromtype" value="vBForum:Post" type="hidden">
        <input name="do" value="process" type="hidden">
        <input name="contenttypeid" value="1" type="hidden">
    </form>

    Thank you

  • #2
    edit your code :
    Code:
    <form action="search.php?do=process" method="post" name="vbform" id="searchform" class="">
    
        <div class="section">
    
            <div class="blockrow">
                <ul class="multifield group">
                    <li>
                        <input id="keyword" class="textbox" name="query" tabindex="1" value="" type="text" size="26">
                    </li>
    
                    <li>
                        <select id="titleonly" name="titleonly" tabindex="1">
                            <option value="0" selected="selected">Search Entire Posts</option>
                            <option value="1">Search Titles Only</option>
                        </select>        
                    </li>
                </ul>
                <div id="tag_add" class="popupmenu nomouseover noclick nohovermenu popupcustom">
                    <div class="popupbody" id="tag_add_body"></div></div>
            </div>
    
            
        </div>
    
        <div class="blockfoot actionbuttons">
            <div class="group">
                <input class="button" name="dosearch" value="Search Now" tabindex="1" accesskey="s" type="submit">&nbsp;
            </div>
        </div>
    
        <input name="searchthreadid" value="" type="hidden">
    
        <input name="s" value="" type="hidden">
        <input type="hidden" name="securitytoken" value="{vb:raw bbuserinfo.securitytoken}" />
        <input name="searchfromtype" value="vBForum:Post" type="hidden">
        <input name="do" value="process" type="hidden">
        <input name="contenttypeid" value="1" type="hidden">
    </form>
    more vBulletin mods at vBulletin.org

    Former vBulletin Support Staff
    Need Help?, Or P.M. Me

    Comment


    • #3
      Ok i replaced my code with your code and still getting Your submission could not be processed because a security token was invalid. Now its using all browsers, even closed and emptied history and cache and nothing.

      Thanks for the reply/help :-) appreciated

      Comment


      • #4
        What about this:
        PHP Code:
        <form action="search.php?do=process" method="post" name="vbform" id="searchform" class="">

            <
        div class="section">

                <
        div class="blockrow">
                    <
        ul class="multifield group">
                        <
        li>
                            <
        input id="keyword" class="textbox" name="query" tabindex="1" value="" type="text" size="26">
                        </
        li>

                        <
        li>
                            <
        select id="titleonly" name="titleonly" tabindex="1">
                                <
        option value="0" selected="selected">Search Entire Posts</option>
                                <
        option value="1">Search Titles Only</option>
                            </
        select>        
                        </
        li>
                    </
        ul>
                    <
        div id="tag_add" class="popupmenu nomouseover noclick nohovermenu popupcustom">
                        <
        div class="popupbody" id="tag_add_body"></div></div>
                </
        div>

                
            </
        div>

            <
        div class="blockfoot actionbuttons">
                <
        div class="group">
                    <
        input class="button" name="dosearch" value="Search Now" tabindex="1" accesskey="s" type="submit">&nbsp;
                </
        div>
            </
        div>

            <
        input name="searchthreadid" value="" type="hidden">
            <
        input type="hidden" name="s" value="{vb:raw session.sessionhash}" />
            <
        input type="hidden" name="securitytoken" value="{vb:raw bbuserinfo.securitytoken}"/>
            <
        input name="searchfromtype" value="vBForum:Post" type="hidden">
            <
        input name="do" value="process" type="hidden">
            <
        input name="contenttypeid" value="1" type="hidden">
        </
        form
        Last edited by Hartmut; Wed 19th Dec '12, 5:37am.
        No private support, only PM me when I ask for it. Support in the forums only.

        Comment


        • #5
          Sorry same result as before, no workie under IE, FF or chrome. Tried under both default and custom styles.

          Comment

          Related Topics

          Collapse

          Working...
          X